diff --git a/fsl_glm.cc b/fsl_glm.cc index bc5ff3109dbf4391f60ffa44a79f9cf9b0e4dff7..4782dce5aa73d45af52903109c00b72835191b16 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 cafe3e85dbbac52537b00adb31143b7704a48667..f988a1bb4313e672de8a8b2fe91026871ec90d60 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 98f39de144d73d6f303b137d1586f08f80069214..310b2ac22e73d84a51538872869e31b77bb46d8b 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 b1108e26eff11da2780209cd3e6ff5c555a91f40..23a02c6af14b693a2f90ccd28d2898b8102398f0 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 3648396fd050822c2d444f14342d77c921244f1d..4b77a6ff4866d1d09b852f8821d46500d4540a77 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 8126e20771e2a739b565b905808211bf90f8e0af..e97a4e157beaa2b72471399efc259f72bb09db2a 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 20cf19cfaeb6595bbfdf6f3ccb5bf8fa08bd285e..a00f69863f6926a78698cd86934f9a60b22d780d 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 c4b911bb163721df0887812546b925df26a87908..8d579bbbd7c8915ef661be63c855024efbece788 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 9b715bf2402ecdb0fe59d2c5169588ebeb6c2dbb..b7ff1e945f2f9e9067c17f09c93b70cfe79a9975 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 0cf5792c1b48962f322309c11c83065d471da95c..918cb469eb42412d364b181ce89e0aa1a09e4599 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 d991c0e426c1e816efa9fbe4d60523ceb05a36f6..ce7133ed0094c240f3fdf1e525a6a06d3f35aa98 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 bf1fc2d60ac5711444801ade7db636db85447f8e..abe803a612322801bfc397835ed55680ae4833e6 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 549caf2fd8471ca21fcc77719e93cfc84fa31de8..89940481496ae3d67d2e4be79d9334c9e1ecb872 100644 --- a/test.cc +++ b/test.cc @@ -37,11 +37,6 @@ using namespace std; /* } */ -//Globals { - - volumeinfo volinf; /* -} -*/ //////////////////////////////////////////////////////////////////////////// // Local functions