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

changes for Xgui

parent 78587b06
No related branches found
No related tags found
No related merge requests found
...@@ -108,21 +108,6 @@ fi ...@@ -108,21 +108,6 @@ fi
Lock; Lock;
#parse option arguments
nfibres=2
fudge=1
burnin=1000
while [ ! -z "$2" ]
do
case "$2" in
-n) nfibres=$3;shift;;
-w) fudge=$3;shift;;
-b) burnin=$3;shift;;
*) break;;
esac
shift
done
subjdir=`make_absolute $1` subjdir=`make_absolute $1`
subjdir=`echo $subjdir | sed 's/\/$/$/g'` subjdir=`echo $subjdir | sed 's/\/$/$/g'`
...@@ -163,6 +148,22 @@ if [ `${FSLDIR}/bin/imtest ${subjdir}/nodif_brain_mask` -eq 0 ]; then ...@@ -163,6 +148,22 @@ if [ `${FSLDIR}/bin/imtest ${subjdir}/nodif_brain_mask` -eq 0 ]; then
fi fi
#parse option arguments
nfibres=2
fudge=1
burnin=1000
while [ ! -z "$2" ]
do
case "$2" in
-n) nfibres=$3;shift;;
-w) fudge=$3;shift;;
-b) burnin=$3;shift;;
*) break;;
esac
shift
done
echo making bedpostX directory echo making bedpostX directory
mkdir -p ${subjdir}.bedpostX/ mkdir -p ${subjdir}.bedpostX/
mkdir -p ${subjdir}.bedpostX/diff_slices mkdir -p ${subjdir}.bedpostX/diff_slices
...@@ -216,7 +217,7 @@ done ...@@ -216,7 +217,7 @@ done
numfib=`${FSLDIR}/bin/imglob -oneperimage ${subjdir}.bedpostX/diff_slices/data_slice_0000/f*samples |wc -w` numfib=`${FSLDIR}/bin/imglob -oneperimage ${subjdir}.bedpostX/diff_slices/data_slice_0000/f*samples |wc -w`
echo number of fibres $numfib
fib=1; fib=1;
while [ $fib -le $numfib ];do while [ $fib -le $numfib ];do
...@@ -232,9 +233,6 @@ while [ $fib -le $numfib ];do ...@@ -232,9 +233,6 @@ while [ $fib -le $numfib ];do
fib=`echo "$fib +1"|bc`; fib=`echo "$fib +1"|bc`;
done done
${FSLDIR}/bin/avwmerge -z ${subjdir}.bedpostX/meanSignal `${FSLDIR}/bin/imglob -oneperimage ${subjdir}.bedpostX/diff_slices/data_slice_*/meanSignal`
${FSLDIR}/bin/avwmerge -z ${subjdir}.bedpostX/stdSignal `${FSLDIR}/bin/imglob -oneperimage ${subjdir}.bedpostX/diff_slices/data_slice_*/stdSignal`
echo Removing intermediate files echo Removing intermediate files
if [ `imtest ${subjdir}.bedpostX/merged_th1samples` -eq 1 ];then if [ `imtest ${subjdir}.bedpostX/merged_th1samples` -eq 1 ];then
......
...@@ -14,6 +14,11 @@ Usage() { ...@@ -14,6 +14,11 @@ Usage() {
[ "$2" = "" ] && Usage [ "$2" = "" ] && Usage
subjdir=$1
nslices=$2
#parse option arguments #parse option arguments
nfibres=2 nfibres=2
fudge=1.5 fudge=1.5
...@@ -29,13 +34,16 @@ do ...@@ -29,13 +34,16 @@ do
shift shift
done done
echo subjdir $subjdir
echo nslices $nslices
echo nfibres $nfibres
echo fudge $fudge
echo burnin $burnin
echo piddir $piddir
[ "$piddir" = "" ] || touch ${piddir}/`hostname`_fdt_${$} [ "$piddir" = "" ] || touch ${piddir}/`hostname`_fdt_${$}
subjdir=$1
nslices=$2
slice=0 slice=0
while [ $slice -lt $nslices ];do while [ $slice -lt $nslices ];do
slicezp=`${FSLDIR}/bin/zeropad $slice 4` slicezp=`${FSLDIR}/bin/zeropad $slice 4`
......
...@@ -48,6 +48,7 @@ class probtrackxOptions { ...@@ -48,6 +48,7 @@ class probtrackxOptions {
Option<string> seedref; Option<string> seedref;
Option<string> mask2; Option<string> mask2;
Option<string> waypoints; Option<string> waypoints;
Option<bool> waypoints_and;
Option<string> meshfile; Option<string> meshfile;
FmribOption<string> lrmask; FmribOption<string> lrmask;
Option<string> logdir; Option<string> logdir;
...@@ -129,8 +130,8 @@ class probtrackxOptions { ...@@ -129,8 +130,8 @@ class probtrackxOptions {
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("--avoid"), string(""),
string("Rubbish file"), string("Reject pathways passing through locations given by this mask"),
false, requires_argument), false, requires_argument),
stopfile(string("--stop"), string(""), stopfile(string("--stop"), string(""),
string("Stop tracking at locations given by this mask file"), string("Stop tracking at locations given by this mask file"),
...@@ -147,13 +148,16 @@ class probtrackxOptions { ...@@ -147,13 +148,16 @@ class probtrackxOptions {
string("second mask in twomask_symm mode."), string("second mask in twomask_symm mode."),
false, requires_argument), false, requires_argument),
waypoints(string("--waypoints"), string(""), waypoints(string("--waypoints"), string(""),
string("Waypoint mask or ascii list of waypoint masks."), string("Waypoint mask or ascii list of waypoint masks"),
false, requires_argument), false, requires_argument),
waypoints_and(string("--network"), true,
string("Searches for pathways connecting every seed to at least one waypoint"),
false, no_argument),
meshfile(string("--mesh"), string(""), meshfile(string("--mesh"), string(""),
string(""), string(""),
false, requires_argument), false, requires_argument),
lrmask(string("--lrmask"), string(""), lrmask(string("--lrmask"), string(""),
string("low resolution binary brain mask for stroring connectivity distribution in matrix2 mode."), string("low resolution binary brain mask for stroring connectivity distribution in matrix2 mode"),
false, requires_argument), false, requires_argument),
logdir(string("--dir"), string(""), logdir(string("--dir"), string(""),
string("Directory to put the final volumes in - code makes this directory"), string("Directory to put the final volumes in - code makes this directory"),
...@@ -206,6 +210,7 @@ class probtrackxOptions { ...@@ -206,6 +210,7 @@ class probtrackxOptions {
options.add(skipmask); options.add(skipmask);
options.add(mask2); options.add(mask2);
options.add(waypoints); options.add(waypoints);
options.add(waypoints_and);
options.add(meshfile); options.add(meshfile);
options.add(lrmask); options.add(lrmask);
options.add(seedref); options.add(seedref);
......
...@@ -94,6 +94,7 @@ namespace TRACT{ ...@@ -94,6 +94,7 @@ namespace TRACT{
m_part.change_xyz(x,y,z); m_part.change_xyz(x,y,z);
int partlength=0; int partlength=0;
bool rubbish_passed=false; bool rubbish_passed=false;
bool stop_flag=false;
//NB - this only goes in one direction!! //NB - this only goes in one direction!!
for(unsigned int pf=0;pf<m_passed_flags.size();pf++) { for(unsigned int pf=0;pf<m_passed_flags.size();pf++) {
m_passed_flags[pf]=false; /// only keep it if this streamline went through all the masks m_passed_flags[pf]=false; /// only keep it if this streamline went through all the masks
...@@ -150,9 +151,10 @@ namespace TRACT{ ...@@ -150,9 +151,10 @@ namespace TRACT{
} }
if(opts.stopfile.value()!=""){ if(opts.stopfile.value()!=""){
if(m_stop(x_s,y_s,z_s)!=0){ if(m_stop(x_s,y_s,z_s)!=0){
m_path.pop_back(); stop_flag=true;
break;
} }
else
if(stop_flag)break;
} }
......
...@@ -360,12 +360,12 @@ public: ...@@ -360,12 +360,12 @@ public:
mean_fsamples_out.push_back(m_mean_fsamples[f]); mean_fsamples_out.push_back(m_mean_fsamples[f]);
Log& logger = LogSingleton::getInstance(); Log& logger = LogSingleton::getInstance();
tmp.setmatrix(m_dsamples,mask); //tmp.setmatrix(m_dsamples,mask);
save_volume4D(tmp,logger.appendDir("dsamples")); //save_volume4D(tmp,logger.appendDir("dsamples"));
tmp.setmatrix(m_S0samples,mask); //tmp.setmatrix(m_S0samples,mask);
save_volume4D(tmp,logger.appendDir("S0samples")); //save_volume4D(tmp,logger.appendDir("S0samples"));
tmp.setmatrix(m_lik_energy,mask); //tmp.setmatrix(m_lik_energy,mask);
save_volume4D(tmp,logger.appendDir("lik_energy")); //save_volume4D(tmp,logger.appendDir("lik_energy"));
//Sort the output based on mean_fsamples //Sort the output based on mean_fsamples
// //
......
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