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
189f769d
Commit
189f769d
authored
20 years ago
by
Tim Behrens
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
c21d48a3
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
correct_and_average
+69
-0
69 additions, 0 deletions
correct_and_average
ocmr_preproc
+43
-0
43 additions, 0 deletions
ocmr_preproc
with
112 additions
and
0 deletions
correct_and_average
0 → 100755
+
69
−
0
View file @
189f769d
#!/bin/sh
usage
()
{
echo
"Usage :
$0
<big4D dataset> <avg file>"
echo
""
echo
" This script assumes that there are 3"
echo
" separate averages of 0, 29, 0, 31, 0, 0, 0 b-values"
echo
" You need to also run Make_bvecs in matlab"
echo
" <artefactfile> is optional"
exit
1
}
[
$#
-lt
2
]
&&
usage
data
=
`
remove_ext
${
1
}
`
;
if
[
`
imtest
$data
`
-eq
0
]
;
then
echo
"Cannot find image called
$1
"
;
exit
fi
avgfile
=
$2
;
if
[
!
-e
$avgfile
]
;
then
echo
" Cannot find
$2
"
exit
fi
numlines
=
`
cat
$avgfile
|grep
-v
'^ *$'
|wc
-l
`
;
numavgs
=
`
expr
$numlines
- 1
`
;
scans_per_avg
=
`
cat
$avgfile
|sed
's/, *$/ /g'
|sed
's/[^,]/ /g'
|sed
-n
'1p'
|wc
-w
`
;
scans_per_avg
=
`
expr
$scans_per_avg
+ 1
`
b0_numbers
=
`
cat
$avgfile
|grep
-v
'^ *$'
|sed
-n
"
${
numlines
}
p"
`
;
ab0
=
`
echo
$b0_numbers
|awk
'{print \$1}'
`
eddy_correct
${
1
}
${
$}
${
1
}
_b0_correct
$ab0
total_vols=
`
avwval
$1
dim4
`
;
vols_per_avg=
`
echo
"10k
$total_vols
$numavgs
/ p"
|dc -
`
;
avwroi
${
1
}
data 0
${
vols_per_avg
}
;
avwmaths data -mul 0 data;
avg=1;scan=1;
while [
${
avg
}
-le
${
numavgs
}
]; do
scan=1
#echo
${
scan
}
${
scans_per_avg
}
while [
${
scan
}
-le
${
scans_per_avg
}
]; do
tmp=
`
cat
$avgfile
|sed
-n
"
${
avg
}
p"
|awk
-F
,
"{ print
\\
$$
scan }"
`
;
echo
$avg
$scan
$tmp
$vols_per_avg
avwroi
${
$}
${
1
}
_b0_correct
${
$}avg_
${
avg
}
_scan_
${
scan
}
$tmp
;
scan=
`
expr
$scan
+ 1
`
;
done
avwmerge -t
${
$}avg_
${
avg
}
_all
`
imglob
-oneperimage
${
$}avg_
${
avg
}
_scan_
*
`
add4d data
${
$}avg_
${
avg
}
_all
data;
avg=
`
expr
$avg
+ 1
`
;
done
avwmaths data -div
${
numavgs
}
data;
rm
${
$}
*
This diff is collapsed.
Click to expand it.
ocmr_preproc
0 → 100755
+
43
−
0
View file @
189f769d
#!/bin/sh
usage
()
{
echo
"Usage :ocmr_preproc <number of slices per volume>"
echo
""
exit
1
}
[
$#
-lt
1
]
&&
usage
nep
=
`
echo
*
ep2d_
*
|wc
-w
`
nlp
=
`
echo
*
lp2d_
*
|wc
-w
`
if
[
$nep
-gt
1
]
;
then
avwmerge
-t
big4D
`
imglob
-oneperimage
images_?_
*
ep2d_
*
images_??_
*
ep2d_
*
`
elif
[
$nlp
-gt
1
]
;
then
avwmerge
-t
big4D
`
imglob
-oneperimage
images_?_
*
lp2d_
*
images_??_
*
lp2d_
*
`
fi
#nslices=${1}
#zsize=`avwval big4D dim3`
#tsize=`avwval big4D dim4`
#tpts=`echo "10k $zsize $nslices /p "|dc -`
#afterdot=`echo $tpts | awk -F . '{print \$2}'`
#foo=`echo $afterdot|grep [123456798]`
#if [ ! "$foo" = "" ]; then
# echo "wrong number of slices somewhere - exiting"
# exit 1
#fi
#tpts=`echo "$tpts \* $tsize" |bc"'
#xsize=`avwval big4D dim1`
#ysize=`avwval big4D dim2`
#xvoxsize=`avwval big4D pixdim1`
#yvoxsize=`avwval big4D pixdim2`
#zvoxsize=`avwval big4D pixdim3`
#datatype=`avwval big4D datatype`
#avwcreatehd $xsize $ysize $nslices $tpts $xvoxsize $yvoxsize $zvoxsize 0 0 0 0# $datatype big4D
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