Skip to content
Snippets Groups Projects
Commit b24b7904 authored by Tim Behrens's avatar Tim Behrens
Browse files

*** empty log message ***

parent a5356568
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ class probtrackOptions { ...@@ -36,6 +36,7 @@ class probtrackOptions {
Option<string> targetfile; Option<string> targetfile;
Option<string> outfile; Option<string> outfile;
Option<string> rubbishfile; Option<string> rubbishfile;
FmribOption<string> uberrubbishfile;
Option<string> seeds_to_dti; Option<string> seeds_to_dti;
FmribOption<string> skipmask; FmribOption<string> skipmask;
Option<string> seedref; Option<string> seedref;
...@@ -104,6 +105,9 @@ class probtrackOptions { ...@@ -104,6 +105,9 @@ class probtrackOptions {
rubbishfile(string("--rubbish"), string(""), rubbishfile(string("--rubbish"), string(""),
string("Rubbish file"), string("Rubbish file"),
false, requires_argument), false, requires_argument),
uberrubbishfile(string("--rubbishkill"), string(""),
string("Rubbish and kill file - does not include the _whole path_ of a streamline that reaches this maskfile"),
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(""),
...@@ -172,6 +176,7 @@ class probtrackOptions { ...@@ -172,6 +176,7 @@ class probtrackOptions {
options.add(forcedir); options.add(forcedir);
options.add(outfile); options.add(outfile);
options.add(rubbishfile); options.add(rubbishfile);
options.add(uberrubbishfile);
options.add(seeds_to_dti); options.add(seeds_to_dti);
options.add(nparticles); options.add(nparticles);
options.add(nsteps); options.add(nsteps);
......
...@@ -41,12 +41,16 @@ void twomasks_symm(){ ...@@ -41,12 +41,16 @@ void twomasks_symm(){
Seeds=Seeds+(2*mask2); Seeds=Seeds+(2*mask2);
} }
volume<int> RUBBISH; //just stops the streamline but counts where it has already been
volume<int> RUBBISH; volume<int> UBERRUBBISH; //kills streamline and excludes where it has already been
if(opts.rubbishfile.value()!=""){ if(opts.rubbishfile.value()!=""){
read_volume(RUBBISH,opts.rubbishfile.value()); read_volume(RUBBISH,opts.rubbishfile.value());
} }
if(opts.uberrubbishfile.value()!=""){
read_volume(UBERRUBBISH,opts.uberrubbishfile.value());
}
volume<int> prob; volume<int> prob;
volume<int> beenhere; volume<int> beenhere;
beenhere=Seeds; beenhere=Seeds;
...@@ -137,6 +141,13 @@ void twomasks_symm(){ ...@@ -137,6 +141,13 @@ void twomasks_symm(){
int x_s =(int)round((float)xyz_seeds(1)); int x_s =(int)round((float)xyz_seeds(1));
int y_s =(int)round((float)xyz_seeds(2)); int y_s =(int)round((float)xyz_seeds(2));
int z_s =(int)round((float)xyz_seeds(3)); int z_s =(int)round((float)xyz_seeds(3));
if(opts.uberrubbishfile.value()!=""){
if(UBERRUBBISH(x_s,y_s,z_s)>0) {
keepflag=false;
break;
}
}
if(opts.rubbishfile.value()!=""){ if(opts.rubbishfile.value()!=""){
if(RUBBISH(x_s,y_s,z_s)>0) break; if(RUBBISH(x_s,y_s,z_s)>0) break;
} }
...@@ -268,11 +279,18 @@ void waypoints(){ ...@@ -268,11 +279,18 @@ void waypoints(){
passed_flags.push_back(false); passed_flags.push_back(false);
} }
volume<int> RUBBISH;
volume<int> RUBBISH; //just stops the streamline but counts where it has already been
volume<int> UBERRUBBISH; //kills streamline and excludes where it has already been
bool uberkeepflag=true;
if(opts.rubbishfile.value()!=""){ if(opts.rubbishfile.value()!=""){
read_volume(RUBBISH,opts.rubbishfile.value()); read_volume(RUBBISH,opts.rubbishfile.value());
} }
if(opts.uberrubbishfile.value()!=""){
read_volume(UBERRUBBISH,opts.uberrubbishfile.value());
}
volume<int> prob; volume<int> prob;
volume<int> beenhere; volume<int> beenhere;
beenhere=Seeds; beenhere=Seeds;
...@@ -336,7 +354,7 @@ void waypoints(){ ...@@ -336,7 +354,7 @@ void waypoints(){
for(unsigned int pf=0;pf<passed_flags.size();pf++) { for(unsigned int pf=0;pf<passed_flags.size();pf++) {
passed_flags[pf]=false; /// only keep it if this direction went through all the masks passed_flags[pf]=false; /// only keep it if this direction went through all the masks
} }
uberkeepflag=true;
for( int it = 1 ; it <= nsteps/2; it++){ for( int it = 1 ; it <= nsteps/2; it++){
if( (mask( round(part.x()), round(part.y()), round(part.z())) > 0) ){ if( (mask( round(part.x()), round(part.y()), round(part.z())) > 0) ){
...@@ -366,6 +384,12 @@ void waypoints(){ ...@@ -366,6 +384,12 @@ void waypoints(){
int x_s =(int)round((float)xyz_seeds(1)); int x_s =(int)round((float)xyz_seeds(1));
int y_s =(int)round((float)xyz_seeds(2)); int y_s =(int)round((float)xyz_seeds(2));
int z_s =(int)round((float)xyz_seeds(3)); int z_s =(int)round((float)xyz_seeds(3));
if(opts.uberrubbishfile.value()!=""){
if(UBERRUBBISH(x_s,y_s,z_s)>0) {
uberkeepflag=false;
break;
}
}
if(opts.rubbishfile.value()!=""){ if(opts.rubbishfile.value()!=""){
if(RUBBISH(x_s,y_s,z_s)>0) break; if(RUBBISH(x_s,y_s,z_s)>0) break;
} }
...@@ -428,7 +452,7 @@ void waypoints(){ ...@@ -428,7 +452,7 @@ void waypoints(){
// Do the counting after a particle has finished // Do the counting after a particle has finished
// And only if all passed_flags are set // And only if all passed_flags are set
bool keepflag=true; bool keepflag=uberkeepflag;
for(unsigned int pf=0;pf<passed_flags.size();pf++){ for(unsigned int pf=0;pf<passed_flags.size();pf++){
keepflag=(keepflag && passed_flags[pf]); keepflag=(keepflag && passed_flags[pf]);
} }
......
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