# Output from segmentation

**URL:** https://discourse.slicer.org/t/output-from-segmentation/818
**Category:** Support
**Created:** [August 3, 2017, 5:47pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818 "2017-08-03T17:47:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kang\_Wang](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@Kang\_Wang](https://discourse.slicer.org/u/Kang_Wang)
#### Post date: [August 3, 2017, 5:47pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/1 "2017-08-03T17:47:02Z")

</div>

```auto
Operating system : Mac OS 
Slicer version : 4.62
Expected behavior :
Actual behavior : image volume mismatch

```

Hi,

I am new the 3D slicer, basically i use segmentation editor to create manual segmentation and then save the segmentation as the default .nrrd file.

However, the segmentation file has different dimension than the original raw data file, it loads fine on 3D slicer, but i am wondering how can i create a segmentation file that has the SAME dimension as the original data file (i.e. like the labelvolume you save from just editor).

I tried export it to labelvolume but doesn’t work.

Any help will be great, thanx

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 3, 2017, 6:02pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/2 "2017-08-03T18:02:48Z")

</div>

If you export the segmentation into a labelmap in the Segmentations module with your anatomical volume set as the reference (Export/Import, Advanced section), then save the labelmap as nrrd, then they will have the same dimensions. However, you’ll lose information if the segments overlap.

What is the reason you want it to have the same dimensions? Maybe you can do the following steps in Slicer as well, not having to do the export like this.

---

<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: [August 3, 2017, 6:41pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/3 "2017-08-03T18:41:06Z")

</div>

You probably need to use a recent nightly version of Slicer for this. I think 4.6.2 does not have the option of setting the reference volume (and the nightly has many other fixes and improvements).

---

<div class="post-metadata">

### Author: ![Kang\_Wang](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@Kang\_Wang](https://discourse.slicer.org/u/Kang_Wang)
#### Post date: [August 3, 2017, 9:19pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/4 "2017-08-03T21:19:40Z")

</div>

Thanks for the quit reply Csaba =D. Maybe there is an easier way to do this. I mainly want the manual segmentation label to have the same dimension as the input images because i am preparing ground truth for collaborators who are developing segmentation algorithm. That is the easiest way i can see to provide the ground truth to them. If there is a better way like some information in the header i can use so they can align the segment volume and raw image volume together in python, i will be happy to use that advise as well. Thanks in advance.

---

<div class="post-metadata">

### Author: ![Kang\_Wang](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@Kang\_Wang](https://discourse.slicer.org/u/Kang_Wang)
#### Post date: [August 3, 2017, 9:21pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/5 "2017-08-03T21:21:09Z")

</div>

Andras, also thanx for the tip, please see below- again if there is a better way to do this please let me know since i am very new to slicer. Essentially how do i align two 3D data matrix with different size i guess. Thanx

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [August 3, 2017, 9:35pm UTC](https://discourse.slicer.org/t/output-from-segmentation/818/6 "2017-08-03T21:35:47Z")

</div>

If you want simpler, then you can export DICOM. Unfortunately the DICOM SEG exporter is currently broke, but very close to fixing, see [https://github.com/QIICR/QuantitativeReporting/issues/140](https://github.com/QIICR/QuantitativeReporting/issues/140)

Exporting the segmentation to the labelmap takes around 8 clicks additinally to the few hundred you made when doing the segmentation. I think it is still much simpler than coming up with an elaborate workaround. If you want to make it quicker you can always write a python script that does that for you.
