# Converting segmentation to DICOMSeg files

**URL:** <https://discourse.slicer.org/t/converting-segmentation-to-dicomseg-files/13378>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [September 7, 2020, 5:23pm UTC](https://discourse.slicer.org/t/converting-segmentation-to-dicomseg-files/13378 "2020-09-07T17:23:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_T](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gabriel_t/32/4222_2.png) [@Gabriel\_T](https://discourse.slicer.org/u/Gabriel_T)\
**Post date:** [September 7, 2020, 5:23pm UTC](https://discourse.slicer.org/t/converting-segmentation-to-dicomseg-files/13378/1 "2020-09-07T17:23:32Z")

</div>

I am trying to convert nrrd files to dicom seg files.  
My primary volume is a CT volume in .nrrd format which I converted from numpy format. I saved the segmentation to numpy format which I also converted to nrrd format. So basically I am loading two nrrd files, one the CT volume and the other the segmentation volume. Then I loaded the CT Volume as volume and segmentation as labelmap. I have the Quantitative Reporting extension installed.  
I selected the CT volume as primary volume like below screenshot

 ![segmenteditor](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/8/684000f00238d8b3efa5ecb53472baeb436d16f0.png)  
 ![hierarchy](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/8/e83c1c77bc1e1e2ae5061e732cd5a2806d43a3f0.png)  
But when I try to export it I get error  
File “”, line 2, in   
File “C:/Users/gabri/AppData/Roaming/NA-MIC/Extensions-29335/QuantitativeReporting/lib/Slicer-4.11/qt-scripted-modules/DICOMSegmentationPlugin.py”, line 350, in export  
exporter.export(exportable.directory, segFileName, metadata)  
File “C:/Users/gabri/AppData/Roaming/NA-MIC/Extensions-29335/QuantitativeReporting/lib/Slicer-4.11/qt-scripted-modules/DICOMSegmentationPlugin.py”, line 499, in export  
absolutePaths=True)  
File “C:/Users/gabri/AppData/Roaming/NA-MIC/Extensions-29335/QuantitativeReporting/lib/Slicer-4.11/qt-scripted-modules/DICOMSegmentationPlugin.py”, line 575, in getDICOMFileList  
instanceUIDs = volumeNode.GetAttribute(attributeName)  
AttributeError: ‘NoneType’ object has no attribute ‘GetAttribute’

and nothing gets exported. I can send the corresponding files along if it helps.

---

<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:** [September 7, 2020, 5:32pm UTC](https://discourse.slicer.org/t/converting-segmentation-to-dicomseg-files/13378/2 "2020-09-07T17:32:39Z")

</div>

Ok, if you save your scene as a .mrb file, upload it somewhere, and post the link here then I’ll have a look.

---

<div class="post-metadata">

**Author:** ![Gabriel\_T](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gabriel_t/32/4222_2.png) [@Gabriel\_T](https://discourse.slicer.org/u/Gabriel_T)\
**Post date:** [September 7, 2020, 5:46pm UTC](https://discourse.slicer.org/t/converting-segmentation-to-dicomseg-files/13378/3 "2020-09-07T17:46:12Z")

</div>

Thank you!

I uploaded the .mrb file here  
[https://easyupload.io/6664f9](https://easyupload.io/6664f9)
