fix: Pass the correct sop uid + frame for rehydration to prevent associating rehydrated measurements with the wrong data (#5506)

* fix: [#2404] by passing the right sop uid map

* Update PR with requried CS3D fixes

* Update to released versions - had wrong release number
This commit is contained in:
Bill Wallace authored and GitHub committed 2025-10-20 11:23:26 -04:00
1 parent 82c4a0a8d0
commit 503780247c
13 files changed
+244 -227

No files matched your search

@@ -46,8 +46,8 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/adapters": "4.5.13",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/adapters": "4.5.19",
"@cornerstonejs/core": "4.5.19",
"@kitware/vtk.js": "32.12.0",
"react-color": "2.19.3"
}
@@ -46,8 +46,8 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/adapters": "4.5.13",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/adapters": "4.5.19",
"@cornerstonejs/core": "4.5.19",
"@kitware/vtk.js": "32.12.0",
"react-color": "2.19.3"
}
+3 -3
View File
@@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/adapters": "4.5.13",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/tools": "4.5.13",
"@cornerstonejs/adapters": "4.5.19",
"@cornerstonejs/core": "4.5.19",
"@cornerstonejs/tools": "4.5.19",
"classnames": "2.5.1"
}
}
@@ -74,17 +74,13 @@ export default function hydrateStructuredReport(
);
const sopInstanceUIDToImageId = {};
const imageIdsForToolState = {};
displaySet.measurements.forEach(measurement => {
const { ReferencedSOPInstanceUID, imageId, frameNumber } = measurement;
const { ReferencedSOPInstanceUID, imageId, frameNumber=1 } = measurement;
const key = `${ReferencedSOPInstanceUID}:${frameNumber}`;
if (!sopInstanceUIDToImageId[ReferencedSOPInstanceUID]) {
sopInstanceUIDToImageId[ReferencedSOPInstanceUID] = imageId;
imageIdsForToolState[ReferencedSOPInstanceUID] = [];
}
if (!imageIdsForToolState[ReferencedSOPInstanceUID][frameNumber]) {
imageIdsForToolState[ReferencedSOPInstanceUID][frameNumber] = imageId;
if (!sopInstanceUIDToImageId[key]) {
sopInstanceUIDToImageId[key] = imageId;
}
});
@@ -133,10 +129,8 @@ export default function hydrateStructuredReport(
// dcmjs and Cornerstone3D has structural defect in supporting multi-frame
// files, and looking up the imageId from sopInstanceUIDToImageId results
// in the wrong value.
const frameNumber = (toolData.annotation.data && toolData.annotation.data.frameNumber) || 1;
const imageId =
imageIdsForToolState[toolData.sopInstanceUid][frameNumber] ||
sopInstanceUIDToImageId[toolData.sopInstanceUid];
const frameNumber = toolData.annotation.data?.frameNumber || 1;
const imageId = sopInstanceUIDToImageId[`${toolData.sopInstanceUid}:${frameNumber}`];
if (!imageIds.includes(imageId)) {
imageIds.push(imageId);
@@ -175,9 +169,7 @@ export default function hydrateStructuredReport(
// files, and looking up the imageId from sopInstanceUIDToImageId results
// in the wrong value.
const frameNumber = (toolData.annotation.data && toolData.annotation.data.frameNumber) || 1;
const imageId =
imageIdsForToolState[toolData.sopInstanceUid][frameNumber] ||
sopInstanceUIDToImageId[toolData.sopInstanceUid];
const imageId = sopInstanceUIDToImageId[`${toolData.sopInstanceUid}:${frameNumber}`];
if (!imageId) {
return getReferenceData3D(toolData, servicesManager);
@@ -42,8 +42,8 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/tools": "4.5.13",
"@cornerstonejs/core": "4.5.19",
"@cornerstonejs/tools": "4.5.19",
"classnames": "2.5.1"
}
}
+7 -7
View File
@@ -40,7 +40,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "1.2.2",
"@cornerstonejs/codec-openjpeg": "1.2.4",
"@cornerstonejs/codec-openjph": "2.4.7",
"@cornerstonejs/dicom-image-loader": "4.5.13",
"@cornerstonejs/dicom-image-loader": "4.5.19",
"@ohif/core": "3.12.0-beta.68",
"@ohif/ui": "3.12.0-beta.68",
"dcmjs": "0.43.1",
@@ -53,12 +53,12 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/adapters": "4.5.13",
"@cornerstonejs/ai": "4.5.13",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/labelmap-interpolation": "4.5.13",
"@cornerstonejs/polymorphic-segmentation": "4.5.13",
"@cornerstonejs/tools": "4.5.13",
"@cornerstonejs/adapters": "4.5.19",
"@cornerstonejs/ai": "4.5.19",
"@cornerstonejs/core": "4.5.19",
"@cornerstonejs/labelmap-interpolation": "4.5.19",
"@cornerstonejs/polymorphic-segmentation": "4.5.19",
"@cornerstonejs/tools": "4.5.19",
"@itk-wasm/morphological-contour-interpolation": "1.1.0",
"@kitware/vtk.js": "32.12.0",
"html2canvas": "1.4.1",
+2 -2
View File
@@ -32,8 +32,8 @@
"start": "yarn run dev"
},
"peerDependencies": {
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/tools": "4.5.13",
"@cornerstonejs/core": "4.5.19",
"@cornerstonejs/tools": "4.5.19",
"@ohif/core": "3.12.0-beta.68",
"@ohif/extension-cornerstone-dicom-sr": "3.12.0-beta.68",
"@ohif/extension-default": "3.12.0-beta.68",
+2 -2
View File
@@ -42,8 +42,8 @@
},
"dependencies": {
"@babel/runtime": "7.28.2",
"@cornerstonejs/core": "4.5.13",
"@cornerstonejs/tools": "4.5.13",
"@cornerstonejs/core": "4.5.19",
"@cornerstonejs/tools": "4.5.19",
"@ohif/core": "3.12.0-beta.68",
"@ohif/extension-cornerstone": "3.12.0-beta.68",
"@ohif/extension-default": "3.12.0-beta.68",