Closed fedorov closed 9 months ago
@michaelonken can you look into this? I can provide the dataset!
Sure, I'll handle it.
Looking at the screenshot, SEG size is shown as 288x16, while CT series shows 16 slices - perhaps this is the first thing to check if somehow the dimensions were not mixed up in the conversion? It might be that orientation of the segmentation NIfTI was not the same as the orientation of the DICOM CT. Although, at the same time, it doesn't have to be identical ... Not sure.
Michael, I think the issue is here: https://github.com/QIICR/dcmqi/blame/master/libsrc/Itk2DicomConverter.cpp#L93
I think the rows/colums spacing needs to be swapped. Here is the corresponding part of the standard: https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_10.7.html#sect_10.7.1.3.
This came up before, when I fixed it on read in https://github.com/QIICR/dcmqi/issues/425, but I missed to also fix it on write!
rows/colums spacing needs to be swapped
Yes, this is a quirk in the standard that people might easily miss since it doesn't come up much in practice.
@dclunie I think we had this conversation at some point about non-square pixels. This specific example demonstrated how easy it is to make non-square pixels while converting to DICOM SEG.
In this case, I do not know if this is intentional or unintentional, but the original MR image was 0.5x0.5 in-plane and 3mm between slices 128x128 rows/cols and 16 slices. The segmentation they created in NIfTI reformatted the pixel matrix to make the slice 128x16 rows/cols and 128 slices. In this case, I can hardly imagine a valid reason for re-formatting rows/columns/slices. Most likely it's just due to DICOM-NIfTI-DICOM process, but nevertheless, the result is 0.5x3 mm pixel size.
Michael, I think the issue is here: https://github.com/QIICR/dcmqi/blame/master/libsrc/Itk2DicomConverter.cpp#L93
I think the rows/colums spacing needs to be swapped. Here is the corresponding part of the standard: https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_10.7.html#sect_10.7.1.3.
This came up before, when I fixed it on read in #425, but I missed to also fix it on write!
This does the trick 🥳.
See PR https://github.com/QIICR/dcmqi/pull/486 which switches x and y pixel spacing when converting from ITK to DICOM.
Resolved by #486.
Dataset to reproduce the issue is not public.