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
ef9ce000
Commit
ef9ce000
authored
Aug 03, 2021
by
Paul McCarthy
🚵
Browse files
Merge branch 'enh/fslmaths' into 'master'
Enh/fslmaths See merge request fsl/fslpy!304
parents
31a53f4b
4f7d2f77
Changes
4
Hide whitespace changes
Inline
Side-by-side
AUTHOR
View file @
ef9ce000
...
...
@@ -4,4 +4,5 @@ Matthew Webster <matthew.webster@ndcn.ox.ac.uk>
Sean Fitzgibbon <sean.fitzgibbon@ndcn.ox.ac.uk>
Martin Craig <martin.craig@eng.ox.ac.uk>
Taylor Hanayik <taylor.hanayik@ndcn.ox.ac.uk>
Evan Edmond <evan.edmond@ndcn.ox.ac.uk>
\ No newline at end of file
Evan Edmond <evan.edmond@ndcn.ox.ac.uk>
Christoph Arthofer <christoph.arthofer@ndcn.oxc.ac.uk>
\ No newline at end of file
CHANGELOG.rst
View file @
ef9ce000
...
...
@@ -2,6 +2,17 @@ This document contains the ``fslpy`` release history in reverse chronological
order.
3.6.4 (Tuesday 3rd August 2021)
-------------------------------
Added
^^^^^
* New :meth:`.fslmaths.kernel` and :meth:`.fslmaths.fmeanu` options on the
:class:`.fslmaths` wrapper (!304).
3.6.3 (Wednesday 28th July 2021)
--------------------------------
...
...
fsl/wrappers/fslmaths.py
View file @
ef9ce000
...
...
@@ -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
...
...
tests/test_wrappers/test_wrappers.py
View file @
ef9ce000
...
...
@@ -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
...
...
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