# segmentation resolution created from Jupyter notebook is different than that created in 3dslicer

**URL:** <https://discourse.slicer.org/t/segmentation-resolution-created-from-jupyter-notebook-is-different-than-that-created-in-3dslicer/30461>\
**Category:** Support\
**Tags:** segmentation, python\
**Created:** [July 8, 2023, 2:11am UTC](https://discourse.slicer.org/t/segmentation-resolution-created-from-jupyter-notebook-is-different-than-that-created-in-3dslicer/30461 "2023-07-08T02:11:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmad\_alminnawi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ahmad_alminnawi/32/66700_2.png) [@ahmad\_alminnawi](https://discourse.slicer.org/u/ahmad_alminnawi)\
**Post date:** [July 8, 2023, 2:11am UTC](https://discourse.slicer.org/t/segmentation-resolution-created-from-jupyter-notebook-is-different-than-that-created-in-3dslicer/30461/1 "2023-07-08T02:11:19Z")

</div>

Hi all,

I have been using 3dslicer for a while and wrote some Python codes for repetitive tasks.

When I create a segmentation in 3dslicer it would have the same resolution as the imported images (in my case 0.004x0.004x0.004) so when I threshold the segmentation and grow it using margin i can grow it by 0.004 which is 1 pixel. as shown here

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/3/130e23713f6d6ae89d203ae05006e9716956e000.png)

I noticed that when I do the same using Python it says “Not feasible at current resolution” so i increased it to see what is the minimum i can grow and apparently is 0.02 meaning that the resolution is 0.02x0.02x0.02 for 1x1x1 pixel. as shown here

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/7/a76385cfddc4060551b11fbe79f737f34b87a38a.png)

can someone help me get a 0.004x0.004x0.004 resolution using python?

This is my code:

# Create segmentation

segmentationNode = slicer.mrmlScene.AddNewNodeByClass(“vtkMRMLSegmentationNode”)  
segmentationNode.CreateDefaultDisplayNodes() # only needed for display  
segmentationNode.SetName(‘Segmentation’)

# Import the model into the segmentation node

slicer.modules.segmentations.logic().ImportModelToSegmentationNode(cylinderNode, segmentationNode)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ahmad\_alminnawi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ahmad_alminnawi/32/66700_2.png) [@ahmad\_alminnawi](https://discourse.slicer.org/u/ahmad_alminnawi)\
**Post date:** [July 10, 2023, 10:19am UTC](https://discourse.slicer.org/t/segmentation-resolution-created-from-jupyter-notebook-is-different-than-that-created-in-3dslicer/30461/2 "2023-07-10T10:19:23Z")

</div>

Please note that when I am using Jupyter I am importing a volume model that I created and then thresholding the CT images inside that model and I think this is where things are getting weird.  
could it be that the volume has a low resolution? there is no “spacing” resolution for the model though. So, how can i increase the resolution of that model if that is the problem?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/3/33c5aff41a3dca8b6f8b7ec4f1ce2a6c615c9e6e.jpeg)
