Reorient oblique DICOM into pure axial

Is there an easy way to reorient oblique 3D DICOM images into pure axial slices and save the output as nifti file, from command line?

If there is no such an easy tool, I am aware of the transform tool in 3DSlicer, but got confused how to construct the transform matrix from the ImageOrientationPatient & ImagePositionPatient. Does slicer uses the same coordinate system as dicom so I can form the transform matrix (M) like this:
IOP = ImageOrientationPatient;
IPP = ImagePositionPatient;
vx = voxel dimenstions

M = [ IOP (1:3)*vx(1), IOP (4:6)*vx(2), cross(IOP (1:3)*vx(3), IOP (4:6)), IPP ]

or I should do further processing to fix coordinates?

Can I call this transform function from command line so I can automate processing of multiple datasets?

3D Slicer reads and write all images in LPS coordinate system - same as DICOM. You can resample rotated, tilted-gantry, variable-spacing, even arbitrarily rotated, overlapping, multi-time-point acquisitions to simple 3D/4D volumes with orthogonal axes aligned with LPS axes by a few clicks on the GUI or a few lines of Python code (that you can run without the application GUI). If you describe what exactly you need on the Slicer forum then we can provide instructions/script.

1 Like