Hi developers,
What is the python function to set the slice views as “FOV, spacing match Volumes” instead of “FOV, spacing match 2D” ?
Thank you,
Best
Hi developers,
What is the python function to set the slice views as “FOV, spacing match Volumes” instead of “FOV, spacing match 2D” ?
Thank you,
Best
It controls how Slicer generates pixels of the slice that is shown in the 3D view. See more details here. Let us know if you need more details.
Hello,
Thank you for your answer. I know what is done, I just would like to know how can I automatically set this option with my own script in python ?
Thank you
How to find a Python function for any Slicer features:
"FOV, spacing match Volumes"
(adding quotes around the text makes sure it finds that exact text)actionSliceModelModeVolumes
setSliceModelModeVolumes
method, which calls this->setSliceModelMode(vtkMRMLSliceNode::SliceResolutionMatchVolumes)
, which then calls d->MRMLSliceNode->SetSliceResolutionMode(mode)
This means that this action calls someSliceNode->SetSliceResolutionMode(vtkMRMLSliceNode::SliceResolutionMatchVolumes)
in Python syntax it is someSliceNode.SetSliceResolutionMode(slicer.vtkMRMLSliceNode.SliceResolutionMatchVolumes)
. For example, for the red slice node this will be:
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
sliceNode.SetSliceResolutionMode(slicer.vtkMRMLSliceNode.SliceResolutionMatchVolumes)
Thank you so much for your help !