# Editing segmentation of model and saving it

**URL:** <https://discourse.slicer.org/t/editing-segmentation-of-model-and-saving-it/21338>\
**Category:** Support\
**Created:** [January 5, 2022, 3:06pm UTC](https://discourse.slicer.org/t/editing-segmentation-of-model-and-saving-it/21338 "2022-01-05T15:06:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_Kumar\_Ranabhat](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/raj_kumar_ranabhat/32/9857_2.png) [@Raj\_Kumar\_Ranabhat](https://discourse.slicer.org/u/Raj_Kumar_Ranabhat)\
**Post date:** [January 5, 2022, 3:06pm UTC](https://discourse.slicer.org/t/editing-segmentation-of-model-and-saving-it/21338/1 "2022-01-05T15:06:41Z")

</div>

Hi @lassoan ,

Our lab created a model of spine based on fusion of CT and MR.

Here is the link

> **[StandardModel.mrb](https://drive.google.com/file/d/17IdTqRJaGpqKWOuAk-IeC3mNcQ5beAZi/view?usp=sharing)**
>
> Google Drive file.

I tried to make a segmentation smoother(nerves) and tried to save the file again in mrml or mrb .

But the issue is that, after saving the model/ bone (CT) gets cropped. I tried to fix this issue ( for example changing label map geometry) but didn’t work.

What could be the issue, Please advise for the solution. The mrb model is provided in the link.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 5, 2022, 4:35pm UTC](https://discourse.slicer.org/t/editing-segmentation-of-model-and-saving-it/21338/2 "2022-01-05T16:35:45Z")

</div>

By default segmentations are saved using the “reference image geometry” (origin, spacing, axis directions, and extents) by default. In this segmentation, the reference image geometry has a narrower extent than the full extent of all segments, so when saved with default parameters then the segment is cropped.

If you want to use the minimum necessary extent that saves the full segmentation then you can check the “Crop to minimum extent” option in the Save Data dialog:

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

If you want to save the segmentation with the same geometry as one of the input images then before saving, use the “Specify geometry” button in Segment Editor:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/3/933e87a8f1a7da55f9d4149661ed78cf5d022dff.png)

I’ve tested these in with the latest Slicer Preview Release. If it does not work with the latest Slicer Stable Release then I would recommend to switch to the latest Slicer Preview Release.

We’ll make this behavior more clear (at least log a warning if the segmentation is cropped, but maybe expand the extents automatically). You can track the status of this here:

> <https://github.com/Slicer/Slicer/issues/6102>
>
> If some parts of segments fall outside of the reference geometry then the segmen…tation is cropped (information is lost) without warning.
> 
> Originally the error was reported here: https://discourse.slicer.org/t/editing-segmentation-of-model-and-saving-it/21338
> 
> \## Steps to reproduce
> 
> \- Load this segmentation: https://1drv.ms/u/s!Arm\_AFxB9yqHx-FOPAelcgsOIud1qA?e=Zz7wZ7
> \- Save the segmentation with default settings into a new file
> \- Load the saved segmentation from the new file -\> ERROR: the segmentation is cropped.
> 
> \## Expected behavior
> 
> At the minimum, a warning should be displayed that explains that with this settings the segmentation will be cropped, and it would tell that the user should change reference geometry or enable "Crop to minimum extent" option.
> 
> If such segmentation (that has segments outside the reference geometry) can be easily created using latest Slicer Preview Release (e.g., by moving segments between segmentations) then we could consider expanding the extents automatically (with the effective extent) so that nothing is lost.
> 
> \## Environment
> \- Slicer version: Slicer-4.13.0-2022-01-04
> \- Operating system: Windows 10
