Newer
Older
/* tractOptions.h
Tim Behrens, FMRIB Image Analysis Group
/* CCOPYRIGHT */
#if !defined(tractOptions_h)
#define tractOptions_h
#include <string>
#include <iostream>
#include <fstream>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include <stdlib.h>
#include <stdio.h>
#include "utils/options.h"
//#include "newmatall.h"
using namespace Utilities;
namespace TRACT {
class tractOptions {
public:
static tractOptions& getInstance();
~tractOptions() { delete gopt; }
Option<bool> verbose;
Option<bool> help;
Option<string> basename;
Option<string> maskfile;
Option<int> nparticles;
Option<int> nsteps;
Option<bool> usef;
Option<float> rseed;
bool parse_command_line(int argc, char** argv);
private:
tractOptions();
const tractOptions& operator=(tractOptions&);
tractOptions(tractOptions&);
OptionParser options;
static tractOptions* gopt;
};
inline tractOptions& tractOptions::getInstance(){
if(gopt == NULL)
gopt = new tractOptions();
return *gopt;
}
inline tractOptions::tractOptions() :
verbose(string("-V,--verbose"), false,
string("switch on diagnostic messages"),
false, no_argument),
help(string("-h,--help"), false,
string("display this message"),
false, no_argument),
basename(string("-s,--samples"), string("DTI"),
string("basename for samples files"),
true, requires_argument),
maskfile(string("-m,--mask"), string("mask"),
string("Bet binary mask file"),
true, requires_argument),
nparticles(string("-P,--nparticles"), 10000,
string("Number of particles"),
false, requires_argument),
nsteps(string("-S,--nsteps"), 1000,
string("Number of steps per particle"),
false, requires_argument),
usef(string("-f,--usef"), false,
string("Use anisotropy to constrain tracking"),
false, no_argument),
rseed(string("-s,--seed"), 0.324571,
string("Random seed"),
false, requires_argument),
options("dtisamples", "dtisamples -k <filename>\n dtisamples --verbose\n")
{
try {
options.add(verbose);
options.add(help);
options.add(basename);
options.add(maskfile);
options.add(nparticles);
options.add(nsteps);
options.add(usef);
options.add(rseed);
}
catch(X_OptionError& e) {
options.usage();
cerr << endl << e.what() << endl;
}
catch(std::exception &e) {
cerr << e.what() << endl;
}
}
}
#endif