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
c7fe1d5d
Commit
c7fe1d5d
authored
3 years ago
by
Christoph Arthofer
Browse files
Options
Downloads
Patches
Plain Diff
Added kernel and fmeanu options to fslmaths
parent
31a53f4b
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
+10
-0
10 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
13 additions
and
2 deletions
fsl/wrappers/fslmaths.py
+
10
−
0
View file @
c7fe1d5d
...
...
@@ -163,6 +163,16 @@ class fslmaths(object):
self
.
__args
.
extend
((
"
-bptf
"
,
hp_sigma
,
lp_sigma
))
return
self
def
kernel
(
self
,
kernel
=
'
3D
'
):
"""
2D or (default) 3D kernel
"""
self
.
__args
.
extend
((
"
-kernel
"
,
kernel
))
return
self
def
fmeanu
(
self
):
"""
Mean filtering, kernel weighted, un-normalised (gives edge effects)
"""
self
.
__args
.
append
(
"
-fmeanu
"
)
return
self
def
run
(
self
,
output
=
None
):
"""
Save output of operations to image. Set ``output`` to a filename to have
the result saved to file, or omit ``output`` entirely to have the
...
...
This diff is collapsed.
Click to expand it.
tests/test_wrappers/test_wrappers.py
+
3
−
2
View file @
c7fe1d5d
...
...
@@ -291,14 +291,15 @@ def test_fslmaths():
.
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
)
\
.
smooth
(
sigma
=
6
).
run
(
'
output
'
)
.
smooth
(
sigma
=
6
).
kernel
(
'
3D
'
).
fmeanu
().
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
'
,
'
-s 6
'
,
'
output
'
]
'
-inm inmim
'
,
'
-bptf 1 10
'
,
'
-s 6
'
,
'
-kernel 3D
'
,
'
-fmeanu
'
,
'
output
'
]
expected
=
'
'
.
join
(
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