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

now with static vxt option

parent 9c00435d
No related branches found
No related tags found
No related merge requests found
......@@ -103,8 +103,11 @@ using namespace std;
Option<string> outvnscales(string("--out_vnscales"),string(""),
string("output file name for scaling factors for variance normalisation"),
false, requires_argument);
Option<vector<string> > textConfounds(string("--vxt"), vector<string>(),
string("\tlist of text files containing text matrix confounds. caution BETA option."),
false, requires_argument);
Option<vector<string> > voxelwiseConfounds(string("--vxf"), vector<string>(),
string("\tlist of 4D images containing voxelwise EVs (list order corresponds to numbers in vxl option). caution BETA option."),
string("\tlist of 4D images containing voxelwise confounds. caution BETA option."),
false, requires_argument);
/*
}
......@@ -203,11 +206,19 @@ int setup(int &dof){
}
dof=(int)ols_dof(design);
Matrix baseConfounds;
if ( textConfounds.set() ) {
baseConfounds=read_ascii_matrix( textConfounds.value().at(0) );
for(unsigned int i=1; i< textConfounds.value().size(); i++)
baseConfounds|=read_ascii_matrix( textConfounds.value().at(i) );
dof-=textConfounds.value().size();
if ( !voxelwiseConfounds.set() )
data=(IdentityMatrix(baseConfounds.Nrows())-baseConfounds*pinv(baseConfounds))*data;
}
if ( voxelwiseConfounds.set() ) {
vector<Matrix> confounds;
confounds.resize(voxelwiseConfounds.value().size());
cerr << confounds.size() << endl;
volume4D<float> input;
for(unsigned int i=0; i< confounds.size(); i++) {
read_volume4D(input,voxelwiseConfounds.value().at(i));
......@@ -220,11 +231,15 @@ int setup(int &dof){
Matrix confound(confounds.at(0).Column(voxel) );
for(unsigned int i=1; i< confounds.size(); i++)
confound|=confounds.at(i).Column(voxel);
data.Column(voxel)=(IdentityMatrix(confound.Nrows())-confound*pinv(confound))*data.Column(voxel);
}
dof-=2;
if ( textConfounds.set() )
confound=baseConfounds | confound;
data.Column(voxel)=(IdentityMatrix(confound.Nrows())-confound*pinv(confound))*data.Column(voxel);
}
dof-=confounds.size();
}
if(perf_demean.value()){
if(debug.value())
cout << "De-meaning the data matrix" << endl;
......@@ -329,6 +344,7 @@ int main(int argc,char *argv[]){
options.add(outsigsq);
options.add(outdata);
options.add(outvnscales);
options.add(textConfounds);
options.add(voxelwiseConfounds);
options.parse_command_line(argc, argv);
......
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