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
b807c79f
Commit
b807c79f
authored
Jul 28, 2021
by
Paul McCarthy
🚵
Browse files
RF: Ignore calcRange if loadData=False (fsl/fslpy#374). New ImageWrapper
propertk to check load state
parent
be49c154
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/data/image.py
View file @
b807c79f
...
...
@@ -1042,7 +1042,8 @@ class Image(Nifti):
calculated immediately (vi a call to
:meth:`calcRange`). Otherwise, the image range is
incrementally updated as more data is read from memory
or disk.
or disk. If ``loadData=False``, ``calcRange`` is also
set to ``False``.
:arg threaded: If ``True``, the :class:`.ImageWrapper` will use a
separate thread for data range calculation. Defaults
...
...
@@ -1065,8 +1066,11 @@ class Image(Nifti):
nibImage
=
None
saved
=
False
if
loadData
:
threaded
=
False
# disable threaded access if loadData is True
threaded
=
threaded
and
(
not
loadData
)
# don't calcRange if not loading data
calcRange
=
calcRange
and
loadData
# Take a copy of the header if one has
# been provided
...
...
fsl/data/imagewrapper.py
View file @
b807c79f
...
...
@@ -388,6 +388,14 @@ class ImageWrapper(notifier.Notifier):
self
.
__data
=
np
.
asanyarray
(
self
.
__image
.
dataobj
)
@
property
def
dataIsLoaded
(
self
):
"""Return true if the image data has been loaded into memory, ``False``
otherwise.
"""
return
self
.
__data
is
not
None
def
__getData
(
self
,
sliceobj
,
isTuple
=
False
):
"""Retrieves the image data at the location specified by ``sliceobj``.
...
...
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