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
33a09260
Commit
33a09260
authored
3 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF: Ignore calcRange if loadData=False (fsl/fslpy#374). New ImageWrapper
propertk to check load state
parent
2b304a8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/image.py
+7
-3
7 additions, 3 deletions
fsl/data/image.py
fsl/data/imagewrapper.py
+8
-0
8 additions, 0 deletions
fsl/data/imagewrapper.py
with
15 additions
and
3 deletions
fsl/data/image.py
+
7
−
3
View file @
33a09260
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
fsl/data/imagewrapper.py
+
8
−
0
View file @
33a09260
...
...
@@ -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``.
...
...
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