# Exporting DICOM directory after segmenting lesion

**URL:** <https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082>\
**Category:** Feature requests\
**Created:** [December 14, 2018, 10:17pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082 "2018-12-14T22:17:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 14, 2018, 10:17pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/1 "2018-12-14T22:17:56Z")

</div>

Hi everybody,

Forgive me if this has already been mentioned but I wasn’t able to find a procedure that works with the version of Slicer I’m using (Nightly 4.11.0, 2018-11-25) Does anyone know of a way to export a DICOM directory after segmentation? I am working with a hepatic lesion CT and have segmented the lesion, liver, and ribs. I know that I can easily export all three files as a 3D model in .OBJ or .STL format and then print it. However, I was wondering if there was a way that I can export the cropped and segmented DICOM dataset from Slicer so that another person can simply view my segmentation of the lesion slice by slice via a simple DICOM viewer.

I tried right-clicking on the parent DICOM directory (in my case a cropped DICOM dataset) and selecting “Export to DICOM” but when I click “Export” I receive the error message “Error occurred in exporter”

And another random question: Is there a way to view the 3D workspace and one of the three slices (for example: Red slice and 3D side-by-side)

---

<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:** [December 15, 2018, 2:59pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/2 "2018-12-15T14:59:31Z")

</div>

You can export segmentation as DICOM RTSTRUCT if you Install SlicerRT extension. If you install Reporting extension then you may export to DICOM Segmentation object.

There was an error in the image export in nightly version that I’ve fixed today, so the export should work correctly in nightly builds that you download tomorrow or later. Latest stable Slicer-4.10.0 should work as is.

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 3:48pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/3 "2018-12-17T15:48:55Z")

</div>

Thank you Andras! I will try what you recommended and update the thread if I have any issues.

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 4:30pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/4 "2018-12-17T16:30:16Z")

</div>

![50%20AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/4/745a17f93e300eebfca696cc4197fe876d1e8cf1.png)

I downloaded the most recent nightly build of Slicer as well as the SlicerRT extension and am still getting the same error after clicking “Export”. Is there a step in the workflow that I am missing?

I am running MacOS High Sierra 10.13.6

---

<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:** [December 17, 2018, 5:24pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/5 "2018-12-17T17:24:26Z")

</div>

Could you please upload the application log (menu: Help / Report a bug) to somewhere and post the link here?

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 5:32pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/6 "2018-12-17T17:32:53Z")

</div>

I apologize in advance if this makes this post (and the thread) unnecessarily long but here is the application log

> **Logs**
>
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Session start time …: 2018-12-17 12:22:27  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Slicer version …: 4.11.0-2018-12-16 (revision 27662) macosx-amd64 - installed release  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Operating system …: Mac OS X / 10.13.6 / 17G65 - 64-bit  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Memory …: 8192 MB physical, 4096 MB virtual  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - CPU …: GenuineIntel Intel® Core™ i5-7500 CPU @ 3.40GHz, 4 cores, 4 logical processors  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - VTK configuration …: OpenGL2 rendering, Sequential threading  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Developer mode enabled …: no  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Prefer executable CLI …: yes  
> [DEBUG][Qt] 17.12.2018 12:22:27 [] (unknown:0) - Additional module paths …: /Applications/Slicer Nightly.app/Contents/Extensions-27662/QuantitativeReporting/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerDevelopmentToolbox/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/PETDICOMExtension/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/PETDICOMExtension/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/DCMQI/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/AnglePlanesExtension/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/EasyClip/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MarkupsToModel/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MatlabBridge/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MatlabBridge/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerOpenIGTLink/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerOpenIGTLink/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MeshToLabelMap/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/ModelToModelDistance/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/PedicleScrewSimulator/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SegmentRegistration/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MeshStatisticsExtension/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerProstate/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerProstate/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerFab/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/Sequences/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/Sequences/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerIGT/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerIGT/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerVMTK/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerVMTK/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/TCIABrowser/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/VolumeClip/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerHeart/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerHeart/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerRT/lib/Slicer-4.11/cli-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerRT/lib/Slicer-4.11/qt-loadable-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerRT/lib/Slicer-4.11/qt-scripted-modules, /Applications/Slicer Nightly.app/Contents/Extensions-27662/MatlabModules  
> [DEBUG][Python] 17.12.2018 12:22:36 [Python] (/Applications/Slicer Nightly.app/Contents/lib/Slicer-4.11/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: Annotations  
> [DEBUG][Qt] 17.12.2018 12:22:41 [] (unknown:0) - MatlabExecutablePath not found, default path used: /Applications/MATLAB\_XXXXX.app/bin/matlab  
> [DEBUG][Python] 17.12.2018 12:22:43 [Python] (/Applications/Slicer Nightly.app/Contents/lib/Slicer-4.11/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentEditor  
> [DEBUG][Python] 17.12.2018 12:22:43 [Python] (/Applications/Slicer Nightly.app/Contents/lib/Slicer-4.11/qt-scripted-modules/SubjectHierarchyPlugins/AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentStatistics  
> [DEBUG][Qt] 17.12.2018 12:22:44 [] (unknown:0) - Switch to module: “Welcome”  
> [INFO][VTK] 17.12.2018 12:22:46 [vtkMRMLVolumeArchetypeStorageNode (0x7fd95f50ee50)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: /Applications/Slicer Nightly.app/Contents/Extensions-27662/SlicerVMTK/lib/Slicer-4.11/qt-scripted-modules/Resources/Vesselness.png. Dimensions: 65x50x1. Number of components: 3. Pixel type: unsigned char.  
> [WARNING][VTK] 17.12.2018 12:22:54 [vtkMRMLModelDisplayNode (0x7fd95f556a50)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLDisplayNode.cxx:529) - Invalid activeAttributeLocation:  
> [WARNING][VTK] 17.12.2018 12:22:54 [vtkMRMLModelDisplayNode (0x7fd95f559620)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLDisplayNode.cxx:529) - Invalid activeAttributeLocation:  
> [INFO][VTK] 17.12.2018 12:22:55 [vtkMRMLVolumeArchetypeStorageNode (0x7fd95f555110)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: /Users/AVarghese11/Documents/LIVER\_DeleteAfter/601 ABD COR 3X3.nrrd. Dimensions: 512x512x100. Number of components: 1. Pixel type: int.  
> [INFO][VTK] 17.12.2018 12:22:55 [vtkMRMLVolumeArchetypeStorageNode (0x7fd95f554f20)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLVolumeArchetypeStorageNode.cxx:465) - Loaded volume from file: /Users/AVarghese11/Documents/LIVER\_DeleteAfter/601 ABD COR 3X3 cropped.nrrd. Dimensions: 168x64x132. Number of components: 1. Pixel type: int.  
> [ERROR][VTK] 17.12.2018 12:22:56 [vtkMRMLSegmentationStorageNode (0x7fd95f55df70)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx:251) - ReadDataInternal: segmentation file ‘/Users/AVarghese11/Documents/LIVER\_DeleteAfter/601 ABD COR 3X3 cropped\_Segmentation.seg.nrrd’ not found.  
> [ERROR][VTK] 17.12.2018 12:22:56 [vtkTransformPolyDataFilter (0x60c000318930)] (/Volumes/Dashboards/Preview/Slicer-0-build/VTK/Filters/General/vtkTransformPolyDataFilter.cxx:85) - No input data  
> [ERROR][VTK] 17.12.2018 12:22:56 [vtkTransformPolyDataFilter (0x604000501830)] (/Volumes/Dashboards/Preview/Slicer-0-build/VTK/Filters/General/vtkTransformPolyDataFilter.cxx:85) - No input data  
> [DEBUG][Qt] 17.12.2018 12:23:04 [] (unknown:0) - Switch to module: “Data”  
> [CRITICAL][Stream] 17.12.2018 12:24:05 [] (unknown:0) - Traceback (most recent call last):  
> [CRITICAL][Stream] 17.12.2018 12:24:05 [] (unknown:0) - File “”, line 1, in   
> [CRITICAL][Stream] 17.12.2018 12:24:05 [] (unknown:0) - KeyError: ‘DicomRtImportExportPlugin’

---

<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:** [December 17, 2018, 5:36pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/7 "2018-12-17T17:36:02Z")

</div>

> [@avarghes23](#):
>
> [ERROR][VTK] 17.12.2018 12:22:56 [vtkMRMLSegmentationStorageNode (0x7fd95f55df70)] (/Volumes/Dashboards/Preview/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx:251) - ReadDataInternal: segmentation file ‘/Users/AVarghese11/Documents/LIVER\_DeleteAfter/601 ABD COR 3X3 cropped\_Segmentation.seg.nrrd’ not found.

It seems that the segmentation has failed to load (segmentation file was not found). Make sure you load or create a valid segmentation and try to export that.

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 6:47pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/8 "2018-12-17T18:47:19Z")

</div>

I believe the segmentation loaded correctly. But for some reason, while performing the export it says the segmentation is not found. But when I look at the data tree, the segmentation is there. Attached is a screenshot illustrating this.

 ![05%20PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/a/ca6faa38e1ad35861a2fff6784e9bcde514426c3.png)

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [December 17, 2018, 7:37pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/9 "2018-12-17T19:37:17Z")

</div>

> [@avarghes23](#):
>
> I was wondering if there was a way that I can export the cropped and segmented DICOM dataset from Slicer so that another person can simply view my segmentation of the lesion slice by slice via a simple DICOM viewer

If your goal is to “view my segmentation of the lesion slice by slice via a simple DICOM viewer”, you should probably export your segmentation as a DICOM image, and not as a DICOM Segmentation or DICOM RT object. You might want to look into the “Create DICOM Series” module. Do you have more details about the specific DICOM viewer another person is going to use?

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 7:50pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/10 "2018-12-17T19:50:32Z")

</div>

Thank you for the suggestion. Unfortunately, when I do this, I end up with a DICOM image stack of the cropped image stack I was previously working with (prior to segmentation). Is there a setting within the “Create a DICOM Series” module where I can specify my segmentations to be included in the exported DICOM image stack.

To answer your second question, I do not have more information about the DICOM viewer the other user would use. However, my understanding is that DICOM is a universal medical imaging format so in theory any program with the ability to upload a DICOM directory into it should be able to read this exported DICOM image stack.

---

<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:** [December 17, 2018, 7:56pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/11 "2018-12-17T19:56:21Z")

</div>

I agree that simple 3D image volumes can be loaded by most viewers. However, I am not sure if many viewers can show the original volume with the segmentation volume overlaid.

> [@avarghes23](#):
>
> However, my understanding is that DICOM is a universal medical imaging format so in theory any program with the ability to upload a DICOM directory into it should be able to read this exported DICOM image stack

DICOM standard is fairly universal, but it is also huge and therefore each software application implements only a tiny fraction of it. You must know in advance what are the capabilities of the program that will need to read the data and export in an appropriate format (RTSTRUCT, segmentation object, or image volume).

---

<div class="post-metadata">

**Author:** ![avarghes23](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@avarghes23](https://discourse.slicer.org/u/avarghes23)\
**Post date:** [December 17, 2018, 7:59pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/12 "2018-12-17T19:59:51Z")

</div>

> [@lassoan](#):
>
> DICOM standard is fairly universal, but it is also huge and therefore each software application implements only a tiny fraction of it. You must know in advance what are the capabilities of the program that will need to read the data and export in an appropriate format (RTSTRUCT, segmentation object, or image volume).

Ah ok I see. So even if I was able to export the DICOM image stack from my segmentation, I would still need to make sure that the program the other user is using is capable of reading it as an RTSTRUCT, segmentation object, or image volume?

---

<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:** [December 17, 2018, 8:14pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/13 "2018-12-17T20:14:25Z")

</div>

Yes. Most DICOM viewers can display slices of CT and MRI images, but you cannot assume anything beyond that.

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [December 17, 2018, 8:19pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/14 "2018-12-17T20:19:28Z")

</div>

@avarghes23 why don’t you just point that another person to 3D Slicer?

I understand it may not meet your constraint of having “a simple DICOM viewer”.

---

<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:** [December 20, 2018, 6:02pm UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/15 "2018-12-20T18:02:47Z")

</div>

7 posts were merged into an existing topic: [Make Slicer simpler to use for new users](https://discourse.slicer.org/t/make-slicer-simpler-to-use-for-new-users/5059/20)

---

<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:** [December 29, 2018, 5:26am UTC](https://discourse.slicer.org/t/exporting-dicom-directory-after-segmenting-lesion/5082/16 "2018-12-29T05:26:28Z")

</div>

A post was split to a new topic: [Export volume with burnt-in segmentation](https://discourse.slicer.org/t/export-volume-with-burnt-in-segmentation/5216)
