Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fdt
Commits
202f4db9
Commit
202f4db9
authored
12 years ago
by
Matthew Webster
Browse files
Options
Downloads
Patches
Plain Diff
removed
parent
b74bdd07
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
my_bedpostx
+0
-184
0 additions, 184 deletions
my_bedpostx
my_bedpostx_single_slice.sh
+0
-19
0 additions, 19 deletions
my_bedpostx_single_slice.sh
with
0 additions
and
203 deletions
my_bedpostx
deleted
100755 → 0
+
0
−
184
View file @
b74bdd07
#!/bin/sh
# Copyright (C) 2004 University of Oxford
#
# SHCOPYRIGHT
if
[
"x
$SGE_ROOT
"
=
"x"
]
;
then
if
[
-f
/usr/local/share/sge/default/common/settings.sh
]
;
then
.
/usr/local/share/sge/default/common/settings.sh
elif
[
-f
/usr/local/sge/default/common/settings.sh
]
;
then
.
/usr/local/sge/default/common/settings.sh
fi
fi
Usage
()
{
echo
""
echo
"Usage: bedpostx <subject directory> [options]"
echo
""
echo
"expects to find bvals and bvecs in subject directory"
echo
"expects to find data and nodif_brain_mask in subject directory"
echo
"options:"
echo
"-n (number of fibres per voxel, default 2)"
echo
"-w (ARD weight, more weight means less fibres killed per voxel, default 1)"
echo
"-b (burnin period, default 1000)"
echo
"-j (number of jumps, default 1250)"
echo
"-s (sample every, default 25)"
echo
""
exit
1
}
make_absolute
(){
dir
=
$1
;
if
[
-d
${
dir
}
]
;
then
OLDWD
=
`
pwd
`
cd
${
dir
}
dir_all
=
`
pwd
`
cd
$OLDWD
else
dir_all
=
${
dir
}
fi
echo
${
dir_all
}
}
[
"
$1
"
=
""
]
&&
Usage
subjdir
=
`
make_absolute
$1
`
subjdir
=
`
echo
$subjdir
|
sed
's/\/$/$/g'
`
echo
subjectdir is
$subjdir
#parse option arguments
nfibres
=
2
fudge
=
1
burnin
=
1000
njumps
=
1250
sampleevery
=
25
while
[
!
-z
"
$2
"
]
do
case
"
$2
"
in
-n
)
nfibres
=
$3
;
shift
;;
-w
)
fudge
=
$3
;
shift
;;
-b
)
burnin
=
$3
;
shift
;;
-j
)
njumps
=
$3
;
shift
;;
-s
)
sampleevery
=
$3
;
shift
;;
*
)
break
;;
esac
shift
done
#check that all required files exist
if
[
!
-d
$subjdir
]
;
then
echo
"subject directory
$1
not found"
exit
1
fi
if
[
!
-e
${
subjdir
}
/bvecs
]
;
then
echo
"
${
subjdir
}
/bvecs not found"
exit
1
fi
if
[
!
-e
${
subjdir
}
/bvals
]
;
then
echo
"
${
subjdir
}
/bvals not found"
exit
1
fi
if
[
`
${
FSLDIR
}
/bin/imtest
${
subjdir
}
/data
`
-eq
0
]
;
then
echo
"
${
subjdir
}
/data not found"
exit
1
fi
if
[
`
${
FSLDIR
}
/bin/imtest
${
subjdir
}
/nodif_brain_mask
`
-eq
0
]
;
then
echo
"
${
subjdir
}
/nodif_brain_mask not found"
exit
1
fi
echo
Making bedpostx directory structure
mkdir
-p
${
subjdir
}
.bedpostX/
mkdir
-p
${
subjdir
}
.bedpostX/diff_slices
mkdir
-p
${
subjdir
}
.bedpostX/logs
mkdir
-p
${
subjdir
}
.bedpostX/logs/pid_
${
$}
mkdir -p
${
subjdir
}
.bedpostX/xfms
mailto=
`
whoami
`
@fmrib.ox.ac.uk
echo Queuing preprocessing stages
preprocid=
`
${
FSLDIR
}
/bin/fsl_sub
-T
60
-m
as
-N
bpx_preproc
-l
${
subjdir
}
.bedpostX/logs
${
FSLDIR
}
/bin/bedpostx_preproc.sh
${
subjdir
}
`
echo Queuing parallel processing stage
nslices=
`
${
FSLDIR
}
/bin/fslval
${
subjdir
}
/data dim3
`
[ -f
${
subjdir
}
.bedpostX/commands.txt ] && rm
${
subjdir
}
.bedpostX/commands.txt
if [
"x
$SGE_ROOT
"
=
"x"
]; then
#
# Need to set off a backgrounded monitoring task
#
cat <<EOM >
${
subjdir
}
.bedpostX/monitor
#!/bin/sh
finished=0
logdir=
${
subjdir
}
.bedpostX/logs
while [ \
$finished
-eq 0 ] ; do
nfin=0
if [ -f \
$logdir
/bedpostx.o*.1 ] ; then
nfin=\
`
cat
\$
logdir/bedpostx.o
*
|
\
grep
Done |
wc
-w
|
awk
'{print \$1}'
\`
fi
if
[
\$
nfin
-eq
$nslices
]
;
then
finished
=
1
fi
echo
"
\$
nfin slices processed"
sleep
600
;
done
EOM
chmod
+x
${
subjdir
}
.bedpostX/monitor
${
subjdir
}
.bedpostX/monitor&
monitorpid
=
$!
fi
slice
=
0
while
[
$slice
-le
$nslices
]
do
echo
"
${
FSLDIR
}
/bin/my_bedpostx_single_slice.sh
$subjdir
$nfibres
$fudge
$burnin
$njumps
$sampleevery
$slice
"
\
>>
${
subjdir
}
.bedpostX/commands.txt
slice
=
$((
$slice
+
1
))
done
bedpostid
=
`
${
FSLDIR
}
/bin/fsl_sub -j
$preprocid
-l
${
subjdir
}
.bedpostX/logs -M
$mailto
-N bedpostx -t
${
subjdir
}
.bedpostX/commands.txt
`
[
"x
$SGE_ROOT
"
=
"x"
]
&&
kill
$monitorpid
echo
Queuing post processing stage
mergeid
=
`
${
FSLDIR
}
/bin/fsl_sub -j
$bedpostid
-T 60 -m as -N bpx_postproc -l
${
subjdir
}
.bedpostX/logs
${
FSLDIR
}
/bin/bedpostx_postproc.sh
$subjdir
`
if
[
"x
$SGE_ROOT
"
!=
"x"
]
;
then
echo
echo
Type
${
subjdir
}
.bedpostX/monitor to show progress.
cat
<<
EOM
>
${
subjdir
}
.bedpostX/monitor
#!/bin/sh
finished=0
logdir=
${
subjdir
}
.bedpostX/logs
while [
\$
finished -eq 0 ] ; do
nfin=0
if [ -f
\$
logdir/bedpostx.o
$bedpostid
.1 ] ; then
nfin=
\`
cat
\$
logdir/bedpostx.o
$bedpostid
.* |
\
grep Done | wc -w | awk '{print
\$
1}'
\`
fi
if [
\$
nfin -eq
$nslices
] ; then
finished=1
fi
echo "
\$
nfin slices processed"
sleep 600;
done
EOM
chmod
+x
${
subjdir
}
.bedpostX/monitor
echo
Type
${
subjdir
}
.bedpostX/cancel to terminate all the queued tasks.
cat
<<
EOC
>
${
subjdir
}
.bedpostX/cancel
#!/bin/sh
qdel
$mergeid
$bedpostid
$preprocid
EOC
chmod
+x
${
subjdir
}
.bedpostX/cancel
echo
echo
You will get an email at the end of the post-processing stage.
echo
fi
This diff is collapsed.
Click to expand it.
my_bedpostx_single_slice.sh
deleted
100755 → 0
+
0
−
19
View file @
b74bdd07
#!/bin/sh
subjdir
=
$1
nfibres
=
$2
fudge
=
$3
bi
=
$4
njumps
=
$5
sampleevery
=
$6
slice
=
$7
slicezp
=
`
${
FSLDIR
}
/bin/zeropad
$slice
4
`
${
FSLDIR
}
/bin/xfibres
\
--data
=
$subjdir
/data_slice_
$slicezp
\
--mask
=
$subjdir
/nodif_brain_mask_slice_
$slicezp
\
-b
$subjdir
/bvals
-r
$subjdir
/bvecs
\
--forcedir
--logdir
=
$subjdir
.bedpostX/diff_slices/data_slice_
$slicezp
\
--fudge
=
$fudge
--nj
=
$njumps
--bi
=
$bi
--se
=
$sampleevery
--upe
=
24
--nfibres
=
$nfibres
--allard
>
$subjdir
.bedpostX/logs/log
$slicezp
&&
echo
Done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment