Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
27fb3a8b
Commit
27fb3a8b
authored
4 years ago
by
Evan Edmond
Committed by
Paul McCarthy
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Wrappers for tbss scripts
parent
ded1c5af
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
fsl/wrappers/tbss.py
+90
-0
90 additions, 0 deletions
fsl/wrappers/tbss.py
with
90 additions
and
0 deletions
fsl/wrappers/tbss.py
0 → 100755
+
90
−
0
View file @
27fb3a8b
#!/usr/bin/env python3
#
# tbss.py - Wrappers for FSL command-line tools for tract based spatial statistics (TBSS).
#
# Author: Evan Edmond <eedmond@gmail.com>
#
"""
This module contains wrapper functions for various `FSL
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/>`_ command-line tools.
"""
import
os
import
fsl.utils.assertions
as
asrt
from
.
import
wrapperutils
as
wutils
@wutils.fslwrapper
def
preproc
(
*
images
,
**
kwargs
):
"""
Wrapper for the ``tbss_1_preproc`` command.
Usage: tbss_1_preproc(<image1>, <image2>, ...)
"""
for
img
in
images
:
asrt
.
assertIsNifti
(
img
)
return
[
"
tbss_1_preproc
"
]
+
images
@wutils.fslwrapper
def
reg
(
**
kwargs
):
"""
Wrapper for the ``tbss_2_reg`` command.
Refer to the ``tbss_2_reg`` command-line help for details on all arguments.
"""
valmap
=
{
'
T
'
:
wutils
.
SHOW_IF_TRUE
,
'
t
'
:
wutils
.
SHOW_IF_TRUE
,
'
n
'
:
wutils
.
SHOW_IF_TRUE
,
}
cmd
=
[
"
tbss_2_reg
"
]
cmd
+=
wutils
.
applyArgStyle
(
"
-
"
,
valmap
=
valmap
,
valsep
=
"
"
,
**
kwargs
)
return
cmd
@wutils.fslwrapper
def
postreg
(
**
kwargs
):
"""
Wrapper for the ``tbss_3_postreg`` command.
Refer to the ``tbss_3_postreg`` command-line help for details on all arguments.
"""
valmap
=
{
'
T
'
:
wutils
.
SHOW_IF_TRUE
,
'
S
'
:
wutils
.
SHOW_IF_TRUE
,
}
cmd
=
[
"
tbss_3_postreg
"
]
cmd
+=
wutils
.
applyArgStyle
(
"
-
"
,
valmap
=
valmap
,
**
kwargs
)
return
cmd
@wutils.fslwrapper
def
prestats
(
threshold
,
**
kwargs
):
"""
Wrapper for the ``tbss_4_prestats`` command.
The normal recommendation for <threshold> is 0.2
"""
return
[
"
tbss_4_prestats
"
,
threshold
]
@wutils.fslwrapper
def
non_FA
(
alt_img_root
,
**
kwargs
):
"""
Wrapper for the ``tbss_non_FA`` command.
e.g.: tbss_non_FA(
"
L2
"
)
"""
return
[
"
tbss_non_FA
"
,
alt_img_root
]
@wutils.fileOrImage
(
"
stats_image
"
,
"
mean_FA
"
,
"
output
"
)
@wutils.fslwrapper
def
fill
(
stats_image
,
threshold
,
mean_FA
,
output
,
**
kwargs
):
"""
Wrapper for the ``tbss_fill`` command.
Refer to the ``tbss_fill`` command-line help for details on all arguments.
"""
valmap
=
{
'
n
'
:
wutils
.
SHOW_IF_TRUE
,
}
cmd
=
[
"
tbss_fill
"
,
stats_image
,
threshold
,
mean_FA
,
output
]
cmd
+=
wutils
.
applyArgStyle
(
"
-
"
,
valmap
=
valmap
,
**
kwargs
)
return
cmd
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