Synchronizing segmentations across viewports
In my extension, I am creating a segmentation with
loadSegmentationsForViewport
and then modifying it with
const volumeObject = segmentationService.getLabelmapVolume('1');
const { voxelManager } = volumeObject;
voxelManager?.setCompleteScalarDataArray(myData);
similar to what the MONAILabel extension is doing. I have noticed the following:
- when I am in MPR view when I call
loadSegmentationsForViewport
, it will only display the segmentation in the current viewport. - when I am in single viewport mode, call
loadSegmentationsForViewport
, switch to MPR, and then edit thevolumeObject
it will show the seg in all viewports.
How can I make sure to always synchronize the segmentation across viewports ?