diff --git a/Makefile b/Makefile index d12cd48eb98142d302a08afee1d38b9565cb45a3..ecf8f167d14960069060d83e344e8ccce88bd0df 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} -L${LIB_GD} -L${LIB_GDC} -L${LIB_PNG} LIBS = -lutils -lnewimage -lmiscplot -lmiscpic -lmiscmaths -lfslio -lniftiio -lznz -lnewmat -lprob -lm -lgdc -lgd -lpng -lz -TEST_OBJS = melhlprfns.o test.o +TEST_OBJS = test.o test2.o GGMIX_OBJS = ggmix.o diff --git a/fsl_glm.cc b/fsl_glm.cc index 0398b2992ce5e9fb7f4b327ca72b86e5f979c866..e1f98736fd6c520a20e5e643d62dd3c310a36208 100644 --- a/fsl_glm.cc +++ b/fsl_glm.cc @@ -44,7 +44,7 @@ using namespace std; false, requires_argument); Option<string> fncontrasts(string("-c,--contrasts"), string(""), string("matrix of t-statistics contrasts"), - false, requires_argument, false); + true, requires_argument); Option<string> fnftest(string("-f,--ftests"), string(""), string("matrix of F-tests on contrasts"), false, requires_argument); diff --git a/meldata.cc b/meldata.cc index 54b0dd55731e2a9dd0d2cf7c64d86a8bc0bb4dee..a1115ec9f420ca47afc1ad9f58b91d3ac62f291c 100644 --- a/meldata.cc +++ b/meldata.cc @@ -87,9 +87,11 @@ namespace Melodic{ if(opts.varnorm.value()){ message(" Normalising by voxel-wise variance ..."); if(stdDev.Storage()==0) - stdDev = varnorm(tmpData,std::min(30,tmpData.Nrows()-1),2.3)/numfiles; + stdDev = varnorm(tmpData,std::min(30,tmpData.Nrows()-1), + opts.vn_level.value())/numfiles; else - stdDev += varnorm(tmpData,std::min(30,tmpData.Nrows()-1),2.3)/numfiles; + stdDev += varnorm(tmpData,std::min(30,tmpData.Nrows()-1), + opts.vn_level.value())/numfiles; stdDevi = pow(stdDev,-1); message(" done" << endl); } @@ -490,7 +492,9 @@ namespace Melodic{ save4D(PCAmaps,opts.outputfname.value() + "_pca"); } - } //void save() + + message("...done" << endl); + } //void save() int MelodicData::remove_components() { @@ -748,14 +752,19 @@ namespace Melodic{ // Setup external call to BET: - char callBETstr[1000]; - ostrstream betosc(callBETstr,1000); - betosc << BET_path << " " << Mean_fname << " " - << BET_outputfname << " " << BET_optarg << " > /dev/null " << '\0'; - - message(" Calling BET: " << callBETstr << endl); - system(callBETstr); + // char callBETstr[1000]; + // ostrstream betosc(callBETstr,1000); +// betosc << BET_path << " " << Mean_fname << " " +// << BET_outputfname << " " << BET_optarg << " > /dev/null " << '\0'; +// message(" Calling BET: " << callBETstr << endl); +// system(callBETstr); + + string tmpstr = BET_path + string(" ") + + Mean_fname + string(" ") + BET_outputfname + string(" ") + + BET_optarg + string(" > /dev/null "); + system(tmpstr.c_str()); + // read back the Mask file read_volume(theMask,Mask_fname); diff --git a/melodic.cc b/melodic.cc index 0d04f18e8bdbdbd4eb344d13109351de76bef407..fef92f1086bb0e5d1ebb0f9831df4bdf0d29db4e 100644 --- a/melodic.cc +++ b/melodic.cc @@ -135,7 +135,8 @@ int main(int argc, char *argv[]){ melodat.save(); Matrix pmaps;//(melodat.get_IC()); Matrix mmres; - + + message("Creating report index page ..."); if( bool(opts.genreport.value()) ){ report.analysistxt(); if(melodat.get_numfiles()>1) @@ -143,6 +144,7 @@ int main(int argc, char *argv[]){ report.PPCA_rep(); } + message("done"<< endl <<endl); if(opts.perf_mm.value()) mmres = mmall(logger,opts,melodat,report,pmaps); else{ diff --git a/meloptions.h b/meloptions.h index 534a1cfa698bcf27f387f8d23fdad040141acc44..ca1eec87c6d44800cc60d234ed01d9fc5f9e7e99 100644 --- a/meloptions.h +++ b/meloptions.h @@ -55,6 +55,7 @@ class MelodicOptions { Option<string> pca_est; Option<bool> joined_whiten; Option<bool> joined_vn; + Option<float> vn_level; Option<int> numICs; Option<string> approach; Option<string> nonlinearity; @@ -186,8 +187,11 @@ class MelodicOptions { string("switch on separate whitening"), false, no_argument), joined_vn(string("--sep_vn"), true, - string("switch off joined variance nomalisation"), - false, no_argument, false), + string("switch off joined variance nomalisation"), + false, no_argument, false), + vn_level(string("--vn_level"), float(2.3), + string("variance nomalisation threshold level (Z> value is ignored)"), + false, requires_argument, false), numICs(string("-n,--numICs"), -1, string("numer of IC's to extract (for deflation approach)"), false, requires_argument), @@ -379,6 +383,7 @@ class MelodicOptions { options.add(pca_est); options.add(joined_whiten); options.add(joined_vn); + options.add(vn_level); options.add(numICs); options.add(approach); options.add(nonlinearity); diff --git a/melreport.cc b/melreport.cc index beeb33272001c3d97c0dedda50f670eef6c6611a..b851f86ee761c0efc5a7888f87095cbd335d9e08 100644 --- a/melreport.cc +++ b/melreport.cc @@ -289,7 +289,7 @@ namespace Melodic{ newplot.boxplot((Matrix)smode.Column(1), report.appendDir(string("b")+num2str(cnum)+".png"), - string("Subject/Session mode")); + string("Subject/Session mode")); write_ascii_matrix(report.appendDir(string("s") +num2str(cnum)+".txt"), smode); IChtml << "<A HREF=\"" << string("s") @@ -789,16 +789,18 @@ namespace Melodic{ << "session/subject domain (" << melodat.get_numfiles() << " input files). Components have been sorted in decreasing order of " << " the median response per component. <br><br>"; + + outMsize("Smode.at(0)", melodat.get_Smodes().at(0)); Matrix allmodes = melodat.get_Smodes().at(0); for(int ctr = 1; ctr < (int)melodat.get_Smodes().size();++ctr) allmodes |= melodat.get_Smodes().at(ctr); - + + outMsize("allmodes", allmodes); newplot.add_xlabel("Component No."); newplot.add_ylabel(""); newplot.set_xysize(100+30*allmodes.Ncols(),300); newplot.boxplot(allmodes,report.appendDir(string("bp_Smodes.png")), - string("Subject/Session modes")); - - report << "<img BORDER=0 SRC=\"bp_Smodes.png\"><p>" << endl; + string("Subject/Session modes")); + report << "<img BORDER=0 SRC=\"bp_Smodes.png\"><p>" << endl; } }