Skip to content
Snippets Groups Projects
Commit d39dd0d3 authored by Saad Jbabdi's avatar Saad Jbabdi
Browse files

added an option --pd to probtrackx for balancing the probability w.r.t distance

parent e9766ad5
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ class probtrackxOptions { ...@@ -35,6 +35,7 @@ class probtrackxOptions {
Option<string> mode; Option<string> mode;
Option<string> targetfile; Option<string> targetfile;
Option<bool> simpleout; Option<bool> simpleout;
Option<int> pathdist;
Option<bool> s2tout; Option<bool> s2tout;
FmribOption<bool> matrix1out; FmribOption<bool> matrix1out;
FmribOption<bool> matrix2out; FmribOption<bool> matrix2out;
...@@ -109,6 +110,9 @@ class probtrackxOptions { ...@@ -109,6 +110,9 @@ class probtrackxOptions {
simpleout(string("--opd"), false, simpleout(string("--opd"), false,
string("output path distribution"), string("output path distribution"),
false, no_argument), false, no_argument),
pathdist(string("--pd"), 1,
string("path distribution, 1:probability,2:distance corrected value"),
false, requires_argument),
s2tout(string("--os2t"), false, s2tout(string("--os2t"), false,
string("output seeds to targets"), string("output seeds to targets"),
false, no_argument), false, no_argument),
...@@ -119,18 +123,17 @@ class probtrackxOptions { ...@@ -119,18 +123,17 @@ class probtrackxOptions {
string("output matrix2"), string("output matrix2"),
false, no_argument), false, no_argument),
maskmatrixout(string("--omaskmatrix"), false, maskmatrixout(string("--omaskmatrix"), false,
string("output maskmatrix"), string("output maskmatrix"),
false, no_argument), false, no_argument),
outfile(string("-o,--out"), string(""),
outfile(string("-o,--out"), string(""), string("Output file (only for single seed voxel mode)"),
string("Output file (only for single seed voxel mode)"), false, requires_argument),
false, requires_argument),
rubbishfile(string("--rubbish"), string(""), rubbishfile(string("--rubbish"), string(""),
string("Rubbish file"), string("Rubbish file"),
false, requires_argument), false, requires_argument),
seeds_to_dti(string("--xfm"), string(""), seeds_to_dti(string("--xfm"), string(""),
string("Transform Matrix taking seed space to DTI space default is to use the identity"),false, requires_argument), string("Transform Matrix taking seed space to DTI space default is to use the identity"),false, requires_argument),
skipmask(string("--no_integrity"), string(""), skipmask(string("--no_integrity"), string(""),
string("no explanation needed"), string("no explanation needed"),
false, requires_argument), false, requires_argument),
seedref(string("--seedref"), string(""), seedref(string("--seedref"), string(""),
...@@ -205,6 +208,7 @@ class probtrackxOptions { ...@@ -205,6 +208,7 @@ class probtrackxOptions {
options.add(logdir); options.add(logdir);
options.add(forcedir); options.add(forcedir);
options.add(simpleout); options.add(simpleout);
options.add(pathdist);
options.add(s2tout); options.add(s2tout);
options.add(matrix1out); options.add(matrix1out);
options.add(matrix2out); options.add(matrix2out);
......
...@@ -363,11 +363,23 @@ namespace TRACT{ ...@@ -363,11 +363,23 @@ namespace TRACT{
void Counter::update_pathdist(){ void Counter::update_pathdist(){
const vector<ColumnVector>& path=m_stline.get_path_ref(); const vector<ColumnVector>& path=m_stline.get_path_ref();
for(unsigned int i=0;i<path.size();i++){ if(opts.pathdist.value()==1){
int x_s=int(round(float(path[i](1)))),y_s=int(round(float(path[i](2)))),z_s=int(round(float(path[i](3)))); for(unsigned int i=0;i<path.size();i++){
if(m_beenhere(x_s,y_s,z_s)==0){ int x_s=int(round(float(path[i](1)))),y_s=int(round(float(path[i](2)))),z_s=int(round(float(path[i](3))));
m_prob(x_s,y_s,z_s)+=1; if(m_beenhere(x_s,y_s,z_s)==0){
m_beenhere(x_s,y_s,z_s)=1; m_prob(x_s,y_s,z_s)+=1;
m_beenhere(x_s,y_s,z_s)=1;
}
}
}
else{
int d=1;
for(unsigned int i=0;i<path.size();i++){
int x_s=int(round(float(path[i](1)))),y_s=int(round(float(path[i](2)))),z_s=int(round(float(path[i](3))));
if(m_beenhere(x_s,y_s,z_s)==0){
m_prob(x_s,y_s,z_s)+=d;d++;
m_beenhere(x_s,y_s,z_s)=1;
}
} }
} }
......
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