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

Segmentation that contains 0 only should not crash the converter #471

Open fedorov opened 1 year ago

fedorov commented 1 year ago

If input JSON contains only label id "0", there should be an error. If image does not contain any labels that are passed in JSON there should be an error.

I do not want to force users to always define semantics of 0. We need to have a way to communicate that some slices do not contain anything of value (otherwise, how would we decide which slices to skip during conversion?). Right now, 0 in the input image effectively communicates that those slices do not have anything. If background needs to be encoded, it will have to be non-zero label.

If there is a need to explicitly encode certain segment as "Background", it would have to have a non-zero value in the image. Probably, the right code for that would be "Background" from this table: https://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_7165.html.