Skip to content

Commit

Permalink
fix(contour): should not display on stack viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Oct 4, 2023
1 parent 2c0a845 commit 1d514a6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
getEnabledElementByIds,
Types,
utilities as csUtils,
StackViewport,
} from '@cornerstonejs/core';

import Representations from '../../../enums/SegmentationRepresentations';
Expand Down Expand Up @@ -128,6 +129,13 @@ async function render(
const contourData = segmentation.representationData[Representations.Contour];
const { geometryIds } = contourData;


// We don't have a good way to handle stack viewports for contours at the moment.
// Plus, if we add a segmentation to one viewport, it gets added to all the viewports in the toolGroup too.
if (viewport instanceof StackViewport) {
return;
}

if (!geometryIds?.length) {
console.warn(
`No contours found for segmentationId ${segmentationId}. Skipping render.`
Expand Down

0 comments on commit 1d514a6

Please sign in to comment.