Skip to content

Commit

Permalink
IDC Re OHIF#2633: fix slider min and max (OHIF#2634)
Browse files Browse the repository at this point in the history
* IDC Re OHIF#2633: fix slider min and max
  • Loading branch information
Punzo authored Dec 10, 2021
1 parent abf050e commit ed501bb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DicomTagBrowser = ({ displaySets, displaySetInstanceUID }) => {
activeDisplaySetInstanceUID,
setActiveDisplaySetInstanceUID,
] = useState(displaySetInstanceUID);
const [activeInstance, setActiveInstance] = useState(0);
const [activeInstance, setActiveInstance] = useState(1);
const [tags, setTags] = useState([]);
const [meta, setMeta] = useState('');
const [instanceList, setInstanceList] = useState([]);
Expand Down Expand Up @@ -51,7 +51,7 @@ const DicomTagBrowser = ({ displaySets, displaySetInstanceUID }) => {
description: displayDate,
onClick: () => {
setActiveDisplaySetInstanceUID(displaySetInstanceUID);
setActiveInstance(0);
setActiveInstance(1);
},
};
});
Expand All @@ -65,7 +65,7 @@ const DicomTagBrowser = ({ displaySets, displaySetInstanceUID }) => {

if (isImageStack) {
const { images } = activeDisplaySet;
const image = images[activeInstance];
const image = images[activeInstance - 1];

instanceList = images.map((image, index) => {
const metadata = image.getData().metadata;
Expand Down Expand Up @@ -107,7 +107,7 @@ const DicomTagBrowser = ({ displaySets, displaySetInstanceUID }) => {
showValue
step={1}
min={1}
max={instanceList.length - 1}
max={instanceList.length}
value={activeInstance}
valueRenderer={value => <p>Instance Number: {value}</p>}
onChange={({ target }) => {
Expand Down

0 comments on commit ed501bb

Please sign in to comment.