Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
fslpy
Commits
195cb21f
Commit
195cb21f
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: Hook to get the raw output, for testing
parent
af378e58
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
fsl/wrappers/fslstats.py
+9
-2
9 additions, 2 deletions
fsl/wrappers/fslstats.py
with
9 additions
and
2 deletions
fsl/wrappers/fslstats.py
+
9
−
2
View file @
195cb21f
...
...
@@ -194,10 +194,13 @@ class fslstats(object):
return
self
def
run
(
self
):
def
run
(
self
,
raw
=
False
):
"""
Run the ``fslstats`` command-line tool. See :meth:`__init__` for a
description of the return value.
:arg raw: Defaults to ``False``. If ``True``, the raw standard output
and error is returned, instead of a scalar/numpy array.
:returns: Result of ``fslstats`` as a scalar or ``numpy`` array.
"""
...
...
@@ -210,7 +213,11 @@ class fslstats(object):
# is to tee the command output streams
# to the calling process streams. We
# can disable this via log=None.
result
=
self
.
__run
(
'
fslstats
'
,
*
self
.
__options
,
log
=
None
)
result
=
self
.
__run
(
'
fslstats
'
,
*
self
.
__options
,
log
=
None
)
if
raw
:
return
result
.
stdout
result
=
np
.
genfromtxt
(
io
.
StringIO
(
result
.
stdout
[
0
].
strip
()))
sepvols
=
'
-t
'
in
self
.
__options
lblmask
=
'
-K
'
in
self
.
__options
...
...
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