From 083560999640f39c6de50fdfd2c9bc84b70d4a06 Mon Sep 17 00:00:00 2001
From: Mark Jenkinson <mark@fmrib.ox.ac.uk>
Date: Fri, 7 Apr 2006 11:21:56 +0000
Subject: [PATCH] Changed calculation of new sform/qform in swapdimensions -
 was previous inconsistent with affine_transform

---
 newimage.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newimage.cc b/newimage.cc
index 115c676..388f9c8 100644
--- a/newimage.cc
+++ b/newimage.cc
@@ -2349,10 +2349,10 @@ namespace NEWIMAGE {
     //   hence sampling mats
 
     Matrix nmat;
-    nmat = this->sform_mat() * this->sampling_mat().i() * this->swapmat(dim1,dim2,dim3) 
+    nmat = this->sform_mat() * this->sampling_mat().i() * this->swapmat(dim1,dim2,dim3).i() 
       * this->sampling_mat();
     swapvol.set_sform(this->sform_code(), nmat);
-    nmat = this->qform_mat() * this->sampling_mat().i() * this->swapmat(dim1,dim2,dim3) 
+    nmat = this->qform_mat() * this->sampling_mat().i() * this->swapmat(dim1,dim2,dim3).i() 
       * this->sampling_mat();
     swapvol.set_qform(this->qform_code(), nmat);
     
-- 
GitLab