dgobbi / vtk-dicom

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

Reoriented nifti as input to niftitodicom #60

Open dgobbi opened 9 years ago

dgobbi commented 9 years ago

Simple experiment to try: use dicomtonifti is used to create an axial nii from a coronal dicom series. Then, use niftitodicom to convert the nii back to dicom, using the original dicom files as a reference. The result will be an axial dicom series.

Is it reasonable to add an option to niftitodicom to have it reformat the data to match the reference dicom series? Or is it unnecessary and even a bit silly?

malaterre commented 9 years ago

Pay attention that nifti uses 32bits (ieee) representation to store a quaternion matrix. Hence round-trip operation dicom → nifti → dicom may discard trailing digits in IOP/IPP.

dgobbi commented 9 years ago

A few picky points here:

1) The example had a round trip coronal -> axial -> coronal, for which the IOP at least has exact representations (all zeros and ones).

2) When a DICOM series is used as a reference for conversion from nifti -> dicom, if the nifti slice orientation/position is within tolerance of the reference DICOM IOP/IPP then the latter can be used, hence no roundoff error for the round trip.

3) There is no such thing as a "quaternion matrix" ;)