Invalid color in segmentation - not opening segmentation in slicer

The dicom-seg-writer in the pipeline - clara_ai_covid19_pipeline
is generating invalid color and Slicer is unable to open DICOM SEG.

ref link - NVIDIA NGC

See recommendedDisplayRGBValue in the metadata extracted by DCMQI tool:

“BodyPartExamined” : “”,

“ClinicalTrialSeriesID” : “”,

“ClinicalTrialTimePointID” : “”,

“ContentCreatorName” : “”,

“InstanceNumber” : “1”,

“SeriesDescription” : “CAUTION: Research Use Only. NVIDIA Clara generated DICOM SEG for Axial Chest CT COVID-19”,

“SeriesNumber” : “4516”,

“segmentAttributes” : [



        "SegmentAlgorithmName" : "AI Organ Segmentation",

        "SegmentAlgorithmType" : "AUTOMATIC",

        "SegmentDescription" : "",

        "SegmentLabel" : "Lung-seg",

        "SegmentedPropertyCategoryCodeSequence" : {

           "CodeMeaning" : "Anatomical Structure",

           "CodeValue" : "T-D0050",

           "CodingSchemeDesignator" : "SRT"


        "SegmentedPropertyTypeCodeSequence" : {

           "CodeMeaning" : "Organ",

           "CodeValue" : "T-D0050",

           "CodingSchemeDesignator" : "SRT"


        "labelID" : 1,

        "recommendedDisplayRGBValue" : [ 4294966216, 74, 193 ]





Thanks for the observation. If possible, can you provide the error log from 3D Slicer? and please tell us the Slicer version and platform.

As for the Clara DICOM Seg Writer, it actually does NOT set the optional attribute for recommended color for the label(s). It is likely DCMQI was generating default for the absent optional attribute, which then caused you to think Clara was providing it. Please use DCMDUMP or others to inspect and compare.

Also, the attributed that you mentioned has been retired and replaced with the recommended CIELab value attribute, per DICOM Part 3,

Graphic Layer Recommended Display RGB Value (0070,0067) was previously used in this Module, but has been retired and its function replaced by Graphic Layer Recommended Display CIELab Value (0070,0401). See PS3.3-2004.

Other viewer can handle the the absence of this attribute, as it is NOT a Type 1 attribute at all. The 3D Slicer Linux version may also be able to handle it, I recall.

Thanks for response.
I tried running 3DSlicer (v4.11.20210226 r29738 / 7a593c8) in Linux ( ubuntu 18.04 ) on AWS.

Following error messages:

ubuntu@ip-172-31-13-75:~/Slicer-4.11.20210226-linux-amd64$ ./Slicer
Switch to module: “Welcome”
Switch to module: “DICOM”
Loading with imageIOName: GDCM
WARNING: In /work/Stable/Slicer-1-build/ITK/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx, line 480
ImageSeriesReader (0x6388680): Non uniform sampling or missing slices detected, maximum nonuniformity:0.000987692

Window/level found in DICOM tags (center=-200.0, width=3695.0) has been applied to volume 1: Axial Chest CT COVID-19
Found CommandLine Module, target is /home/ubuntu/Slicer-4.11.20210226-linux-amd64/NA-MIC/Extensions-29738/DCMQI/lib/Slicer-4.11/cli-modules/segimage2itkimage
ModuleType: CommandLineModule
Convert DICOM Segmentation Image into ITK image(s) command line:

/home/ubuntu/Slicer-4.11.20210226-linux-amd64/NA-MIC/Extensions-29738/DCMQI/lib/Slicer-4.11/cli-modules/segimage2itkimage --inputDICOM /home/ubuntu/.clara/pipelines/clara_ai_covid19_pipeline/output/dicom-destination-directory/dicom-seg-writer-covid-lesion/dicom/1.2.826.0.1.3680043.2.1125.1.71161657915368769845404408463327121-DICOMSEG.dcm --outputDirectory /tmp/Slicer-ubuntu/QIICR/SEG/2021-09-28_162242/2.25.93125304767293587205224508243862923609 --outputType nrrd

Convert DICOM Segmentation Image into ITK image(s) standard output:

dcmqi repository URL: git:// revision: ac7d0fe tag: latest
Row direction: 1 0 0
Col direction: 0 1 0
Z direction: 0 0 1
Total frames: 57
Total frames with unique IPP: 57
Total overlapping frames: 0
Origin: [-192.626, -174.658, -765.002]

Convert DICOM Segmentation Image into ITK image(s) standard error:

W: FrameOfReferenceUID (0020,0052) absent in FrameOfReferenceModule (type 1)
W: PositionReferenceIndicator (0020,1040) absent in FrameOfReferenceModule (type 2)
W: PixelSpacing (0028,0030) violates maximum VR length in PixelMeasuresMacro
WARNING: SliceThickness is present and is 0.799988. using it!

Convert DICOM Segmentation Image into ITK image(s) completed without errors

Generic Warning: In /work/Stable/Slicer-1/Modules/Loadable/Terminologies/Logic/vtkSlicerTerminologiesModuleLogic.cxx, line 727
ConvertSegmentationDescriptorToTerminologyContext: Invalid recommended color in type 'Organ

LoadTerminologyFromSegmentDescriptorFile: Failed to parse descriptor file '/tmp/Slicer-ubuntu/QIICR/SEG/2021-09-28_162242/2.25.93125304767293587205224508243862923609/meta.json

Loaded volume from file: /tmp/Slicer-ubuntu/QIICR/SEG/2021-09-28_162242/2.25.93125304767293587205224508243862923609/1.nrrd. Dimensions: 512x512x57. Number of components: 1. Pixel type: short.

“Volume” Reader has successfully read the file “/tmp/Slicer-ubuntu/QIICR/SEG/2021-09-28_162242/2.25.93125304767293587205224508243862923609/1.nrrd” “[0.07s]”
error: [/home/ubuntu/Slicer-4.11.20210226-linux-amd64/bin/SlicerApp-real] exit abnormally - Report the problem.

Few other feedback from 3DSlicer on the segmentation

Problems with this segmentation object:

  • Probably they thought that the color is specified as RGB value, but actually it is encoded as CIELab.
  • The segment type is just “Organ”, which is useless. The proper term would have been “Lung”.
  • Old SRT codes are used instead of SCT.

In the file that @kaushikdasroy tried to load, the segment color was specified. See the Recommended Display CIELab Value Attribute (0062,000D) tag in the dcmdump output:

[0062,0002]	SegmentSequence		SQ	266
	[fffe,e000]	Item		na	250
		[0062,000d]	RecommendedDisplayCIELabValue	[3] 128, 174, 128	US	6

@Ming_Q Could you please check if you can find [0062,000d] in your Clara DICOM Segmentation Object output? If you cannot find this field there then maybe @kaushikdasroy reprocessed the file with some other software before trying to load it into 3D Slicer.

I don’t think that the (0070,0067) and (0070,0401) attributes are related to DICOM Segmentation Object IOD.

A few other improvements that you could consider to make Clara’s DICOM Segmentation Object output more useful:

  • The segmented property category/type is just “Organ”, which is not informative and might be even slightly misleading (it may not be actually an organ but some other tissue, foreign body, etc.). In case of models that are developed for segmenting specific structures (such as this COVID19 lung segmentation) it should be possible to set the segmented property category/type fields correctly.
  • SRT codes must not be used anymore. SRT … This coding scheme is deprecated. The use of “SNOMED-RT style” code values is no longer authorized by SNOMED except for creation by legacy devices, legacy objects in archives, and receiving systems that need to understand them. (8 Coding Schemes) You can switch to SCT codes.
  • Clara software version number is not included. Version number is important, because it allows fixing up problems in DICOM files retrospectively without relying on any heuristics. For example, if it turns out that Clara X.Y sets a field value wrong then application software can check the software version and fix up the value during DICOM import.

Thanks for your suggestions, Mr. @lasso. I’d think you are Andras.

Sorry about that quick initial reply of mine, and I did realize I was referring to another IOD which also has the Recommended Display CIELabel value but with a different tag.

Yes, the Clara DICOM Seg Writer does have a default recommendedDisplayCIELabValue for the segment(s), (0x0062000D, "US", [128, 174, 128]) # RecommendedDisplayCIELabValue, and there has been internal request too to use different values for each segment, though the same value for all segments did not seem to have caused issue in other viewers I tried.

The Clara DICOM Seg Writer does set the version, though it stays at 1, (0x00181020, 'LO', '1') # SoftwareVersions, as it has not changed, and this asset is released as a container even though tag is stamped with the Clara Deploy SDK version. Quite a mouthful, so the better approach is to grab the SDK version like we did not for the MONAI Deploy App SDK version of the seg writer.

Getting the segmented property category/type correct in the generic seg writer container requires a bit more input from the operator/algorithm that actually performs the segmentation, Given most if not all of the sample use cases are organ (lesion for some), the value was not customized for specific image processing pipelines. A deficiency, for sure.

I’ll enter these recommendations as issues/feature requests, and work on them once scheduled.

Thanks again.

@kaushikdasroy Another thing I forgot to mention is that, if your goal is to get the segmentation mask image (in NIfTI format or others), then it is readily available as one of the outputs from a segmentation inference operator, e.g. the Lung Seg or the Lesion Seg, specifically in the operators /publish folder. This folder contains both the original volume image (nii or mhd), segmentation mask image (in mhd), along with a meta file and config_render.json. This output is intended for the Clara Render Server, for its 3D rendering of the images, and can be downloaded for other use via the Clara Dashboard or directly copy from the operator’s mapped output folder on the host.

Thanks @lasso and @Ming_Q for the discussion.

@Ming_Q , I noticed the segmentation mask image. Thanks for pointing that out and the feature requests.

1 Like