From b3472643e51e86fce3c44f5fa95307e673856933 Mon Sep 17 00:00:00 2001
From: Mark Jenkinson <mark@fmrib.ox.ac.uk>
Date: Wed, 19 Dec 2007 12:13:41 +0000
Subject: [PATCH] Made changes for neurological fix - DO NOT MAKE STABLE YET

---
 fslmeants.cc | 4 ++--
 fslroi.cc    | 2 +-
 fslstats.cc  | 6 ++++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/fslmeants.cc b/fslmeants.cc
index 4813afe..d97c00a 100644
--- a/fslmeants.cc
+++ b/fslmeants.cc
@@ -110,7 +110,7 @@ int main(int argc,char *argv[])
     x = coordval.value(0);
     y = coordval.value(1);
     z = coordval.value(2);
-    ColumnVector v;
+    ColumnVector v(4);
     v << x << y << z << 1.0;
     if (usemm.value()) {
       // convert from mm to newimage voxels
@@ -147,7 +147,7 @@ int main(int argc,char *argv[])
 	if (mask(x,y,z)>0.5) {
 	  num++;
 	  if (showall.value()) {
-	    ColumnVector v;
+	    ColumnVector v(4);
 	    v << x << y << z << 1.0;
 	    v = (vin[0].niftivox2newimagevox_mat()).i() * v;
 	    meants(1,num) = v(1);
diff --git a/fslroi.cc b/fslroi.cc
index 7f1d90b..e3c023f 100755
--- a/fslroi.cc
+++ b/fslroi.cc
@@ -71,7 +71,7 @@ int fmrib_main(int argc, char *argv[])
     maxt+=mint-1;
   }
   // now transform these coordinates to newimage conventions
-  ColumnVector v;
+  ColumnVector v(4);
   v << minx-0.4 << miny-0.4 << minz-0.4 << 1.0;
   v = (input_vol.niftivox2newimagevox_mat()).i() * v;
   minx = MISCMATHS::round(v(1));
diff --git a/fslstats.cc b/fslstats.cc
index a7fbdfb..12eb3f9 100644
--- a/fslstats.cc
+++ b/fslstats.cc
@@ -196,7 +196,8 @@ int fmrib_main_float(int argc, char* argv[])
 	coord(3) = vol.mincoordz();
       }
       coord = (vol[0].niftivox2newimagevox_mat()).i() * coord;
-      cout << coord(1) << " " << coord(2) << " " << coord(3) << " ";
+      cout << MISCMATHS::round(coord(1)) << " " << 
+	MISCMATHS::round(coord(2)) << " " << MISCMATHS::round(coord(3)) << " ";
     } else if (sarg=="-x") { 
       ColumnVector coord(4);
       coord(4)=1.0;
@@ -210,7 +211,8 @@ int fmrib_main_float(int argc, char* argv[])
 	coord(3) = vol.maxcoordz();
       }
       coord = (vol[0].niftivox2newimagevox_mat()).i() * coord;
-      cout << coord(1) << " " << coord(2) << " " << coord(3) << " ";
+      cout << MISCMATHS::round(coord(1)) << " " << 
+	MISCMATHS::round(coord(2)) << " " << MISCMATHS::round(coord(3)) << " ";
     } else if (sarg=="-w") {
       if (!masks_used) { 
 	if (vin.nvoxels()<1) { vin = vol; }
-- 
GitLab