Hello all,
I’m currently making an extension that has some heart-related features, I give the currently displayed VolumeNode array to a Deep Learning model to get an array of the heart’s segmentation, then load it into a LabelMapVolume to create a segmentation node from it.
I want it to show the segmentation on top of the volume containing the heart, however, the only way that I get the segmentation to show is by using the GUI to hide the volume, then toggling the Label or Segmentation, unhiding the Volume hides the segmentation/label.
# Create a new LabelMapVolume
LabelMapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode', f'{Name}-Label')
# Update the LabelMapVolume from the given Segmentation array
slicer.util.updateVolumeFromArray(LabelMapVolumeNode, Segmentation)
# Create a SegmentationNode
SegNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLSegmentationNode", f'{Name}-Segmentation')
# Load the LabelMapVolume into the SegmentationNode
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(LabelMapVolumeNode, SegNode)
# Create Closed Surface Representation
if HeartSegVis:
SegNode.CreateClosedSurfaceRepresentation()
Any help will be much appreciated, sorry for the long explanation
Thanks,