# How save segmentation data?

**URL:** <https://discourse.slicer.org/t/how-save-segmentation-data/7007>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [June 3, 2019, 10:44am UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007 "2019-06-03T10:44:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kscript](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kscript](https://discourse.slicer.org/u/kscript)\
**Post date:** [June 3, 2019, 10:44am UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/1 "2019-06-03T10:44:55Z")

</div>

Hi

How i segmentation data with dicom

i want to make one file(seg data+dicom)

help me plz

---

<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:** [June 3, 2019, 10:52am UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/2 "2019-06-03T10:52:16Z")

</div>

Would you like to create a single file that contain both segmentation and the input volume? Or two files (one for the segmentation, one for the volume)?

What format you would like to save to? What software do you plan to use to read the files?

---

<div class="post-metadata">

**Author:** ![kscript](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kscript](https://discourse.slicer.org/u/kscript)\
**Post date:** [June 3, 2019, 12:15pm UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/3 "2019-06-03T12:15:40Z")

</div>

Thanks for reply

i want to create single file

now i making a Dee Learning model used annotation data.

Can we make a dcm format?

---

<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:** [June 3, 2019, 1:16pm UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/4 "2019-06-03T13:16:10Z")

</div>

For deep learning, you typically need input input and output images separately. DICOM format is generally not supported directly by deep learning frameworks.

For preliminary tests, you may export data using “Screen Capture” module. For more controller data export, you can study the [helper scripts for creating inputs for deep learning from Slicer scenes](https://github.com/SlicerIGT/UsAnnotationExport/).

---

<div class="post-metadata">

**Author:** ![kscript](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@kscript](https://discourse.slicer.org/u/kscript)\
**Post date:** [June 3, 2019, 11:41pm UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/5 "2019-06-03T23:41:22Z")

</div>

Then. If i use for deep learning.  
i should change image type. jpg, bmp 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:** [June 4, 2019, 2:22am UTC](https://discourse.slicer.org/t/how-save-segmentation-data/7007/6 "2019-06-04T02:22:20Z")

</div>

Many deep learning examples use jpg, bmp, … files as input, so you may find it easier to quickly try these examples if you export data in the same format. However, since most medical images are 3D, they use more than 8 bits per channel, and usually single-channel, consumer file formats, such as jpg and bmp are too limited. So, for anything else than quick tests, I would recommend to save metaimage (mha), nrrd, or maybe nifti format. You can find Python readers for all these formats (e.g., in [ITK](https://itk.org/)).
