You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several packages handle NIfTI headers with insufficient reverence, ending up with affines that don't really match the expected result of an operation. For example, AFNI converts NIfTI to BRIK+HEAD, performs its operation, and makes a somewhat wild stab at the correct qform/sform codes based on an environment variable, so operations that don't move the data might still change the affine. ANTs' dependence on ITK means they don't recognize sforms as legitimate. Meanwhile the standard's order of precedence (sform > qform > pixdims) means that only updating the sform is fairly common practice by still other software (I believe FSL only updates sforms).
All of this means that mixing and matching these tools, one of the primary use-cases of nipype, can result in some profound disagreements of how the same input file is aligned and how to write a header in the output file. In practice this can mean that two files with the same affine (as far as the standard is concerned), with the same transform applied by the same software can end up misaligned.
While an incomplete solution for qforms/sforms that get out of sync, at least preventing affine corruption would be a start to handling issues like this. We have addressed this previously in N4BiasFieldCorrection (#2034), but a consistent interface across tools would be very useful.
Several packages handle NIfTI headers with insufficient reverence, ending up with affines that don't really match the expected result of an operation. For example, AFNI converts NIfTI to BRIK+HEAD, performs its operation, and makes a somewhat wild stab at the correct qform/sform codes based on an environment variable, so operations that don't move the data might still change the affine. ANTs' dependence on ITK means they don't recognize sforms as legitimate. Meanwhile the standard's order of precedence (sform > qform > pixdims) means that only updating the sform is fairly common practice by still other software (I believe FSL only updates sforms).
All of this means that mixing and matching these tools, one of the primary use-cases of nipype, can result in some profound disagreements of how the same input file is aligned and how to write a header in the output file. In practice this can mean that two files with the same affine (as far as the standard is concerned), with the same transform applied by the same software can end up misaligned.
While an incomplete solution for qforms/sforms that get out of sync, at least preventing affine corruption would be a start to handling issues like this. We have addressed this previously in N4BiasFieldCorrection (#2034), but a consistent interface across tools would be very useful.
I propose:
A post-run hook would then copy the affines from
inputs.ref_file
tooutputs.out_file
, with the following:The text was updated successfully, but these errors were encountered: