Description
I've noticed that if one attempts to run fslreorient2std on a nifti file that doesn't need to be reoriented but with an output file type that differs from that of the input (e.g., fslreorient2std input.nii output.nii.gz
or fslreorient2std input.nii.gz output.nii
), the output file will always be of the same type as the input regardless of what one specifies on the command line and regardless of the value of the FSLOUTPUTTYPE env variable. This behavior can cause Reorient2Std to fail if it is fed an nii.gz file that doesn't need to be reoriented as input and the output type is assumed to also be nii.gz. The class should check the actual generated output and compress it with gzip if it isn't already compressed and the output type is NIFTI_GZ.
I'm using FSL 5.0.9 built on Ubuntu 14.04.4 with Python 2.7.12 and nipype 0.12.1.