I would like to make a segmentation of the eye, with a resolution of 0.1 mm.
For this purpose, I would like to start my segmentation from building spheres from python code.
I tried to start from this code
*import SampleData* *# Load master volume* *sampleDataLogic = SampleData.SampleDataLogic()* *masterVolumeNode = sampleDataLogic.downloadMRBrainTumor1()* *# Create segmentation* *segmentationNode = slicer.vtkMRMLSegmentationNode()* *slicer.mrmlScene.AddNode(segmentationNode)* *segmentationNode.CreateDefaultDisplayNodes() # only needed for display* *segmentationNode.SetReferenceImageGeometryParameterFromVolumeNode(masterVolumeNode)* *# Create segment sclera* *eye = vtk.vtkSphereSource()* *eye.SetCenter(30, 68, -31)* *eye.SetRadius(12)* *eye.Update()* *segmentationNode.AddSegmentFromClosedSurfaceRepresentation(eye.GetOutput(), "1_Sclera", [1.0,1.0,0.0])*
That works, but with a resolution of nearly 1mm.
Then I tried to crop the volume, increasing the resolution (scaling), with success, following this instructions. However, now I don’t know how to link the sphere code to the segmentation with this higher resolution.
Unfortunately, I am not good at programming with python, I tried to find help with the vtk library and tutorials, without success.
Thanks in advance for your help