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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
79cf2dc7
Commit
79cf2dc7
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
New ProxyImage class, to represent derived images. This may change.
parent
796cafd8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/image.py
+31
-2
31 additions, 2 deletions
fsl/data/image.py
with
31 additions
and
2 deletions
fsl/data/image.py
+
31
−
2
View file @
79cf2dc7
...
...
@@ -5,8 +5,9 @@
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""
This module provides the :class:`Image` class, for representing 3D/4D NIFTI1
images. The ``nibabel`` package is used for file I/O.
"""
This module provides the :class:`Nifti1` and :class:`Image` classes, for
representing 3D/4D NIFTI1 images. The ``nibabel`` package is used for file
I/O.
.. note:: Currently, only NIFTI1 images are supported.
...
...
@@ -570,6 +571,34 @@ class Image(Nifti1, props.HasProperties):
self
.
dataSource
,
newMin
,
newMax
))
return
newMin
,
newMax
class
ProxyImage
(
Image
):
"""
The ``ProxyImage`` class is a simple wrapper around an :class:`Image`
instance. It is intended to be used to represent images or data which
are derived from another image.
"""
def
__init__
(
self
,
base
,
*
args
,
**
kwargs
):
"""
Create a ``ProxyImage``.
:arg base: The :class:`Image` instance upon which this ``ProxyImage``
is based.
"""
if
not
isinstance
(
base
,
Image
):
raise
ValueError
(
'
Base image must be an Image instance
'
)
self
.
__base
=
base
kwargs
[
'
header
'
]
=
base
.
nibImage
.
get_header
()
Image
.
__init__
(
self
,
base
.
data
,
*
args
,
**
kwargs
)
def
getBase
(
self
):
"""
Returns the base :class:`Image` of this ``ProxyImage``.
"""
return
self
.
__base
# TODO The wx.FileDialog does not
...
...
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