Skip to content
Snippets Groups Projects
Commit 607cafee authored by Matthew Webster's avatar Matthew Webster
Browse files

test

parent 5d7f2f33
No related branches found
No related tags found
No related merge requests found
...@@ -24,9 +24,7 @@ using namespace std; ...@@ -24,9 +24,7 @@ using namespace std;
string title=string("fsl_glm (Version 1.1)")+ string title=string("fsl_glm (Version 1.1)")+
string("\nCopyright(c) 2004-2009, University of Oxford (Christian F. Beckmann)\n")+ string("\nCopyright(c) 2004-2009, University of Oxford (Christian F. Beckmann)\n")+
string(" \n Simple GLM usign ordinary least-squares (OLS) regression on\n")+ string(" \n Simple GLM allowing temporal or spatial regression on either text data or images\n");
string(" time courses and/or 3D/4D imges against time courses \n")+
string(" or 3D/4D images");
string examples="fsl_glm -i <input> -d <design> -o <output> [options]"; string examples="fsl_glm -i <input> -d <design> -o <output> [options]";
//Command line Options { //Command line Options {
...@@ -37,7 +35,7 @@ using namespace std; ...@@ -37,7 +35,7 @@ using namespace std;
string("output file name for GLM parameter estimates (GLM betas)"), string("output file name for GLM parameter estimates (GLM betas)"),
false, requires_argument); false, requires_argument);
Option<string> fndesign(string("-d,--design"), string(""), Option<string> fndesign(string("-d,--design"), string(""),
string("file name of the GLM design matrix (time courses or spatial maps)"), string("file name of the GLM design matrix (text time courses for temporal regression or an image file for spatial regression )"),
false, requires_argument); false, requires_argument);
Option<string> fnmask(string("-m,--mask"), string(""), Option<string> fnmask(string("-m,--mask"), string(""),
string("mask image file name if input is image"), string("mask image file name if input is image"),
...@@ -167,7 +165,7 @@ int setup(int &dof){ ...@@ -167,7 +165,7 @@ int setup(int &dof){
if(!samesize(tmpdata[0],mask)){ if(!samesize(tmpdata[0],mask)){
cerr << "ERROR: Mask image does not match input image" << endl; cerr << "ERROR: Mask image does not match input image" << endl;
return 1; return 1;
}; };
}else{ }else{
if(debug.value()) if(debug.value())
cout << "Creating mask image" << endl; cout << "Creating mask image" << endl;
...@@ -186,7 +184,7 @@ int setup(int &dof){ ...@@ -186,7 +184,7 @@ int setup(int &dof){
} }
} }
else else
data = read_ascii_matrix(fnin.value()); data = read_ascii_matrix(fnin.value());
if(fsl_imageexists(fndesign.value())){//read design if(fsl_imageexists(fndesign.value())){//read design
if(debug.value()) if(debug.value())
...@@ -205,8 +203,17 @@ int setup(int &dof){ ...@@ -205,8 +203,17 @@ int setup(int &dof){
design = read_ascii_matrix(fndesign.value()); design = read_ascii_matrix(fndesign.value());
} }
dof=(int)ols_dof(design); cerr << data << endl << design << endl;
if (perf_demean.value() ) {
if(debug.value())
cout << "De-meaning the data matrix" << endl;
data = remmean(data,1);
}
dof=ols_dof(design);
Matrix baseConfounds; Matrix baseConfounds;
if ( textConfounds.set() ) { if ( textConfounds.set() ) {
baseConfounds=read_ascii_matrix( textConfounds.value().at(0) ); baseConfounds=read_ascii_matrix( textConfounds.value().at(0) );
for(unsigned int i=1; i< textConfounds.value().size(); i++) for(unsigned int i=1; i< textConfounds.value().size(); i++)
...@@ -238,14 +245,6 @@ int setup(int &dof){ ...@@ -238,14 +245,6 @@ int setup(int &dof){
dof-=confounds.size(); dof-=confounds.size();
} }
if(perf_demean.value()){
if(debug.value())
cout << "De-meaning the data matrix" << endl;
data = remmean(data,1);
dof-=1;
}
if(normdat.value()){ if(normdat.value()){
if(debug.value()) if(debug.value())
cout << "Normalising data matrix to unit std-deviation" << endl; cout << "Normalising data matrix to unit std-deviation" << endl;
...@@ -253,11 +252,17 @@ int setup(int &dof){ ...@@ -253,11 +252,17 @@ int setup(int &dof){
} }
meanR=mean(data,1); meanR=mean(data,1);
if(perf_demean.value()){ if(perf_demean.value()){
if(debug.value()) if(debug.value())
cout << "De-meaning design matrix" << endl; cout << "De-meaning design matrix" << endl;
design = remmean(design,1); design = remmean(design,1);
dof-=1;
} }
cerr << data << endl << design << endl;
if(normdes.value()){ if(normdes.value()){
if(debug.value()) if(debug.value())
cout << "Normalising design matrix to unit std-deviation" << endl; cout << "Normalising design matrix to unit std-deviation" << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment