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
232 stars 62 forks source link

Additional documentation for itkimage2segimage #441

Open denbonte opened 3 years ago

denbonte commented 3 years ago

Hey all,

Thanks for the work you guys put in dcmqi.

As discussed with @fedorov, I think it would be beneficial to add a few lines in the itkimage2segimage documentation page to help users with the following use case:

The reason I'm opening this issue is that the JSON generated at http://qiicr.org/dcmqi/#/seg is not right in such case - as segmentAttributes will be a list of a list containing N different dictionaries (with labelID going from 1 to N):

# this works if a single input file stores N different structures
{
  "ContentCreatorName": "DB",
  ...
  "segmentAttributes": [
    [
      {
        "labelID": 1,
        # dict for structure 1
      },
      {
        "labelID": 2,
        # dict for structure 2
      },
      ...
    ]
  ],
  "ContentLabel": "SEGMENTATION",
  ...
}

instead of a list of N lists containing one dictionary each (per structure, with labelID: 1 in all the cases):

# this works if N input files store one structure each
{
  "ContentCreatorName": "DB",
  ...
  "segmentAttributes": [
    [
      {
        "labelID": 1,
        # dict for structure 1
      }
    ],
    [
      {
        "labelID": 1,
        # dict for structure 2
      }
    ],
      ...
  "ContentLabel": "SEGMENTATION",
  ...
}