diff --git a/fslcc.cc b/fslcc.cc index 1bd27318c5ae64dbb59c8ff75a78c6b00bd2579e..3e8b8039adace9f1c88256eb60eeacd86ca68934 100755 --- a/fslcc.cc +++ b/fslcc.cc @@ -11,7 +11,9 @@ using namespace NEWIMAGE; using namespace Utilities; - +Option<string> fnmask(string("-m"), string(""), + string("mask file name "), + false, requires_argument); Option<bool> noabs(string("--noabs"), false, string("\tDon't return absolute values (keep sign)"), false, no_argument); @@ -44,6 +46,22 @@ int fmrib_main(int argc, char *argv[]) input_volume1-=input_volume1.mean(); input_volume2-=input_volume2.mean(); } + + + volume<T> theMask; + if( fnmask.value().length() > 0 ) { + read_volume(theMask,fnmask.value()); + if(!samesize(input_volume1[0],theMask)){ + cerr << "Error: Mismatch in mask dimensions" << endl; + return 1; + } + for(int t1=0;t1<=input_volume1.maxt();t1++) + input_volume1[t1] *= theMask; + for(int t2=0;t2<=input_volume2.maxt();t2++) + input_volume2[t2] *= theMask; + } + + for(int t1=0;t1<input_volume1.tsize();t1++) { double ss1=sqrt(input_volume1.constantSubVolume(t1).sumsquares()); @@ -73,6 +91,7 @@ int main(int argc,char *argv[]) string examples("fslcc [options] <first_input> <second_input> "); OptionParser options(title, examples); + options.add(fnmask); options.add(noabs); options.add(nodemean); options.add(thresh);