Skip to content
Snippets Groups Projects
ptx_simple.cc 1.26 KiB
Newer Older
Tim Behrens's avatar
Tim Behrens committed
/*  Copyright (C) 2004 University of Oxford  */

/*  CCOPYRIGHT  */

#include "ptx_simple.h"
#include "streamlines.h"

using namespace std;
using namespace NEWIMAGE;
using namespace TRACT;
using namespace Utilities;
using namespace PARTICLE;
using namespace mesh;


void track(){
Tim Behrens's avatar
Tim Behrens committed
  probtrackxOptions& opts =probtrackxOptions::getInstance();
Tim Behrens's avatar
Tim Behrens committed
  
  ////////////////////////////
  Log& logger = LogSingleton::getInstance();
  if(opts.verbose.value()>1){
    logger.makeDir("particles","particle0",true,false);
  }
  
  volume<int> seedref;
  if(opts.seedref.value()!=""){
    read_volume(seedref,opts.seedref.value());
  }
  else{
    read_volume(seedref,opts.maskfile.value());
  }
  
  Streamliner stline;
  Counter counter(seedref,stline);
  counter.initialise();
  Seedmanager seedmanager(counter);
Tim Behrens's avatar
Tim Behrens committed
  Matrix Seeds = read_ascii_matrix(opts.seedfile.value());
Saad Jbabdi's avatar
Saad Jbabdi committed
  
  int keeptot=0;
Tim Behrens's avatar
Tim Behrens committed
  for(int SN=1; SN<=Seeds.Nrows();SN++){
    float xst=Seeds(SN,1);
    float yst=Seeds(SN,2);
    float zst=Seeds(SN,3);
Saad Jbabdi's avatar
Saad Jbabdi committed
    keeptot += seedmanager.run(xst,yst,zst,false,0);
    string add="_"+num2str(Seeds(SN,1))+(string)"_"+num2str(Seeds(SN,2))+(string)"_"+num2str(Seeds(SN,3));
Tim Behrens's avatar
Tim Behrens committed
    
    counter.save_pathdist(add);
    counter.reset_prob();
  } //Close Seed number Loop
Saad Jbabdi's avatar
Saad Jbabdi committed
  cout<<"finished"<<endl;
Tim Behrens's avatar
Tim Behrens committed
}