From 4a5f3dcc55eefc1d49ec4e974c50d34c48d3f687 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Mon, 9 Jan 2017 13:36:24 +0000 Subject: [PATCH] Image class will not ignore the xform if a header is also provided --- fsl/data/image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fsl/data/image.py b/fsl/data/image.py index 8a6aa7ae2..eae93b74e 100644 --- a/fsl/data/image.py +++ b/fsl/data/image.py @@ -551,8 +551,9 @@ class Image(Nifti, notifier.Notifier): # to 1mm^3 in real world space) elif isinstance(image, np.ndarray): - if header is not None: xform = header.get_best_affine() - elif xform is None: xform = np.identity(4) + if xform is None: + if header is not None: xform = header.get_best_affine() + else: xform = np.identity(4) # We default to NIFTI1 and not # NIFTI2, because the rest of -- GitLab