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
2236c0f3
Commit
2236c0f3
authored
1 year ago
by
Taylor Hanayik
Browse files
Options
Downloads
Patches
Plain Diff
move else statement to fix linear reg + bet
parent
6767f0bf
No related branches found
No related tags found
1 merge request
!3
fix fsl_anat nonlinreg failure
Pipeline
#20603
skipped
Stage: fsl-ci-build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl_anat
+37
-33
37 additions, 33 deletions
fsl_anat
with
37 additions
and
33 deletions
fsl_anat
+
37
−
33
View file @
2236c0f3
...
...
@@ -471,40 +471,44 @@ fi
#### REGISTRATION AND BRAIN EXTRACTION
# required input: ${T1}_biascorr
# output: ${T1}_biascorr_brain ${T1}_biascorr_brain_mask ${T1}_to_MNI_lin ${T1}_to_MNI [plus transforms, inverse transforms, jacobians, etc.]
if
[
$do_reg
=
yes
]
;
then
if
[
$do_bet
!=
yes
]
;
then
echo
"Skipping registration, as it requires a non-brain-extracted input image"
else
date
;
echo
"Registering to standard space (linear)"
flirtargs
=
"
$flirtargs
$nosearch
"
if
[
$use_lesionmask
=
yes
]
;
then
flirtargs
=
"
$flirtargs
-inweight lesionmaskinv"
;
fi
run
$FSLDIR
/bin/flirt
-interp
spline
-dof
12
-in
${
T1
}
_biascorr
-ref
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm
-dof
12
-omat
${
T1
}
_to_MNI_lin.mat
-out
${
T1
}
_to_MNI_lin
$flirtargs
if
[
$do_nonlinreg
=
yes
]
;
then
date
;
echo
"Registering to standard space (non-linear)"
#refmask=$FSLDIR/data/standard/MNI152_${T1}_2mm_brain_mask_dil1
refmask
=
MNI152_
${
T1
}
_2mm_brain_mask_dil1
fnirtargs
=
""
if
[
$use_lesionmask
=
yes
]
;
then
fnirtargs
=
"
$fnirtargs
--inmask=lesionmaskinv"
;
fi
run
$FSLDIR
/bin/fslmaths
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm_brain_mask
-fillh
-dilF
$refmask
run
$FSLDIR
/bin/fnirt
--in
=
${
T1
}
_biascorr
--ref
=
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm
--fout
=
${
T1
}
_to_MNI_nonlin_field
--jout
=
${
T1
}
_to_MNI_nonlin_jac
--iout
=
${
T1
}
_to_MNI_nonlin
--logout
=
${
T1
}
_to_MNI_nonlin.txt
--cout
=
${
T1
}
_to_MNI_nonlin_coeff
--config
=
$FSLDIR
/etc/flirtsch/
${
T1
}
_2_MNI152_2mm.cnf
--aff
=
${
T1
}
_to_MNI_lin.mat
--refmask
=
$refmask
$fnirtargs
date
;
echo
"Performing brain extraction (using FNIRT)"
run
$FSLDIR
/bin/invwarp
--ref
=
${
T1
}
_biascorr
-w
${
T1
}
_to_MNI_nonlin_coeff
-o
MNI_to_
${
T1
}
_nonlin_field
run
$FSLDIR
/bin/applywarp
--interp
=
nn
--in
=
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm_brain_mask
--ref
=
${
T1
}
_biascorr
-w
MNI_to_
${
T1
}
_nonlin_field
-o
${
T1
}
_biascorr_brain_mask
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr_brain_mask
-fillh
${
T1
}
_biascorr_brain_mask
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr
-mas
${
T1
}
_biascorr_brain_mask
${
T1
}
_biascorr_brain
if
[
$do_reg
=
yes
]
;
then
if
[
$do_bet
!=
yes
]
;
then
echo
"Skipping registration, as it requires a non-brain-extracted input image"
else
date
echo
"Registering to standard space (linear)"
flirtargs
=
"
$flirtargs
$nosearch
"
if
[
$use_lesionmask
=
yes
]
;
then
flirtargs
=
"
$flirtargs
-inweight lesionmaskinv"
;
fi
run
$FSLDIR
/bin/flirt
-interp
spline
-dof
12
-in
${
T1
}
_biascorr
-ref
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm
-dof
12
-omat
${
T1
}
_to_MNI_lin.mat
-out
${
T1
}
_to_MNI_lin
$flirtargs
if
[
$do_nonlinreg
=
yes
]
;
then
date
echo
"Registering to standard space (non-linear)"
#refmask=$FSLDIR/data/standard/MNI152_${T1}_2mm_brain_mask_dil1
refmask
=
MNI152_
${
T1
}
_2mm_brain_mask_dil1
fnirtargs
=
""
if
[
$use_lesionmask
=
yes
]
;
then
fnirtargs
=
"
$fnirtargs
--inmask=lesionmaskinv"
;
fi
run
$FSLDIR
/bin/fslmaths
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm_brain_mask
-fillh
-dilF
$refmask
run
$FSLDIR
/bin/fnirt
--in
=
${
T1
}
_biascorr
--ref
=
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm
--fout
=
${
T1
}
_to_MNI_nonlin_field
--jout
=
${
T1
}
_to_MNI_nonlin_jac
--iout
=
${
T1
}
_to_MNI_nonlin
--logout
=
${
T1
}
_to_MNI_nonlin.txt
--cout
=
${
T1
}
_to_MNI_nonlin_coeff
--config
=
$FSLDIR
/etc/flirtsch/
${
T1
}
_2_MNI152_2mm.cnf
--aff
=
${
T1
}
_to_MNI_lin.mat
--refmask
=
$refmask
$fnirtargs
date
echo
"Performing brain extraction (using FNIRT)"
run
$FSLDIR
/bin/invwarp
--ref
=
${
T1
}
_biascorr
-w
${
T1
}
_to_MNI_nonlin_coeff
-o
MNI_to_
${
T1
}
_nonlin_field
run
$FSLDIR
/bin/applywarp
--interp
=
nn
--in
=
$FSLDIR
/data/standard/MNI152_
${
T1
}
_2mm_brain_mask
--ref
=
${
T1
}
_biascorr
-w
MNI_to_
${
T1
}
_nonlin_field
-o
${
T1
}
_biascorr_brain_mask
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr_brain_mask
-fillh
${
T1
}
_biascorr_brain_mask
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr
-mas
${
T1
}
_biascorr_brain_mask
${
T1
}
_biascorr_brain
else
if
[
$do_bet
=
yes
]
;
then
date
echo
"Performing brain extraction (using BET)"
run
$FSLDIR
/bin/bet
${
T1
}
_biascorr
${
T1
}
_biascorr_brain
-m
$betopts
## results sensitive to the f parameter
else
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr
${
T1
}
_biascorr_brain
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr_brain
-bin
${
T1
}
_biascorr_brain_mask
fi
fi
## In the future, could check the initial ROI extraction here
fi
## In the future, could check the initial ROI extraction here
fi
else
if
[
$do_bet
=
yes
]
;
then
date
;
echo
"Performing brain extraction (using BET)"
run
$FSLDIR
/bin/bet
${
T1
}
_biascorr
${
T1
}
_biascorr_brain
-m
$betopts
## results sensitive to the f parameter
else
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr
${
T1
}
_biascorr_brain
run
$FSLDIR
/bin/fslmaths
${
T1
}
_biascorr_brain
-bin
${
T1
}
_biascorr_brain_mask
fi
fi
...
...
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