Don't try and "getImageSrc" for datasets without imageIds (DICOM SR)
This commit is contained in:
parent
86c758e2f9
commit
be6a04684b
@ -49,6 +49,7 @@ function PanelStudyBrowser({
|
|||||||
}
|
}
|
||||||
|
|
||||||
StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));
|
StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [StudyInstanceUIDs, getStudiesForPatientByStudyInstanceUID]);
|
}, [StudyInstanceUIDs, getStudiesForPatientByStudyInstanceUID]);
|
||||||
|
|
||||||
// ~~ Initial Thumbnails
|
// ~~ Initial Thumbnails
|
||||||
@ -62,12 +63,18 @@ function PanelStudyBrowser({
|
|||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);
|
if (imageId) {
|
||||||
setThumbnailImageSrcMap(prevState => {
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
});
|
imageId
|
||||||
|
);
|
||||||
|
setThumbnailImageSrcMap(prevState => {
|
||||||
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// ~~ displaySets
|
// ~~ displaySets
|
||||||
@ -80,6 +87,7 @@ function PanelStudyBrowser({
|
|||||||
);
|
);
|
||||||
|
|
||||||
setDisplaySets(mappedDisplaySets);
|
setDisplaySets(mappedDisplaySets);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [thumbnailImageSrcMap]);
|
}, [thumbnailImageSrcMap]);
|
||||||
|
|
||||||
// ~~ subscriptions --> displaySets
|
// ~~ subscriptions --> displaySets
|
||||||
@ -96,13 +104,16 @@ function PanelStudyBrowser({
|
|||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
if (imageId) {
|
||||||
imageId
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
);
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
setThumbnailImageSrcMap(prevState => {
|
imageId
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
);
|
||||||
});
|
setThumbnailImageSrcMap(prevState => {
|
||||||
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -125,6 +136,7 @@ function PanelStudyBrowser({
|
|||||||
SubscriptionDisplaySetsAdded.unsubscribe();
|
SubscriptionDisplaySetsAdded.unsubscribe();
|
||||||
SubscriptionDisplaySetsChanged.unsubscribe();
|
SubscriptionDisplaySetsChanged.unsubscribe();
|
||||||
};
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const tabs = _createStudyBrowserTabs(
|
const tabs = _createStudyBrowserTabs(
|
||||||
|
|||||||
@ -54,6 +54,7 @@ function PanelStudyBrowserTracking({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [MeasurementService, activeViewportIndex, sendTrackedMeasurementsEvent]);
|
}, [MeasurementService, activeViewportIndex, sendTrackedMeasurementsEvent]);
|
||||||
|
|
||||||
const { trackedStudy, trackedSeries } = trackedMeasurements.context;
|
const { trackedStudy, trackedSeries } = trackedMeasurements.context;
|
||||||
@ -82,6 +83,7 @@ function PanelStudyBrowserTracking({
|
|||||||
}
|
}
|
||||||
|
|
||||||
StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));
|
StudyInstanceUIDs.forEach(sid => fetchStudiesForPatient(sid));
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [StudyInstanceUIDs, getStudiesForPatientByStudyInstanceUID]);
|
}, [StudyInstanceUIDs, getStudiesForPatientByStudyInstanceUID]);
|
||||||
|
|
||||||
// ~~ Initial Thumbnails
|
// ~~ Initial Thumbnails
|
||||||
@ -95,12 +97,18 @@ function PanelStudyBrowserTracking({
|
|||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);
|
if (imageId) {
|
||||||
setThumbnailImageSrcMap(prevState => {
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
});
|
imageId
|
||||||
|
);
|
||||||
|
setThumbnailImageSrcMap(prevState => {
|
||||||
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [DisplaySetService, dataSource, getImageSrc]);
|
}, [DisplaySetService, dataSource, getImageSrc]);
|
||||||
|
|
||||||
// ~~ displaySets
|
// ~~ displaySets
|
||||||
@ -115,6 +123,7 @@ function PanelStudyBrowserTracking({
|
|||||||
);
|
);
|
||||||
|
|
||||||
setDisplaySets(mappedDisplaySets);
|
setDisplaySets(mappedDisplaySets);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [
|
}, [
|
||||||
DisplaySetService.activeDisplaySets,
|
DisplaySetService.activeDisplaySets,
|
||||||
trackedSeries,
|
trackedSeries,
|
||||||
@ -135,14 +144,16 @@ function PanelStudyBrowserTracking({
|
|||||||
);
|
);
|
||||||
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
const imageIds = dataSource.getImageIdsForDisplaySet(displaySet);
|
||||||
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
const imageId = imageIds[Math.floor(imageIds.length / 2)];
|
||||||
|
// TODO: Is it okay that imageIds are not returned here for SR displaysets?
|
||||||
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
if (imageId) {
|
||||||
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
|
||||||
imageId
|
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(
|
||||||
);
|
imageId
|
||||||
setThumbnailImageSrcMap(prevState => {
|
);
|
||||||
return { ...prevState, ...newImageSrcEntry };
|
setThumbnailImageSrcMap(prevState => {
|
||||||
});
|
return { ...prevState, ...newImageSrcEntry };
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -167,6 +178,7 @@ function PanelStudyBrowserTracking({
|
|||||||
SubscriptionDisplaySetsAdded.unsubscribe();
|
SubscriptionDisplaySetsAdded.unsubscribe();
|
||||||
SubscriptionDisplaySetsChanged.unsubscribe();
|
SubscriptionDisplaySetsChanged.unsubscribe();
|
||||||
};
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [
|
}, [
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
dataSource,
|
dataSource,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user