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
Christoph Arthofer
fslpy
Commits
57348825
Commit
57348825
authored
Dec 07, 2020
by
Paul McCarthy
🚵
Browse files
Merge branch 'evan-patch-smooth' into 'master'
ENH: add fslmaths simple smoothing See merge request fsl/fslpy!271
parents
990f1d94
75ed6335
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/wrappers/fslmaths.py
View file @
57348825
...
...
@@ -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 @
57348825
...
...
@@ -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