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
cd965ad0
Commit
cd965ad0
authored
20 years ago
by
Rita Nunes
Browse files
Options
Downloads
Patches
Plain Diff
made changes to account for nii.gz image format
parent
369000db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
regscript
+31
-24
31 additions, 24 deletions
regscript
with
31 additions
and
24 deletions
regscript
+
31
−
24
View file @
cd965ad0
...
@@ -120,29 +120,37 @@ cp ~dtiuser/etc/dof3 .
...
@@ -120,29 +120,37 @@ cp ~dtiuser/etc/dof3 .
#Load FID files
#Load FID files
if
[
-e
${
nodiffid
}
.fid
]
;
then
if
[
-e
${
nodiffid
}
.fid
]
;
then
echo
Loading nodif
echo
Loading nodif
load_varian
$nodiffid
$output_dir
/nodif
-auto
-float
-buo
-egrv
$option
load_varian
$nodiffid
$output_dir
/nodif
-auto
-float
-buo
-egrv
$option
else
else
echo
$nodiffid
.fid: FID not found
echo
$nodiffid
.fid: FID not found
exit
;
exit
;
fi
fi
nvols_nodif
=
`
avwval
$output_dir
/nodif dim4
`
;
avwsplit nodif
if
[
-e
vol0002.nii.gz
]
;
then
if
[
$
nvols_nodif
-gt
1
]
;
then
nvols_nodif
=
2
echo
nodif has
$nvols_nodif
volume
s
- file name will be changed to data
echo
nodif has
more than 1
volume - file name will be changed to data
echo
first volume will be saved as nodif
echo
first volume will be saved as nodif
mv
nodif.hdr dti1.hdr
if
[
-e
nodif.hdr
]
;
then
mv
nodif.img dti1.img
mv
nodif.hdr dti1.hdr
avwsplit dti1
mv
nodif.img dti1.img
mv
vol0000.hdr nodif.hdr
mv
vol0000.nii.gz nodif.nii.gz
mv
vol0000.img nodif.img
rm
vol
*
-f
rm
vol
*
-f
else
mv
nodif.nii.gz dti1.nii.gz
avwsplit dti1.nii.gz
mv
vol0000.nii.gz nodif.nii.gz
rm
nodif.hdr nodif.img
-f
rm
vol
*
-f
fi
count
=
1
count
=
1
image_numb
=
2
image_numb
=
2
scan_numb
=
2
scan_numb
=
2
else
else
mv
vol0000.nii.gz nodif.nii.gz
rm
nodif.hdr nodif.img
-f
count
=
0
count
=
0
image_numb
=
1
image_numb
=
1
scan_numb
=
2
scan_numb
=
2
...
@@ -151,7 +159,7 @@ fi
...
@@ -151,7 +159,7 @@ fi
while
[
$count
-lt
$number_acqs
]
;
do
while
[
$count
-lt
$number_acqs
]
;
do
if
[
-e
${
dtifid
}${
scan_numb
}
.fid
]
;
then
if
[
-e
${
dtifid
}${
scan_numb
}
.fid
]
;
then
echo
Loading dti
${
image_numb
}
echo
Loading dti
${
image_numb
}
load_varian
${
dtifid
}${
scan_numb
}
.fid
${
output_dir
}
/dti
${
image_numb
}
-auto
-float
-buo
-egrv
$option
load_varian
${
dtifid
}${
scan_numb
}
.fid
${
output_dir
}
/dti
${
image_numb
}
-auto
-float
-buo
-egrv
$option
else
else
echo
${
dtifid
}${
image_numb
}
.fid: file not found
echo
${
dtifid
}${
image_numb
}
.fid: file not found
exit
;
exit
;
...
@@ -207,7 +215,9 @@ case $correc
...
@@ -207,7 +215,9 @@ case $correc
flirt
-in
vol000
$count
-ref
nodif
-out
rvol000
$count
-nosearch
-omat
matrices/mat
flirt
-in
vol000
$count
-ref
nodif
-out
rvol000
$count
-nosearch
-omat
matrices/mat
avscale matrices/mat vol000
$count
>
matrices/tmp
avscale matrices/mat vol000
$count
>
matrices/tmp
head
-4
matrices/tmp |
tail
-3
>
matrices/MAT000
${
count
}${
tmp_acqs
}
head
-4
matrices/tmp |
tail
-3
>
matrices/MAT000
${
count
}${
tmp_acqs
}
rm
vol000
${
count
}
.nii.gz
-f
count
=
`
expr
$count
+ 1
`
;
count
=
`
expr
$count
+ 1
`
;
done
done
while
[
${
count
}
!=
${
nvols
}
]
;
do
while
[
${
count
}
!=
${
nvols
}
]
;
do
echo
FLIRT on volume
${
count
}
echo
FLIRT on volume
${
count
}
...
@@ -216,7 +226,8 @@ case $correc
...
@@ -216,7 +226,8 @@ case $correc
head
-4
matrices/tmp |
tail
-3
>
matrices/MAT00
${
count
}${
tmp_acqs
}
head
-4
matrices/tmp |
tail
-3
>
matrices/MAT00
${
count
}${
tmp_acqs
}
rm
-f
matrices/mat
rm
-f
matrices/mat
rm
-f
matrices/tmp
rm
-f
matrices/tmp
count
=
`
expr
$count
+ 1
`
;
rm
vol000
${
count
}
.nii.gz
-f
count
=
`
expr
$count
+ 1
`
;
done
done
fi
fi
#Clean up unecessary files
#Clean up unecessary files
...
@@ -226,10 +237,10 @@ case $correc
...
@@ -226,10 +237,10 @@ case $correc
if
[
$number_acqs
-eq
1
]
if
[
$number_acqs
-eq
1
]
then
then
echo
creating file: data
echo
creating file: data
avwmerge
-t
data rvol00
*
.hdr
avwmerge
-t
data rvol00
*
else
else
echo
creating file: data
${
tmp_acqs
}
echo
creating file: data
${
tmp_acqs
}
avwmerge
-t
data
${
tmp_acqs
}
rvol00
*
.hdr
avwmerge
-t
data
${
tmp_acqs
}
rvol00
*
fi
fi
#Clean up unecessary files
#Clean up unecessary files
...
@@ -272,10 +283,10 @@ case $correc
...
@@ -272,10 +283,10 @@ case $correc
if
[
$number_acqs
-eq
1
]
if
[
$number_acqs
-eq
1
]
then
then
echo
creating file: data
echo
creating file: data
avwmerge
-t
data rvol00
*
.hdr
avwmerge
-t
data rvol00
*
else
else
echo
creating file: data
${
tmp_acqs
}
echo
creating file: data
${
tmp_acqs
}
avwmerge
-t
data
${
tmp_acqs
}
rvol00
*
.hdr
avwmerge
-t
data
${
tmp_acqs
}
rvol00
*
fi
fi
#Clean up unecessary files
#Clean up unecessary files
...
@@ -290,14 +301,10 @@ esac
...
@@ -290,14 +301,10 @@ esac
#Brain Extraction
#Brain Extraction
echo
BE
echo
BE
bet nodif mask
-f
0.025
-m
bet nodif mask
-f
0.025
-m
mv
mask_mask.nii.gz nodif_brain_mask.nii.gz
rm
mask.hdr
-f
rm
mask.
*
-f
rm
mask.img
-f
mv
mask_mask.hdr nodif_brain_mask.hdr
mv
mask_mask.img nodif_brain_mask.img
rm
dof3
-f
rm
dof3
-f
#Copy relevant bvals and bvecs file
#Copy relevant bvals and bvecs file
n_vols
=
`
echo
$nvols
`
;
n_vols
=
`
echo
$nvols
`
;
...
...
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