Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
misc_scripts
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
misc_scripts
Commits
03b7cb37
Commit
03b7cb37
authored
20 years ago
by
Rita Nunes
Browse files
Options
Downloads
Patches
Plain Diff
changed the script to be compatible with any image format
parent
72e1bab0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
remove_vols
+15
-23
15 additions, 23 deletions
remove_vols
with
15 additions
and
23 deletions
remove_vols
+
15
−
23
View file @
03b7cb37
...
...
@@ -21,7 +21,7 @@ input_file=$1
output_file
=
$2
current_dir
=
`
pwd
`
if
[
!
-e
$input_file
.hdr
]
;
then
if
[
!
`
imtest
$input_file
`
]
;
then
echo
Cant find
$input_file
exit
fi
...
...
@@ -36,7 +36,7 @@ if [ ! -e bvecs ]; then
exit
fi
avwsplit
$input_file
.hdr
avwsplit
$input_file
vol
=
0
num_vols
=
`
expr
$#
- 2
`
...
...
@@ -51,39 +51,31 @@ while [ $vol -lt $num_vols ]; do
v
=
$3
shift
if
[
-e
vol000
${
v
}
.hdr
]
;
then
rm
vol000
${
v
}
.hdr
-f
rm
vol000
${
v
}
.img
-f
if
[
`
imtest vol000
${
v
}
`
]
;
then
imrm vol000
${
v
}
fi
if
[
-e
vol00
${
v
}
.hdr
]
;
then
rm
vol00
${
v
}
.hdr
-f
rm
vol00
${
v
}
.img
-f
if
[
`
imtest vol00
${
v
}
`
]
;
then
imrm vol00
${
v
}
fi
echo
$v
>
tmp1
cat
dodgy_vols tmp1
>
tmp2
cat
tmp2
>
dodgy_vols
rm
tmp
*
-f
vol
=
`
expr
$vol
+ 1
`
done
echo
"addpath('/usr/people/dtiuser/etc/FMRIB_bvals_bvecs/')"
>
tmp3
echo
"remove_vols('
$current_dir
')"
>
tmp4
cat
tmp3 tmp4
>
tmp.m
cat
tmp.m | matlab
rm
tmp
*
-f
echo
Removing dodgy volumes from bvals and bvecs
matlab
-nodisplay
-nojvm
-nosplash
1> matlab.out1 2>&1
<<
EOF
addpath('/usr/people/dtiuser/etc/FMRIB_bvals_bvecs/');
remove_vols('
$current_dir
');
exit
EOF
rm
matlab.out1
-f
echo
"Merging Volumes"
avwmerge
-t
$output_file
vol
*
.hdr
avwmerge
-t
$output_file
`
$FSLDIR
/bin/imglob
-oneperimage
vol
*
`
rm
vol
*
-f
rm
dodgy_vols
-f
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