fix(RT) : Make ContourImageSequence check under ROIContourSequence->ContourImageSequence optional (#3476)

This commit is contained in:
dxlin 2023-06-19 09:01:23 -04:00 committed by GitHub
parent 652e61a417
commit e6f73a2025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 41 deletions

View File

@ -181,12 +181,6 @@ export default async function loadRTStruct(
ContourGeometricType,
} = ContourSequenceArray[c];
const sopInstanceUID = ContourImageSequence.ReferencedSOPInstanceUID;
const imageId = _getImageId(imageIdSopInstanceUidPairs, sopInstanceUID);
if (!imageId) {
continue;
}
let isSupported = false;
const points = [];

View File

@ -816,7 +816,12 @@ class SegmentationService extends PubSubService {
const segmentsCachedStats = {};
const initializeContour = async rtStructData => {
const { data, id, color, segmentIndex, geometryId } = rtStructData;
const geometry = await geometryLoader.createAndCacheGeometry(geometryId, {
// catch error instead of failing to allow loading to continue
try {
const geometry = await geometryLoader.createAndCacheGeometry(
geometryId,
{
geometryData: {
data,
id,
@ -825,7 +830,8 @@ class SegmentationService extends PubSubService {
segmentIndex,
},
type: csEnums.GeometryType.CONTOUR,
});
}
);
const contourSet = geometry.data;
const centroid = contourSet.getCentroid();
@ -855,6 +861,9 @@ class SegmentationService extends PubSubService {
// some missing ROINumbers
numSegments: allRTStructData.length,
});
} catch (e) {
console.warn(e);
}
};
const promiseArray = [];