Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
fslpy
Commits
75ed6335
Commit
75ed6335
authored
Dec 07, 2020
by
Evan Edmond
Committed by
Paul McCarthy
Dec 07, 2020
Browse files
ENH: add fslmaths simple smoothing
parent
990f1d94
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/wrappers/fslmaths.py
View file @
75ed6335
...
...
@@ -105,6 +105,11 @@ class fslmaths(object):
self
.
__args
.
append
(
"-dilF"
)
return
self
def
smooth
(
self
,
sigma
):
"""Spatial smoothing - mean filtering using a gauss kernel of sigma mm"""
self
.
__args
.
extend
((
"-s"
,
sigma
))
return
self
def
add
(
self
,
image
):
"""Add input to current image."""
self
.
__args
.
extend
((
"-add"
,
image
))
...
...
tests/test_wrappers/test_wrappers.py
View file @
75ed6335
...
...
@@ -290,14 +290,15 @@ def test_fslmaths():
.
abs
().
bin
().
binv
().
recip
().
Tmean
().
Tstd
().
Tmin
().
Tmax
()
\
.
fillh
().
ero
().
dilM
().
dilF
().
add
(
'addim'
).
sub
(
'subim'
)
\
.
mul
(
'mulim'
).
div
(
'divim'
).
mas
(
'masim'
).
rem
(
'remim'
)
\
.
thr
(
'thrim'
).
uthr
(
'uthrim'
).
inm
(
'inmim'
).
bptf
(
1
,
10
).
run
(
'output'
)
.
thr
(
'thrim'
).
uthr
(
'uthrim'
).
inm
(
'inmim'
).
bptf
(
1
,
10
)
\
.
smooth
(
sigma
=
6
).
run
(
'output'
)
expected
=
[
cmd
,
'input'
,
'-abs'
,
'-bin'
,
'-binv'
,
'-recip'
,
'-Tmean'
,
'-Tstd'
,
'-Tmin'
,
'-Tmax'
,
'-fillh'
,
'-ero'
,
'-dilM'
,
'-dilF'
,
'-add addim'
,
'-sub subim'
,
'-mul mulim'
,
'-div divim'
,
'-mas masim'
,
'-rem remim'
,
'-thr thrim'
,
'-uthr uthrim'
,
'-inm inmim'
,
'-bptf 1 10'
,
'output'
]
'-inm inmim'
,
'-bptf 1 10'
,
'-s 6'
,
'output'
]
expected
=
' '
.
join
(
expected
)
assert
result
.
stdout
[
0
]
==
expected
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment