Skip to content

Commit

Permalink
IDC Re #2656: update dcmjs and change tol to 0.01. + fix boundary cas…
Browse files Browse the repository at this point in the history
…es in parseSCOORD3D
  • Loading branch information
Punzo committed Feb 3, 2022
1 parent e4a75c2 commit f70b83a
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 20 deletions.
2 changes: 1 addition & 1 deletion extensions/cornerstone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"cornerstone-math": "^0.1.9",
"cornerstone-tools": "^6.0.6",
"cornerstone-wado-image-loader": "^4.1.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"dicom-parser": "^1.8.11",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"peerDependencies": {
"@ohif/core": "^0.50.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"prop-types": "^15.6.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom-rt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ohif/core": "^0.50.0",
"cornerstone-core": "^2.6.1",
"cornerstone-tools": "^6.0.6",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"gl-matrix": "^3.3.0",
"prop-types": "^15.6.2",
"react": "^16.8.6",
Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom-segmentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ohif/core": "^0.50.0",
"cornerstone-core": "^2.6.1",
"cornerstone-tools": "^6.0.6",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"prop-types": "^15.6.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,16 @@ export default function getSopClassHandlerModule({ servicesManager }) {
}

function _parseSeg(arrayBuffer, imageIds) {
const skipOverlapping = false;
const tolerance = 1e-2;
const cornerstoneToolsVersion = 4;
return dcmjs.adapters.Cornerstone.Segmentation.generateToolState(
imageIds,
arrayBuffer,
cornerstone.metaData
cornerstone.metaData,
skipOverlapping,
tolerance,
cornerstoneToolsVersion
);
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/dicom-tag-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"peerDependencies": {
"@ohif/core": "^2.6.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"react": "^16.8.6"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion extensions/vtk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"cornerstone-core": "^2.6.1",
"cornerstone-tools": "^6.0.6",
"cornerstone-wado-image-loader": "^4.1.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"dicom-parser": "^1.8.11",
"i18next": "^17.0.3",
"i18next-browser-languagedetector": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion platform/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@babel/runtime": "^7.5.5",
"ajv": "^6.10.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"dicomweb-client": "^0.8.3",
"immer": "6.0.2",
"isomorphic-base64": "^1.0.2",
Expand Down
8 changes: 7 additions & 1 deletion platform/core/src/DICOMSR/SCOORD3D/parseSCOORD3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ const parseSCOORD3D = ({ servicesManager, displaySets }) => {
srDisplaySet.isRehydratable = isRehydratable(srDisplaySet, mappings);
srDisplaySet.isLoaded = true;

const imageDisplaySets = displaySets.filter(ds => ds.Modality !== 'SR');
const imageDisplaySets = displaySets.filter(
ds =>
ds.Modality !== 'SR' &&
ds.Modality !== 'SEG' &&
ds.Modality !== 'RTSTRUCT' &&
ds.Modality !== 'RTDOSE'
);
imageDisplaySets.forEach(imageDisplaySet => {
// Check currently added displaySets and add measurements if the sources exist.
checkIfCanAddMeasurementsToDisplaySet(srDisplaySet, imageDisplaySet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ const getReferencedImagesList = ImagingMeasurementReportContentSequence => {

getSequenceAsArray(ImageLibraryGroup.ContentSequence).forEach(item => {
const { ReferencedSOPSequence } = item;
const {
ReferencedSOPClassUID,
ReferencedSOPInstanceUID,
} = ReferencedSOPSequence;

referencedImages.push({ ReferencedSOPClassUID, ReferencedSOPInstanceUID });
if (ReferencedSOPSequence) {
const {
ReferencedSOPClassUID,
ReferencedSOPInstanceUID,
} = ReferencedSOPSequence;

referencedImages.push({
ReferencedSOPClassUID,
ReferencedSOPInstanceUID,
});
}
});

return referencedImages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ const processNonGeometricallyDefinedMeasurement = mergedContentSequence => {
MeasuredValueSequence,
} = item;

if (!ContentSequence) {
console.warn(`Graphic ${ContentSequence} missing, skipping annotation.`);

return;
}

const { ValueType } = ContentSequence;

if (!ValueType === 'SCOORD' && !ValueType === 'SCOORD3D') {
Expand Down
2 changes: 1 addition & 1 deletion platform/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"cornerstone-math": "^0.1.9",
"cornerstone-tools": "^6.0.6",
"cornerstone-wado-image-loader": "^4.1.0",
"dcmjs": "0.19.3",
"dcmjs": "0.19.4",
"dicom-parser": "^1.8.11",
"dicomweb-client": "^0.8.3",
"hammerjs": "^2.0.8",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6942,10 +6942,10 @@ dateformat@^3.0.0:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==

[email protected].3:
version "0.19.3"
resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.19.3.tgz#8b0c3ea920a09d1646493504a711b32c7d54aec3"
integrity sha512-MpUQF7AIvyIa291i7WoQ1PUClNLes11XBFe9IOP02mNkmjWCptE7JuvpD2maSuVaMY48ZIi0krOdn1Y+M3OmqA==
[email protected].4:
version "0.19.4"
resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.19.4.tgz#b2ce1cc1e672ead3fba12bafd2e8a655b398601a"
integrity sha512-ZpOsuyBMcmDVPo0EtqztRGu1ARKMqIfbJGbtDxmBwxeE5SEHMQJvrZHhyLoxuS10R3w+jL2SJ0r7Dn9aSDZH1w==
dependencies:
"@babel/polyfill" "^7.8.3"
"@babel/runtime" "^7.8.4"
Expand Down

0 comments on commit f70b83a

Please sign in to comment.