From 6e30071492b3c7fab39f29b04eb1f659ce905b30 Mon Sep 17 00:00:00 2001
From: Matthew Webster <mwebster@fmrib.ox.ac.uk>
Date: Fri, 16 Jan 2009 10:27:45 +0000
Subject: [PATCH] removed volumeinfo

---
 fsl_glm.cc     |  7 +++----
 fsl_mvlm.cc    |  7 +++----
 fsl_regfilt.cc |  7 +++----
 fsl_sbca.cc    |  9 ++++-----
 ggmix.cc       |  3 +--
 ggmix.h        |  3 +--
 meldata.cc     |  2 +-
 meldata.h      |  3 +--
 melgmix.cc     |  3 +--
 melgmix.h      |  3 +--
 melodic.cc     |  6 ++----
 melreport.cc   | 23 +++++++----------------
 test.cc        |  5 -----
 13 files changed, 28 insertions(+), 53 deletions(-)

diff --git a/fsl_glm.cc b/fsl_glm.cc
index bc5ff31..4782dce 100644
--- a/fsl_glm.cc
+++ b/fsl_glm.cc
@@ -109,8 +109,7 @@ using namespace std;
 	Matrix fcontrasts;
 	Matrix meanR;
 	RowVector vnscales;
-	volume<float> mask;
-	volumeinfo volinf;  /*
+	volume<float> mask;  /*
 }
 */
 ////////////////////////////////////////////////////////////////////////////
@@ -123,7 +122,7 @@ void save4D(Matrix what, string fname){
 				tempVol.setmatrix(what.t(),mask);
 			else
 				tempVol.setmatrix(what,mask);
-			save_volume4D(tempVol,fname,volinf);
+			save_volume4D(tempVol,fname);
 		}
 }
 
@@ -147,7 +146,7 @@ int setup(){
 	if(fsl_imageexists(fnin.value())){//read data
 		//input is 3D/4D vol
 		volume4D<float> tmpdata;
-		read_volume4D(tmpdata,fnin.value(),volinf);
+		read_volume4D(tmpdata,fnin.value());
 		
 		// create mask
 		if(fnmask.value()>""){
diff --git a/fsl_mvlm.cc b/fsl_mvlm.cc
index cafe3e8..f988a1b 100644
--- a/fsl_mvlm.cc
+++ b/fsl_mvlm.cc
@@ -116,8 +116,7 @@ using namespace std;
 	Matrix svd_X_U, svd_X_V, svd_Y_U, svd_Y_V;
 	DiagonalMatrix svd_X_D, svd_Y_D;	
 	RowVector vnscales;
-	volume<float> mask;
-	volumeinfo volinf;  
+	volume<float> mask;  
 
 ////////////////////////////////////////////////////////////////////////////
 
@@ -129,7 +128,7 @@ void save4D(Matrix what, string fname){
 				tempVol.setmatrix(what.t(),mask);
 			else
 				tempVol.setmatrix(what,mask);
-			save_volume4D(tempVol,fname,volinf);
+			save_volume4D(tempVol,fname);
 		}
 }
 
@@ -156,7 +155,7 @@ int setup(){
 	if(fsl_imageexists(fnin.value())){//read data
 		//input is 3D/4D vol
 		volume4D<float> tmpdata;
-		read_volume4D(tmpdata,fnin.value(),volinf);
+		read_volume4D(tmpdata,fnin.value());
 		
 		// create mask
 		if(fnmask.value()>""){
diff --git a/fsl_regfilt.cc b/fsl_regfilt.cc
index 98f39de..310b2ac 100644
--- a/fsl_regfilt.cc
+++ b/fsl_regfilt.cc
@@ -70,8 +70,7 @@ using namespace std;
 	Matrix meanR;
 	RowVector vnscales;
 	volume<float> mask;
-	volume<float> Mean;
-	volumeinfo volinf;  /*
+	volume<float> Mean;  /*
 }
 */
 ////////////////////////////////////////////////////////////////////////////
@@ -84,7 +83,7 @@ void save4D(Matrix what, string fname){
 				tempVol.setmatrix(what.t(),mask);
 			else
 				tempVol.setmatrix(what,mask);
-			save_volume4D(tempVol,fname,volinf);
+			save_volume4D(tempVol,fname);
 		}
 }
 
@@ -152,7 +151,7 @@ int setup(){
 	if(fsl_imageexists(fnin.value())){//read data
 		//input is 3D/4D vol
 		volume4D<float> tmpdata;
-		read_volume4D(tmpdata,fnin.value(),volinf);
+		read_volume4D(tmpdata,fnin.value());
 		
 		// create mask
 		if(fnmask.value()>""){
diff --git a/fsl_sbca.cc b/fsl_sbca.cc
index b1108e2..23a02c6 100644
--- a/fsl_sbca.cc
+++ b/fsl_sbca.cc
@@ -93,8 +93,7 @@ using namespace std;
 //Globals {
 	Matrix data, confounds;
 	volume4D<float> orig_data;
-	volume<float> maskS, maskT;
-	volumeinfo volinf; 
+	volume<float> maskS, maskT; 
 	int voxels = 0;
 	Matrix seeds, coords;
 	vector<Matrix> ttcs;
@@ -111,7 +110,7 @@ void save4D(Matrix what, volume<float>& msk, string fname){
 	cerr << "DBG: in save4D" << endl;
   volume4D<float> tempVol;
   tempVol.setmatrix(what,msk);
-  save_volume4D(tempVol,fname,volinf);
+  save_volume4D(tempVol,fname);
 }
 
 void save4D(volume<float>& in, string fname){
@@ -119,7 +118,7 @@ void save4D(volume<float>& in, string fname){
 	cerr << "DBG: in save4D" << endl;
   volume4D<float> tempVol;
   tempVol.addvolume(in);
-  save_volume4D(tempVol,fname,volinf);
+  save_volume4D(tempVol,fname);
 }
 
 ReturnMatrix create_coords(string what){
@@ -340,7 +339,7 @@ int setup(){
   if(fsl_imageexists(fnin.value())){ //read data
 	if(verbose.value())
       cout << " Reading input file " << fnin.value() << endl;
-    read_volume4D(orig_data,fnin.value(),volinf);
+    read_volume4D(orig_data,fnin.value());
   }
   else{
 	cerr << "ERROR: Invalid input file " << fnin.value() << endl;       
diff --git a/ggmix.cc b/ggmix.cc
index 3648396..4b77a6f 100644
--- a/ggmix.cc
+++ b/ggmix.cc
@@ -34,13 +34,12 @@ string float2str(float f,int width, int prec, bool scientif)
  
 namespace GGMIX{
   
-  void ggmix::setup(const RowVector& dat, volumeinfo inf, 
+  void ggmix::setup(const RowVector& dat, 
 		      const string dirname,
 		      int cnum, volume<float> themask, 
 		      volume<float> themean, 
 		      int num_mix, float eps, bool fixit)
   {
-    bginfo = inf;
     cnumber = cnum;
     Mask = themask;
     Mean = themean;
diff --git a/ggmix.h b/ggmix.h
index 8126e20..e97a4e1 100644
--- a/ggmix.h
+++ b/ggmix.h
@@ -40,7 +40,7 @@ namespace GGMIX{
 
       void save();
 
-      void setup(const RowVector& dat, volumeinfo inf, const string dirname,
+      void setup(const RowVector& dat, const string dirname,
 		 int here, volume<float> themask, 
 		 volume<float> themean, int num_mix = 3, 
 		 float eps = 0.0, bool fixdim = false);
@@ -194,7 +194,6 @@ namespace GGMIX{
       string mmtype;
       string dirname;
 
-      volumeinfo bginfo;
       vector<string> threshinfo;
 
     };
diff --git a/meldata.cc b/meldata.cc
index 20cf19c..a00f698 100644
--- a/meldata.cc
+++ b/meldata.cc
@@ -337,7 +337,7 @@ namespace Melodic{
   {
 
     //initialize Mean
-    read_volume(Mean,opts.inputfname.value().at(0),tempInfo);
+    read_volume(Mean,opts.inputfname.value().at(0));
 
     //create mask
     create_mask(Mask);
diff --git a/meldata.h b/meldata.h
index c4b911b..8d579bb 100644
--- a/meldata.h
+++ b/meldata.h
@@ -41,7 +41,7 @@ namespace Melodic{
       inline void save4D(Matrix what, string fname){
 	 			volume4D<float> tempVol;
 	 			tempVol.setmatrix(what,Mask);
-	 			save_volume4D(tempVol,logger.appendDir(fname),tempInfo);
+	 			save_volume4D(tempVol,logger.appendDir(fname));
 	 			message("  " << logger.appendDir(fname) << endl);
       }
       
@@ -197,7 +197,6 @@ namespace Melodic{
       void sort();
 	  void reregress();
 
-      volumeinfo tempInfo;
       vector<Matrix> DWM, WM;
 			basicGLM glmT, glmS;
 			Matrix Tdes, Tcon, TconF, Sdes, Scon, SconF, param, paramS;	
diff --git a/melgmix.cc b/melgmix.cc
index 9b715bf..b7ff1e9 100644
--- a/melgmix.cc
+++ b/melgmix.cc
@@ -39,12 +39,11 @@ string float2str(float f,int width, int prec, bool scientif){
   
 namespace Melodic{
   
-  void MelGMix::setup(const RowVector& dat, volumeinfo inf, 
+  void MelGMix::setup(const RowVector& dat, 
 		const string dirname,
 		int cnum, volume<float> themask, 
 		volume<float> themean, 
 		int num_mix, float eps, bool fixit){
-    	bginfo = inf;
     	cnumber = cnum;
     	Mask = themask;
     	Mean = themean;
diff --git a/melgmix.h b/melgmix.h
index 0cf5792..918cb46 100644
--- a/melgmix.h
+++ b/melgmix.h
@@ -37,7 +37,7 @@ namespace Melodic{
 
       void save();
 
-      void setup(const RowVector& dat, volumeinfo inf, const string dirname,
+      void setup(const RowVector& dat, const string dirname,
 		 		int here, volume<float> themask, 
 		 		volume<float> themean, int num_mix = 3, 
 		 		float eps = 0.0, bool fixdim = false);
@@ -191,7 +191,6 @@ namespace Melodic{
       string mmtype;
       string dirname;
 
-      volumeinfo bginfo;
       vector<string> threshinfo;
 
   };
diff --git a/melodic.cc b/melodic.cc
index d991c0e..ce7133e 100644
--- a/melodic.cc
+++ b/melodic.cc
@@ -189,14 +189,13 @@ void mmonly(Log& logger, MelodicOptions& opts,
   Matrix ICs;
   Matrix mixMatrix;
   Matrix fmixMatrix;
-  volumeinfo ICvolInfo;
   volume<float> Mask;
   volume<float> Mean;
   
   {
     volume4D<float> RawData;
     message("Reading data file " << opts.inputfname.value().at(0) << "  ... ");
-    read_volume4D(RawData,opts.inputfname.value().at(0),ICvolInfo);
+    read_volume4D(RawData,opts.inputfname.value().at(0));
     message(" done" << endl);
     Mean = meanvol(RawData);
   }
@@ -261,7 +260,6 @@ void mmonly(Log& logger, MelodicOptions& opts,
     }
   }
 
-  melodat.tempInfo = ICvolInfo;
   melodat.set_mask(Mask);
   melodat.set_mean(Mean);
   melodat.set_IC(ICs);
@@ -316,7 +314,7 @@ Matrix mmall(Log& logger, MelodicOptions& opts,MelodicData& melodat, MelodicRepo
       wherelog = logger.getDir();
 
 		dbgmsg(" ICmap max : "<< mean(ICmap,2).AsScalar() << endl);
-    mixmod.setup( ICmap, melodat.tempInfo,
+    mixmod.setup( ICmap,
 		  wherelog,ctr,
 		  melodat.get_mask(), 
 		  melodat.get_mean(),3);
diff --git a/melreport.cc b/melreport.cc
index bf1fc2d..abe803a 100644
--- a/melreport.cc
+++ b/melreport.cc
@@ -86,11 +86,9 @@ namespace Melodic{
 		       		melodat.get_bg().percentile(0.02),
 		       		melodat.get_bg().percentile(0.98),
 		       		map1min, map1max, map2max, map2min, 
-		       		0, 0, &melodat.tempInfo);
+		       		0, 0);
 				char instr[10000];
 	
-	  		//save_volume(newvol,report.appendDir(mmodel.get_prefix()+"rendered"),
-	  		//      melodat.tempInfo);
 				sprintf(instr," ");
 				strcat(instr,axials_instr.c_str());
 				strcat(instr,string(report.appendDir(mmodel.get_prefix()+
@@ -362,8 +360,7 @@ namespace Melodic{
 	    	volume<float> map2;
 	    	map1 = threshold(tempVol[0],float(0.0), tempVol[0].max());
 	    	map2 = threshold(tempVol[0],tempVol[0].min(), float(0.0));
-	    	// 	save_volume(map,report.appendDir(mmodel.get_prefix()+"_thresh")
-	    	//	    ,melodat.tempInfo);
+
 	    	volume<float> newvol; 
 	    	miscpic newpic;
 	    
@@ -382,12 +379,10 @@ namespace Melodic{
 			   	melodat.get_bg().percentile(0.02),
 			   	melodat.get_bg().percentile(0.98),
 			   	map1min, map1max, map2max, map2min, 
-			   	0, 0, &melodat.tempInfo);
+			   	0, 0);
 	    
 	    	char instr[10000];
 	    
-	    	//save_volume(newvol,report.appendDir(mmodel.get_prefix()+"rendered"),
-	    	//      melodat.tempInfo);
 	    	sprintf(instr," ");
 	    	strcat(instr,axials_instr.c_str());
 	    	strcat(instr,string(report.appendDir(mmodel.get_prefix()+"_thresh"+
@@ -478,12 +473,10 @@ namespace Melodic{
 			 		float(0.0),
 			 		float(0.0),
 			 		float(0.01), map1max, float(-0.01), map2min, 
-			 		0, 0, &melodat.tempInfo);
+			 		0, 0);
 
 	  		char instr[10000];
-	
-	  		//save_volume(newvol,report.appendDir(mmodel.get_prefix()+"rendered"),
-	  		//      melodat.tempInfo);
+       
 	  		sprintf(instr," ");
 	  		strcat(instr,axials_instr.c_str());
 	  		strcat(instr,string(report.appendDir(mmodel.get_prefix()+
@@ -514,7 +507,7 @@ namespace Melodic{
 			 		melodat.get_bg().percentile(0.02),
 			 		melodat.get_bg().percentile(0.98),
 			 		float(0.1), float(1.0), float(0.0), float(0.0),
-			 		0, 0, &melodat.tempInfo);
+			 		0, 0);
 
 	  		char instr[10000];
 
@@ -650,12 +643,10 @@ namespace Melodic{
 			 		float(0.0),
 			 		float(0.0),
 			 		float(0.01), map1max, float(-0.01), map2min, 
-			 		0, 0, &melodat.tempInfo);
+			 		0, 0);
 
 	  		char instr[10000];
 	
-	  		//save_volume(newvol,report.appendDir(prefix+"rendered"),
-	  		//      melodat.tempInfo);
 	  		sprintf(instr," ");
 	  		strcat(instr,axials_instr.c_str());
 	  		strcat(instr,string(report.appendDir(prefix+
diff --git a/test.cc b/test.cc
index 549caf2..8994048 100644
--- a/test.cc
+++ b/test.cc
@@ -37,11 +37,6 @@ using namespace std;
 		/*
 }
 */
-//Globals {
-	
-	volumeinfo volinf;  /*
-}
-*/
 ////////////////////////////////////////////////////////////////////////////
 
 // Local functions
-- 
GitLab