Skip to content

BF: Force zero transforms for -deleteorient

Matthew Webster requested to merge bf/delete into master

Pre-6.0.x fslorient -deleteorient would both zero the s/q-form codes and matrices. This was due to the fslio interface layer automatically zero-ing a transform if the associated code was NIFTI_XFORM_UNKNOWN. The current behaviour will break some pipelines - such as using fslswapdim to correct storage only ( see details below ).

This fix explicitly zeroes the s/q-form matrices.

A related change is to fslswapdim_exe - currently the recipe for correcting an image with the "wrong" storage order:

fslorient -deleteorient imagename ; fslswapdim imagename a b c imagename ; fslorient -setqformcode 1 imagename ;

will fail even if the -forms are NIFTI_XFORM_UNKNOWN ( since the q-form can never truly be zeroed ) as the q-form will also be swapped. fslswapdim_exe will now "zero" an -form if its code is NIFTI_XFORM_UNKNOWN.

An alternate fix would just be to change the order of the fslorient and fslswapdim calls in the documentation.

Edited by Matthew Webster

Merge request reports

Loading