Skip to content
Snippets Groups Projects
Commit 0e6ee78b authored by Christian Beckmann's avatar Christian Beckmann
Browse files

*** empty log message ***

parent a37eae0f
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,12 @@ using namespace std;
Option<string> filter(string("-f,--filter"),string(""),
string("filter out part of the regression model, e.g. -f \"1,2,3\""),
true, requires_argument);
Option<bool> verbose(string("-v"),FALSE,
string(" switch on diagnostic messages"),
false, no_argument);
Option<bool> perfvn(string("--vn"),FALSE,
string(" perfrom variance-normalisation on data"),
false, requires_argument);
false, no_argument);
Option<int> help(string("-h,--help"), 0,
string("display this help text"),
false,no_argument);
......@@ -67,6 +70,7 @@ using namespace std;
Matrix meanR;
RowVector vnscales;
volume<float> mask;
volume<float> Mean;
volumeinfo volinf; /*
}
*/
......@@ -103,7 +107,9 @@ int dofilter(){
cerr << "ERROR: need to specify 4D input to use filtering" << endl;
return 1;
}
Matrix unmixMatrix = pinv(design);
if(verbose.value())
cout << " Calculating maps " << endl;
Matrix unmixMatrix = pinv(design);
Matrix maps = unmixMatrix * data;
Matrix noisedes;
......@@ -133,7 +139,9 @@ int dofilter(){
}
}while(p);
Matrix newData;
newData = data - noisedes * noisemaps.t();
if(verbose.value())
cout << " Calculating filtered data " << endl;
newData = data - noisedes * noisemaps.t();
newData = newData + ones(newData.Nrows(),1)*meanR;
save4D(newData,fnout.value());
......@@ -154,11 +162,19 @@ int setup(){
return 1;
};
}else{
mask = tmpdata[0]*0.0+1.0;
if(verbose.value())
cout << " Creating mask image " << endl;
Mean = meanvol(tmpdata);
float Mmin, Mmax;
Mmin = Mean.min(); Mmax = Mean.max();
mask = binarise(Mean,float(Mmin + 0.01* (Mmax-Mmin)),Mmax);
}
data = tmpdata.matrix(mask);
voxels = data.Ncols();
if(verbose.value())
cout << " Data matrix size : " << data.Nrows() << " x " << voxels << endl;
}else{
cerr << "ERROR: cannot read input image " << fnin.value()<<endl;
return 1;
......@@ -205,6 +221,7 @@ int main(int argc,char *argv[]){
options.add(fnmask);
options.add(filter);
options.add(perfvn);
options.add(verbose);
options.add(help);
options.add(outdata);
options.add(outvnscales);
......@@ -226,5 +243,5 @@ int main(int argc,char *argv[]){
}catch(std::exception &e) {
cerr << e.what() << endl;
}
}
}
......@@ -526,7 +526,6 @@ namespace Melodic{
if(meanR.Storage()>0)
newData = newData + ones(newData.Nrows(),1)*meanR;
cerr << " HERE REMOVE " << endl;
volume4D<float> tmp;
read_volume4D(tmp,opts.inputfname.value().at(0));
tmp.setmatrix(newData,Mask);
......
......@@ -239,9 +239,7 @@ namespace Melodic{
SortAscending(tmp);
RowVector newcdf(tmp);
newcdf << normcdf(tmp,means(1),vars(1));
write_ascii_matrix(dat,"dat");
write_ascii_matrix(newcdf,"newcdf");
write_ascii_matrix(tmp,"tmpmat");
float thrp = tmp(tmp.Ncols())+0.01;
float thrn = tmp(1)-0.01;
int ctr=tmp.Ncols();
......
......@@ -168,7 +168,7 @@ class MelodicOptions {
perf_bet(string("--nobet"), true,
string("\tswitch off BET"),
false, no_argument),
threshold(string("--bgthreshold"), 0.00000001,
threshold(string("--bgthreshold"), 0.01,
string("brain / non-brain threshold (only if --nobet selected)\n"),
false, requires_argument),
pca_dim(string("-d,--dim"), 0,
......
......@@ -80,7 +80,7 @@ namespace Melodic{
report <<"<OBJECT data="<<opts.guireport.value()<< "></OBJECT>"<< endl;
loghtml <<"<OBJECT data="<<opts.guireport.value()<< "></OBJECT>"<< endl;
}
report << "<IFRAME height=100px width=100% src=nav.html frameborder=0></IFRAME><p>"<< endl;
report << "<IFRAME height=80px width=100% src=nav.html frameborder=0></IFRAME><p>"<< endl;
loghtml << "<IFRAME height=100px width=100% src=nav.html frameborder=0></IFRAME><p>"
<<"<pre>../melodic.log</pre>" <<endl;
navigator <<"<CENTER><TABLE BORDER=0><TR>" << 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