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

Spacing order initialized incorrectly when reading SEG #425

Closed fedorov closed 3 years ago

fedorov commented 3 years ago

Semantics of pixel spacing is different between DICOM and ITK. In DICOM, "The first value is the row spacing in mm, that is the spacing between the centers of adjacent rows, or vertical spacing" (see here), while in ITK the first value is spacing along the X axis (see here.

In dcmqi, frame size is initialized correctly, with the value of Columns assigned to imageSize[0], but first value of spacing is populated incorrectly from the first value of PixelSpacing:

https://github.com/QIICR/dcmqi/blob/248dc1891583cab54549ea51298fa7d8352e70bd/include/dcmqi/ConverterBase.h#L261-L262

This will result in incorrect segmentation geometry when PixelSpacing is anisotropic.