Skip to content

Commit 6d9f77e

Browse files
committed
use nitransforms output for DisplacementField
1 parent 7bbf5c5 commit 6d9f77e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

niworkflows/workflows/gradunwarp.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,8 @@ def _warp_fsl2itk(in_warp):
6969
import nitransforms.io
7070
from nipype.utils.filemanip import fname_presuffix
7171
fsl_warp = nitransforms.io.fsl.FSLDisplacementsField.from_filename(in_warp)
72-
itk_warp_data = fsl_warp.get_fdata().reshape(fsl_warp.shape[:3]+(1,3))
73-
itk_warp_data[...,(0,1)] *= -1
74-
itk_warp = fsl_warp.__class__(itk_warp_data, fsl_warp.affine)
75-
itk_warp.header.set_intent("vector")
7672
out_fname = fname_presuffix(in_warp, suffix="_itk", newpath=os.getcwd())
77-
itk_warp.to_filename(out_fname)
73+
nitransforms.io.itk.ITKDisplacementsField.to_filename(fsl_warp, out_fname)
7874
return out_fname
7975

8076
warp_fsl2itk = pe.MapNode(

0 commit comments

Comments
 (0)