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

seed masks no longer need to be binarised

parent 0a48c2a5
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ void meshmask()
mseeds.load_fs_label(opts.seedfile.value());
// internally create seed mask in voxel space
volume<int> seeds;
volume<float> seeds;
if(opts.seedref.value()!="")
read_volume(seeds,opts.seedref.value());
else
......
......@@ -20,8 +20,8 @@ void nmasks()
////////////////////////////////
// Log& logger = LogSingleton::getInstance();
vector< volume<int> > seeds;
volume<int> tmpvol;
vector< volume<float> > seeds;
volume<float> tmpvol;
vector<string> masknames;
if(fsl_imageexists(opts.seedfile.value())){
......
......@@ -20,7 +20,7 @@ void seedmask()
////////////////////////////////
// Log& logger = LogSingleton::getInstance();
volume<int> seeds;
volume<float> seeds;
read_volume(seeds,opts.seedfile.value());
Streamliner stline;
Counter counter(seeds,stline);
......
......@@ -22,7 +22,7 @@ void track(){
logger.makeDir("particles","particle0",true,false);
}
volume<int> seedref;
volume<float> seedref;
if(opts.seedref.value()!=""){
read_volume(seedref,opts.seedref.value());
}
......
......@@ -20,7 +20,7 @@ void twomasks()
////////////////////////////////
// Log& logger = LogSingleton::getInstance();
volume<int> seeds,seeds2;
volume<float> seeds,seeds2;
read_volume(seeds,opts.seedfile.value());
read_volume(seeds2,opts.mask2.value());
......
......@@ -51,7 +51,7 @@ namespace TRACT{
}
for( unsigned int m = 0; m < masknames.size(); m++ ){
volume<int>* tmpptr =new volume<int>;
volume<float>* tmpptr =new volume<float>;
if(opts.verbose.value()>0)
cout<<masknames[m]<<endl;
read_volume(*tmpptr,masknames[m]);
......@@ -648,17 +648,23 @@ namespace TRACT{
int Seedmanager::run(const float& x,const float& y,const float& z,bool onewayonly, int fibst,const ColumnVector& dir){
//onewayonly for mesh things..
cout <<x<<" "<<y<<" "<<z<<endl;
if(fibst == -1){
fibst=0;//m_seeds(int(round(x)),int(round(y)),int(round(z)))-1;//fibre to start with is taken from seed volume..
}
if(opts.randfib.value()){
float tmp=rand()/RAND_MAX * float(m_stline.nfibres()-1);
fibst = (int)round(tmp);
//if(tmp>0.5)
//fibst=0;
//else
//fibst=1;// fix this for > 2 fibres
}
if(opts.fibst.set()){
fibst=opts.fibst.value()-1;
OUT(fibst);
}
else{
if(fibst == -1){
fibst=0;//m_seeds(int(round(x)),int(round(y)),int(round(z)))-1;//fibre to start with is taken from seed volume..
}
if(opts.randfib.value()){
float tmp=rand()/RAND_MAX * float(m_stline.nfibres()-1);
fibst = (int)round(tmp);
//if(tmp>0.5)
//fibst=0;
//else
//fibst=1;// fix this for > 2 fibres
}
}
int nlines=0;
for(int p=0;p<opts.nparticles.value();p++){
......
......@@ -30,7 +30,7 @@ namespace TRACT{
volume<int> m_rubbish;
volume<int> m_stop;
volume4D<float> m_loopcheck;
vector<volume<int>* > m_waymasks;
vector<volume<float>* > m_waymasks;
vector<bool> m_passed_flags;
vector<bool> m_own_waymasks;
Matrix m_Seeds_to_DTI;
......@@ -46,7 +46,7 @@ namespace TRACT{
for(unsigned int i=0;i<m_waymasks.size();i++)
if(m_own_waymasks[i]) delete m_waymasks[i];
}
void add_waymask(volume<int>& myway,const bool& ownership=false){
void add_waymask(volume<float>& myway,const bool& ownership=false){
//make sure that the waymask to add will not be deleted before
//this streamliner goes out of scope!!
m_waymasks.push_back(&myway);
......@@ -54,7 +54,7 @@ namespace TRACT{
m_passed_flags.push_back(false);
}
void pop_waymasks(){
volume<int>* tmpptr=m_waymasks[m_waymasks.size()-1];
volume<float>* tmpptr=m_waymasks[m_waymasks.size()-1];
m_waymasks.pop_back();
m_passed_flags.pop_back();
if(m_own_waymasks[m_own_waymasks.size()-1]){
......@@ -115,13 +115,13 @@ namespace TRACT{
int m_Conrow2;
ColumnVector m_lrdim;
const volume<int>& m_seeds;
const volume<float>& m_seeds;
ColumnVector m_seedsdim;
const Streamliner& m_stline;
Streamliner& m_nonconst_stline;
public:
Counter(const volume<int>& seeds,Streamliner& stline):opts(probtrackxOptions::getInstance()),
Counter(const volume<float>& seeds,Streamliner& stline):opts(probtrackxOptions::getInstance()),
logger(LogSingleton::getInstance()),
m_seeds(seeds),m_stline(stline),
m_nonconst_stline(stline){
......@@ -136,7 +136,8 @@ namespace TRACT{
void initialise();
void initialise_path_dist(){
m_prob=m_seeds;
m_prob.reinitialize(m_seeds.xsize(),m_seeds.ysize(),m_seeds.zsize());
copybasicproperties(m_seeds,m_prob);
m_prob=0;
}
void initialise_seedcounts();
......@@ -184,7 +185,7 @@ namespace TRACT{
inline const Streamliner& get_streamline() const {return m_stline;}
inline Streamliner& get_nonconst_streamline() const {return m_nonconst_stline;}
inline const volume<int>& get_seeds() const {return m_seeds;}
inline const volume<float>& get_seeds() const {return m_seeds;}
};
......@@ -194,7 +195,7 @@ namespace TRACT{
Log& logger;
Counter& m_counter;
Streamliner& m_stline;
const volume<int>& m_seeds;
const volume<float>& m_seeds;
ColumnVector m_seeddims;
public:
Seedmanager(Counter& counter):opts(probtrackxOptions::getInstance()),
......
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