Exporting DICOM directory after segmenting lesion

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)

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.

1 Like

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

1 Like

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

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

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’

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.

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.

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?

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.

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.

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?

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

@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”.

7 posts were merged into an existing topic: Make Slicer simpler to use for new users

A post was split to a new topic: Export volume with burnt-in segmentation