feat(thumbnails): Enhance DICOM Thumbnail Rendering with different strategies (#5004)
Co-authored-by: Martin Bellehumeur, M. Eng. <23396581+mbellehumeur@users.noreply.github.com>
This commit is contained in:
1 parent
dee6909a99
commit
578c3939f0
80 files changed
+371
-284
No files matched your search
@@ -38,7 +38,7 @@
|
||||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
|
||||
"@cornerstonejs/codec-openjpeg": "^1.2.4",
|
||||
"@cornerstonejs/codec-openjph": "^2.4.5",
|
||||
"@cornerstonejs/dicom-image-loader": "^3.12.1",
|
||||
"@cornerstonejs/dicom-image-loader": "^3.12.2",
|
||||
"@ohif/core": "3.11.0-beta.27",
|
||||
"@ohif/ui": "3.11.0-beta.27",
|
||||
"dcmjs": "*",
|
||||
@@ -51,12 +51,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@cornerstonejs/adapters": "^3.12.1",
|
||||
"@cornerstonejs/ai": "^3.12.1",
|
||||
"@cornerstonejs/core": "^3.12.1",
|
||||
"@cornerstonejs/labelmap-interpolation": "^3.12.1",
|
||||
"@cornerstonejs/polymorphic-segmentation": "^3.12.1",
|
||||
"@cornerstonejs/tools": "^3.12.1",
|
||||
"@cornerstonejs/adapters": "^3.12.2",
|
||||
"@cornerstonejs/ai": "^3.12.2",
|
||||
"@cornerstonejs/core": "^3.12.2",
|
||||
"@cornerstonejs/labelmap-interpolation": "^3.12.2",
|
||||
"@cornerstonejs/polymorphic-segmentation": "^3.12.2",
|
||||
"@cornerstonejs/tools": "^3.12.2",
|
||||
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
|
||||
"@kitware/vtk.js": "32.12.0",
|
||||
"html2canvas": "^1.4.1",
|
||||
|
||||
@@ -17,6 +17,7 @@ const SOPClassHandlerId =
|
||||
'@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler';
|
||||
|
||||
function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager) {
|
||||
const dataSource = extensionManager.getActiveDataSource()[0];
|
||||
// If the series has no instances, stop here
|
||||
if (!instances || !instances.length) {
|
||||
throw new Error('No instances were provided');
|
||||
@@ -33,22 +34,6 @@ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager)
|
||||
currentFrames = framesI;
|
||||
}
|
||||
}
|
||||
let imageIdForThumbnail = null;
|
||||
const dataSource = extensionManager.getActiveDataSource()[0];
|
||||
if (singleFrameInstance) {
|
||||
if (currentFrames == 1) {
|
||||
// Not all DICOM server implementations support thumbnail service,
|
||||
// So if we have a single-frame image, we will prefer it.
|
||||
imageIdForThumbnail = singleFrameInstance.imageId;
|
||||
}
|
||||
if (!imageIdForThumbnail) {
|
||||
// use the thumbnail service provided by DICOM server
|
||||
imageIdForThumbnail = dataSource.getImageIdsForInstance({
|
||||
instance: singleFrameInstance,
|
||||
thumbnail: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
FrameOfReferenceUID,
|
||||
@@ -108,11 +93,14 @@ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager)
|
||||
instance,
|
||||
numImageFrames: 0,
|
||||
numInstances: 1,
|
||||
imageIdForThumbnail, // thumbnail image
|
||||
others: instances, // all other level instances in the image Pyramid
|
||||
instances,
|
||||
othersFrameOfReferenceUID,
|
||||
imageIds: instances.map(instance => instance.imageId),
|
||||
getThumbnailSrc: dataSource.retrieve.getGetThumbnailSrc?.(
|
||||
singleFrameInstance,
|
||||
singleFrameInstance.imageId
|
||||
),
|
||||
label: SeriesDescription || `${i18n.t('Series')} ${SeriesNumber} - ${i18n.t('SM')}`,
|
||||
};
|
||||
// The microscopy viewer directly accesses the metadata already loaded, and
|
||||
|
||||
Reference in new issue
Block a user