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
75ed6335
Commit
75ed6335
authored
4 years ago
by
Evan Edmond
Committed by
Paul McCarthy
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add fslmaths simple smoothing
parent
990f1d94
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/wrappers/fslmaths.py
+5
-0
5 additions, 0 deletions
fsl/wrappers/fslmaths.py
tests/test_wrappers/test_wrappers.py
+3
-2
3 additions, 2 deletions
tests/test_wrappers/test_wrappers.py
with
8 additions
and
2 deletions
fsl/wrappers/fslmaths.py
+
5
−
0
View file @
75ed6335
...
@@ -105,6 +105,11 @@ class fslmaths(object):
...
@@ -105,6 +105,11 @@ class fslmaths(object):
self
.
__args
.
append
(
"
-dilF
"
)
self
.
__args
.
append
(
"
-dilF
"
)
return
self
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
):
def
add
(
self
,
image
):
"""
Add input to current image.
"""
"""
Add input to current image.
"""
self
.
__args
.
extend
((
"
-add
"
,
image
))
self
.
__args
.
extend
((
"
-add
"
,
image
))
...
...
This diff is collapsed.
Click to expand it.
tests/test_wrappers/test_wrappers.py
+
3
−
2
View file @
75ed6335
...
@@ -290,14 +290,15 @@ def test_fslmaths():
...
@@ -290,14 +290,15 @@ def test_fslmaths():
.
abs
().
bin
().
binv
().
recip
().
Tmean
().
Tstd
().
Tmin
().
Tmax
()
\
.
abs
().
bin
().
binv
().
recip
().
Tmean
().
Tstd
().
Tmin
().
Tmax
()
\
.
fillh
().
ero
().
dilM
().
dilF
().
add
(
'
addim
'
).
sub
(
'
subim
'
)
\
.
fillh
().
ero
().
dilM
().
dilF
().
add
(
'
addim
'
).
sub
(
'
subim
'
)
\
.
mul
(
'
mulim
'
).
div
(
'
divim
'
).
mas
(
'
masim
'
).
rem
(
'
remim
'
)
\
.
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
'
,
expected
=
[
cmd
,
'
input
'
,
'
-abs
'
,
'
-bin
'
,
'
-binv
'
,
'
-recip
'
,
'
-Tmean
'
,
'
-Tstd
'
,
'
-abs
'
,
'
-bin
'
,
'
-binv
'
,
'
-recip
'
,
'
-Tmean
'
,
'
-Tstd
'
,
'
-Tmin
'
,
'
-Tmax
'
,
'
-fillh
'
,
'
-ero
'
,
'
-dilM
'
,
'
-dilF
'
,
'
-Tmin
'
,
'
-Tmax
'
,
'
-fillh
'
,
'
-ero
'
,
'
-dilM
'
,
'
-dilF
'
,
'
-add addim
'
,
'
-sub subim
'
,
'
-mul mulim
'
,
'
-div divim
'
,
'
-add addim
'
,
'
-sub subim
'
,
'
-mul mulim
'
,
'
-div divim
'
,
'
-mas masim
'
,
'
-rem remim
'
,
'
-thr thrim
'
,
'
-uthr uthrim
'
,
'
-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
)
expected
=
'
'
.
join
(
expected
)
assert
result
.
stdout
[
0
]
==
expected
assert
result
.
stdout
[
0
]
==
expected
...
...
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