Skip to content

Commit 8d7627a

Browse files
committed
Use the same path trick to make verbena use locally bundled copies
of helper scripts where they exist
1 parent b1a959b commit 8d7627a

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

verbena.in

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#
99
# SHCOPYRIGHT
1010

11+
# Make script use local copies of helper scripts/programs in the same
12+
# directory, if present. This allows for multiple versions of the scripts
13+
# to be used, possibly with bundled dependencies
14+
PATH=`dirname $0`:${FSLDIR}/bin:${PATH}
1115

1216
echo "VERBENA version tag '${GIT_SHA1}'"
1317
echo "last commit '${GIT_DATE}'"
@@ -73,9 +77,9 @@ until [ -z $1 ]; do
7377
done
7478

7579
#### --- Procedural ---
76-
fabber=${FSLDIR}/bin/fabber_dsc
77-
asl_mfree=${FSLDIR}/bin/asl_mfree ###~/cproject/asl_mfree/asl_mfree
78-
mvntool=${FSLDIR}/bin/mvntool
80+
fabber=fabber_dsc
81+
asl_mfree=asl_mfree
82+
mvntool=mvntool
7983

8084
# save the starting directory
8185
stdir=`pwd`
@@ -99,12 +103,12 @@ fi
99103
if [ ! -z $debug ]; then
100104
tempdir=`pwd`/temp
101105
else
102-
tmpbase=`$FSLDIR/bin/tmpnam`
106+
tmpbase=`tmpnam`
103107
tempdir=${tmpbase}_verbena
104108
fi
105109
mkdir $tempdir
106110
# Required for mask generation
107-
imcp $infile $tempdir
111+
imcp $infile $tempdir/data
108112
cd $tempdir
109113

110114
# parameters
@@ -121,7 +125,7 @@ fi
121125
#### --- Pre-processing ---
122126
if [ -z $mask ]; then
123127
# auto generate mask
124-
fslmaths $infile -Tmean datamean
128+
fslmaths data -Tmean datamean
125129
bet datamean brain -m
126130
immv brain_mask mask
127131
else
@@ -167,8 +171,8 @@ if [ ! -z $modelfree ] || [ ! -z $modelfreeinit ]; then
167171
fslmaths modfree_residuals -nan modfree_residuals_nonans
168172

169173
#calculate cbv
170-
fslmaths concdata -Tmean -mul `${FSLDIR}/bin/fslnvols concdata` concsum
171-
fslmaths concaif -Tmean -mul `${FSLDIR}/bin/fslnvols concaif` aifsum
174+
fslmaths concdata -Tmean -mul `fslnvols concdata` concsum
175+
fslmaths concaif -Tmean -mul `fslnvols concaif` aifsum
172176
fslmaths concsum -div aifsum cbv
173177

174178
# calcualte MTT
@@ -241,8 +245,8 @@ if [ -z $modelfree ]; then
241245
echo "Begin VM + MV analysis"
242246

243247
#calculate cbv - used for intitalisation (this is just a model-free calculation)
244-
fslmaths concdata -Tmean -mul `${FSLDIR}/bin/fslnvols concdata` concsum
245-
fslmaths concaif -Tmean -mul `${FSLDIR}/bin/fslnvols concaif` aifsum
248+
fslmaths concdata -Tmean -mul `fslnvols concdata` concsum
249+
fslmaths concaif -Tmean -mul `fslnvols concaif` aifsum
246250
fslmaths concdata -div aifsum cbv
247251

248252
# sort out intial MVN

0 commit comments

Comments
 (0)