Operating system: Windows 10
Slicer version: 4.13.0
Imported a Dicom file
Segmented by painting slices
(a rotatable shape renders on the stage)
Created a Py Extension using Developer Tools | Wizard
added a callback to a Qt control:
volumeNode = slicer.util.getNode(‘volName’)
print(volumeNode) # vtkMRMLScalarVolumeNode properties as expected
I have been unable to:
reposition or rotate the volume on the stage in code
set the color of the volume
cause any change to the staged volume, ex.
all help appreciated!
Depending on what your goal is this may not be the optimum path but you can start by converting the scalar volume node to a label map volume and create a segmentation node from it. You can then change the color of certain segments.
For rotating and translation you can create a transform node and set that node as the parent transform for the segmentation node.
There are examples in the script repository to do the above and a lot more.
If the volume is already rotatable using the mouse on the stage, why does a transform node need to be created?
Also if I run util.getNodes(), I already have a vtkMRMLSegmentationNode, vtkMRMLSegmentationStorageNode and vtkMRMLSegmentationDisplayNode. Do I still need Labelmap-> segment and if so why, thank you.
Technically you’re moving the camera in the scene, not the volume. Like this you can create transforms for each node in the scene when you have more than one node in it.
If you already have a SegmentationNode with your segments in it, then you’re set, no need for conversion.