dgobbi / vtk-dicom

A set of classes for using DICOM in VTK.
BSD 3-Clause "New" or "Revised" License
258 stars 94 forks source link

niftitodicom - reversed PixelSpacing with different in plane resolution in a dummy test #171

Closed dagra closed 5 years ago

dagra commented 5 years ago

Hi, In a dummy test where a nifti file is created, converted to dicom (with niftitodicom - latest release v0.8.9) and converted back to nifti (with dcm2niix) a bug in niftitodicom was exposed with the latest release of dcm2niix (v1.0.20190410).

More specifically, you can see the test in the dcm2niix issue along with the answer of @neurolabusc that specifies the problem.

Also, for confirmation i converted the same nifti with mango and medcon and tag (0028,0030) is correctly populated as opposed to niftitodicom.

niftitodicom

(0028,0010) US 3                                        #   2, 1 Rows
(0028,0011) US 2                                        #   2, 1 Columns
(0028,0030) DS [1\2]                                    #   4, 2 PixelSpacing

mango

(0028,0010) US 3                                        #   2, 1 Rows
(0028,0011) US 2                                        #   2, 1 Columns
(0028,0030) DS [2\1]                                    #   4, 2 PixelSpacing

medcon

(0028,0010) US 3                                        #   2, 1 Rows
(0028,0011) US 2                                        #   2, 1 Columns
(0028,0030) DS [+2.000000e+00\+1.000000e+00]            #  28, 2 PixelSpacing
dgobbi commented 5 years ago

Thanks for the report. I'll search through the vtk-dicom code to identify all the fixes that are needed, since undoubtedly it isn't just nititodicom that has incorrect behavior.

Notes:

dgobbi commented 5 years ago

This is fixed on the master branch and will be in release v0.8.10.