Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion extensions/cornerstone/src/commandsModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ function commandsModule({
? Enums.SegmentationRepresentations.Labelmap
: Enums.SegmentationRepresentations.Contour;

segmentationService.addSegmentationRepresentation(activeViewportId, {
await segmentationService.addSegmentationRepresentation(activeViewportId, {
segmentationId: displaySet.displaySetInstanceUID,
type: representationType,
});
Expand All @@ -300,6 +300,27 @@ function commandsModule({
return;
}

const disableEditing = customizationService.getCustomization(
'panelSegmentation.disableEditing'
);
if (disableEditing) {
const activeViewportId = viewportGridService.getActiveViewportId();
const segmentationRepresentations = segmentationService.getSegmentationRepresentations(
activeViewportId
);

segmentationRepresentations.forEach(representation => {
const segmentIndices = Object.keys(representation.segments);
segmentIndices.forEach(segmentIndex => {
segmentationService.setSegmentLocked(
representation.segmentationId,
parseInt(segmentIndex),
true
);
});
});
}

console.info('Segmentations loaded for active viewport.');
},
jumpToMeasurementViewport: ({ annotationUID, measurement }) => {
Expand Down
Loading