From 0871bd54d0f6a6942ffecfba4c8ad500b849d8c2 Mon Sep 17 00:00:00 2001
From: Saad Jbabdi <saad@fmrib.ox.ac.uk>
Date: Tue, 31 Jul 2007 17:18:54 +0000
Subject: [PATCH] *** empty log message ***

---
 fdt.tcl             |  6 +++---
 probtrackOptions.cc |  6 +++---
 streamlines.cc      | 11 ++++++-----
 streamlines.h       |  3 ++-
 tractvolsx.h        |  3 ++-
 5 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/fdt.tcl b/fdt.tcl
index 50a8988..60a511f 100644
--- a/fdt.tcl
+++ b/fdt.tcl
@@ -249,7 +249,7 @@ proc fdt:dialog { w tclstartupfile } {
     pack $w.data.seed.voxel $w.data.seed.ssf -in $w.data.seed.f -side bottom -anchor w -pady 2
     pack $w.data.seed.menu $w.data.seed.reference -in $w.data.seed.f -side left -anchor w -pady 2
 
-    TitleFrame $w.data.seed.target -text "Multiple Masks"    
+    TitleFrame $w.data.seed.target -text "Masks list"    
     listbox $w.data.seed.targets -height 6 -width 50 -yscrollcommand "$w.data.seed.sb set"
     scrollbar $w.data.seed.sb -command "$w.data.seed.targets yview " 
     frame $w.data.seed.tb
@@ -302,7 +302,7 @@ proc fdt:dialog { w tclstartupfile } {
 
     frame $w.data.targets.wf    
     checkbutton $w.data.targets.wf.sct -text "Waypoints masks" -variable probtrack(waypoint_yn)  -command " pack forget $w.data.targets.wf.tf ; if { \$probtrack(waypoint_yn) } { pack $w.data.targets.wf.tf } ; $w.probtrack compute_size"
-    TitleFrame $w.data.targets.wf.tf -text "Waypoints"    
+    TitleFrame $w.data.targets.wf.tf -text "Waypoints list"    
     listbox $w.data.targets.wf.tf.targets -height 6 -width 50 -yscrollcommand "$w.data.targets.wf.tf.sb set"
     scrollbar $w.data.targets.wf.tf.sb -command "$w.data.targets.wf.tf.targets yview " 
     frame $w.data.targets.wf.tf.tb
@@ -330,7 +330,7 @@ proc fdt:dialog { w tclstartupfile } {
 
     frame $w.data.targets.cf    
     checkbutton $w.data.targets.cf.sct -text "Classification targets" -variable probtrack(classify_yn)  -command " pack forget $w.data.targets.cf.tf ; if { \$probtrack(classify_yn) } { pack $w.data.targets.cf.tf } ; $w.probtrack compute_size"
-    TitleFrame $w.data.targets.cf.tf -text "Classification"    
+    TitleFrame $w.data.targets.cf.tf -text "Targets list"    
     listbox $w.data.targets.cf.tf.targets -height 6 -width 50 -yscrollcommand "$w.data.targets.cf.tf.sb set"
     scrollbar $w.data.targets.cf.tf.sb -command "$w.data.targets.cf.tf.targets yview " 
     frame $w.data.targets.cf.tf.tb
diff --git a/probtrackOptions.cc b/probtrackOptions.cc
index abc642e..784ddff 100644
--- a/probtrackOptions.cc
+++ b/probtrackOptions.cc
@@ -42,9 +42,9 @@ probtrackOptions* probtrackOptions::gopt = NULL;
 	modecheck(); // check all the correct options are set for this mode.
 	if(mode.value()!="simple"){  
 	  if(forcedir.value())
-	    logger.setthenmakeDir(logdir.value(),"probtrack.log");
+	    logger.setthenmakeDir(logdir.value(),"probtrackx.log");
 	  else
-	    logger.makeDir(logdir.value(),"probtrack.log");
+	    logger.makeDir(logdir.value(),"probtrackx.log");
 	  
 	  cout << "Log directory is: " << logger.getDir() << endl;
 	  
@@ -60,7 +60,7 @@ probtrackOptions* probtrackOptions::gopt = NULL;
     }
     catch(X_OptionError& e){
       cerr<<e.what()<<endl;
-      cerr<<"try: probtrack --help"<<endl;
+      cerr<<"try: probtrackx --help"<<endl;
       exit(0);
     }
     
diff --git a/streamlines.cc b/streamlines.cc
index 9ea0835..b925337 100644
--- a/streamlines.cc
+++ b/streamlines.cc
@@ -630,11 +630,12 @@ namespace TRACT{
       fibst=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;
-      if(tmp>0.5)
-	fibst=0;
-      else
-	fibst=1;// fix this for > 2 fibres
+      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;
diff --git a/streamlines.h b/streamlines.h
index 050937f..1fef0a5 100644
--- a/streamlines.h
+++ b/streamlines.h
@@ -68,7 +68,8 @@ namespace TRACT{
       for(unsigned int i=0;i<m_waymasks.size();i++)
 	pop_waymasks();
     }
-    
+
+    inline int nfibres() const {return vols.nfibres();}
     inline const float get_x_seed() const {return m_x_s_init;}
     inline const float get_y_seed() const {return m_y_s_init;}
     inline const float get_z_seed() const {return m_z_s_init;}
diff --git a/tractvolsx.h b/tractvolsx.h
index 8ea1ed5..5ca4dcb 100644
--- a/tractvolsx.h
+++ b/tractvolsx.h
@@ -32,6 +32,7 @@ namespace TRACTVOLSX{
       bool init_sample;
       int fibst;
       bool usef;
+      
     public:
       //constructors::
       Tractvolsx(const bool& usefin=false):opts(probtrackxOptions::getInstance()),init_sample(true),fibst(1),usef(usefin){}
@@ -44,7 +45,7 @@ namespace TRACTVOLSX{
 	for(unsigned int m=0;m<fsamples.size();m++)
 	  delete fsamples[m];
       }
-      
+      inline int nfibres()const{return (int)thsamples.size();}
       
       void reset(const int& fibst_in){
 	init_sample=true;
-- 
GitLab