Skip to content

Commit

Permalink
fix: use metadataProvider option instead of cornerstone.metaData (#280)
Browse files Browse the repository at this point in the history
* fix: Re IDC #2761 fix loading of segmentations

* fix: 🐛 use metadataProvider option instead of cornerstone.metaData in Segmentation_4X
  • Loading branch information
Punzo authored Jun 13, 2022
1 parent 98445f8 commit 8e4bffd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/adapters/Cornerstone/Segmentation_4X.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ function findReferenceSourceImageId(
FrameOfReferenceUID,
PerFrameFunctionalGroup,
imageIds,
metadataProvider,
tolerance
);
}
Expand Down Expand Up @@ -730,9 +731,6 @@ function checkSEGsOverlapping(

let frameSegmentsMapping = new Map();
for (let frameSegment = 0; frameSegment < groupsLen; ++frameSegment) {
const PerFrameFunctionalGroups =
PerFrameFunctionalGroupsSequence[frameSegment];

const segmentIndex = getSegmentIndex(multiframe, frameSegment);
if (segmentIndex === undefined) {
console.warn(
Expand Down Expand Up @@ -933,7 +931,7 @@ function insertOverlappingPixelDataPlanar(
continue;
}

const sourceImageMetadata = cornerstone.metaData.get(
const sourceImageMetadata = metadataProvider.get(
"instance",
imageId
);
Expand Down Expand Up @@ -1105,10 +1103,7 @@ function insertPixelDataPlanar(
continue;
}

const sourceImageMetadata = cornerstone.metaData.get(
"instance",
imageId
);
const sourceImageMetadata = metadataProvider.get("instance", imageId);
if (
Rows !== sourceImageMetadata.Rows ||
Columns !== sourceImageMetadata.Columns
Expand Down Expand Up @@ -1302,6 +1297,7 @@ function getImageIdOfSourceImagebySourceImageSequence(
* @param {String} FrameOfReferenceUID Frame of reference.
* @param {Object} PerFrameFunctionalGroup Sequence describing segmentation reference attributes per frame.
* @param {String[]} imageIds A list of imageIds.
* @param {Object} metadataProvider A Cornerstone metadataProvider to query
* @param {Float} tolerance The tolerance parameter
*
* @return {String} The corresponding imageId.
Expand All @@ -1311,6 +1307,7 @@ function getImageIdOfSourceImagebyGeometry(
FrameOfReferenceUID,
PerFrameFunctionalGroup,
imageIds,
metadataProvider,
tolerance
) {
if (
Expand All @@ -1328,7 +1325,7 @@ function getImageIdOfSourceImagebyGeometry(
imageIdsIndexc < imageIds.length;
++imageIdsIndexc
) {
const sourceImageMetadata = cornerstone.metaData.get(
const sourceImageMetadata = metadataProvider.get(
"instance",
imageIds[imageIdsIndexc]
);
Expand Down

0 comments on commit 8e4bffd

Please sign in to comment.