QIICR / dcmqi

dcmqi (DICOM for Quantitative Imaging) is a free, open source C++ library for conversion between imaging research formats and the standard DICOM representation for image analysis results
https://qiicr.gitbook.io/dcmqi-guide/
BSD 3-Clause "New" or "Revised" License
228 stars 62 forks source link

Bad looking image after conversion, error in loading image #494

Closed gladomat closed 2 months ago

gladomat commented 5 months ago

I used this command:

./itkimage2segimage` --verbose --inputDICOMDirectory dcm/  \
--inputMetadata head.json \
--inputImageList segmentation.nrrd \
--outputDICOM threshold_head.dcm

After some errors that I fixed with your FAQ, I finally got this image

image

Which looks terrible, and if I try to load it with ITK-Snap I get an error: image Unhandled PixelFormat

What am I doing wrong?

Here's the metadata

{
  "ContentCreatorName": "Reader1",
  "ClinicalTrialSeriesID": "Session1",
  "ClinicalTrialTimePointID": "1",
  "SeriesDescription": "Segmentation",
  "SeriesNumber": "300",
  "InstanceNumber": "1",
  "BodyPartExamined": "HEAD",
  "segmentAttributes": [
    [
      {
        "labelID": 1,
        "SegmentDescription": "whole head",
        "SegmentAlgorithmType": "AUTOMATIC",
        "SegmentAlgorithmName": "SimpleITK",
        "SegmentedPropertyCategoryCodeSequence": {
          "CodeValue": "123037004",
          "CodingSchemeDesignator": "SCT",
          "CodeMeaning": "Anatomical Structure"
        },
        "SegmentedPropertyTypeCodeSequence": {
          "CodeValue": "69536005",
          "CodingSchemeDesignator": "SCT",
          "CodeMeaning": "Head"
        },
        "recommendedDisplayRGBValue": [
          43,
          196,
          37
        ]
      }
    ]
  ],
  "ContentLabel": "SEGMENTATION",
  "ContentDescription": "Image segmentation",
  "ClinicalTrialCoordinatingCenterName": "dcmqi"
}
fedorov commented 4 months ago

@gladomat I am sorry for missing your question earlier. Looking at the screenshot, it is most likely the case that ITK-Snap/GDCM does not support the single bit encoding used in DICOM SEG.

You can report this issue and share a sample with the ITK-Snap developers and ask them to add this functionality.

In the meantime, you can use 3D Slicer to work with DICOM SEG: https://www.slicer.org/. In order to load DICOM SEG in Slicer you will first need to install QuantitativeReporting extension: https://qiicr.gitbook.io/quantitativereporting-guide/user-guide/installation-and-upgrade.

Please let me know if you need any further help and cannot load resulting segmentations in Slicer!