fix(segmentationService): prevent no representation crash (#5495)
This commit is contained in:
1 parent
a1c6b5f3ec
commit
3137aed017
2 files changed
+12
-18
No files matched your search
@@ -1756,22 +1756,16 @@ class SegmentationService extends PubSubService {
|
||||
segmentationId: string,
|
||||
type: csToolsEnums.SegmentationRepresentations
|
||||
): void => {
|
||||
const representations = this.getSegmentationRepresentations(viewportId, {
|
||||
segmentationId,
|
||||
type,
|
||||
});
|
||||
const representation = representations[0];
|
||||
|
||||
const segmentsHidden = cstSegmentation.config.visibility.getHiddenSegmentIndices(viewportId, {
|
||||
segmentationId,
|
||||
type: representation.type,
|
||||
type,
|
||||
});
|
||||
|
||||
const currentVisibility = segmentsHidden.size === 0;
|
||||
this._setSegmentationRepresentationVisibility(
|
||||
viewportId,
|
||||
segmentationId,
|
||||
representation.type,
|
||||
type,
|
||||
!currentVisibility
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user