Newer
Older
Option<bool> verbose(string("-V,--verbose"), false,
string("switch on diagnostic messages"),
false, no_argument);
Option<bool> help(string("-h,--help"), false,
string("display this message"),
false, no_argument);
Option<float> dof(string("-d,--dof"), 100.0,
string("number of degrees of freedom"),
true, requires_argument);
Option<string> mask(string("-m,--mask"), string("mask"),
string("brain mask volume"),
Option<string> resid(string("-r,--res"), string("res4d"),
string("4d `residual-of-fit' image"),
true, requires_argument);
Option<int> segid(string("-s,--shared-seg-id"), -1,
"shared memory segment ID",
false, requires_argument);
"opttst (Version 1.0)\n\n\
Copyright(c) 2000, University of Oxford\n\
Dave Flitney";
"opttst --dof=<number> --mask=<filename> --res=<filename>\n\
opttst -d <number> -m <filename> -r <filename>\n\
options.add(verbose);
options.add(help);
options.add(segid);
options.add(dof);
options.add(mask);
options.add(resid);
for(unsigned int a = options.parse_command_line(argc, argv);
!options.check_compulsory_arguments())
options.usage();
dof.set_T(50);
if(verbose.value()) {
cout << "verbose = " << verbose.value() << endl;
cout << "help = " << help.value() << endl;
cout << "dof = " << dof.value() << endl;
cout << "mask = " << mask.value() << endl;
cout << "resid = " << resid.value() << endl;
}
} catch(X_OptionError& e) {
cerr << endl << e.what() << endl;
} catch(std::exception &e) {
cerr << e.what() << endl;
}
}