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
7b6144d2
Commit
7b6144d2
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Little bugfixes to Notifier and Image classes.
parent
1e8c9315
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/data/image.py
+3
-2
3 additions, 2 deletions
fsl/data/image.py
fsl/utils/notifier.py
+1
-1
1 addition, 1 deletion
fsl/utils/notifier.py
with
4 additions
and
3 deletions
fsl/data/image.py
+
3
−
2
View file @
7b6144d2
...
@@ -384,6 +384,7 @@ class Image(Nifti1, notifier.Notifier):
...
@@ -384,6 +384,7 @@ class Image(Nifti1, notifier.Notifier):
nibImage
=
None
nibImage
=
None
dataSource
=
None
dataSource
=
None
fileobj
=
None
# The image parameter may be the name of an image file
# The image parameter may be the name of an image file
if
isinstance
(
image
,
six
.
string_types
):
if
isinstance
(
image
,
six
.
string_types
):
...
@@ -413,13 +414,12 @@ class Image(Nifti1, notifier.Notifier):
...
@@ -413,13 +414,12 @@ class Image(Nifti1, notifier.Notifier):
fmap
[
'
image
'
].
fileobj
=
fobj
fmap
[
'
image
'
].
fileobj
=
fobj
nibImage
=
nib
.
Nifti1Image
.
from_file_map
(
fmap
)
nibImage
=
nib
.
Nifti1Image
.
from_file_map
(
fmap
)
self
.
__
fileobj
=
fobj
fileobj
=
fobj
# Otherwise we let nibabel
# Otherwise we let nibabel
# manage the file reference(s)
# manage the file reference(s)
else
:
else
:
nibImage
=
nib
.
load
(
image
)
nibImage
=
nib
.
load
(
image
)
self
.
__fileobj
=
None
dataSource
=
image
dataSource
=
image
...
@@ -460,6 +460,7 @@ class Image(Nifti1, notifier.Notifier):
...
@@ -460,6 +460,7 @@ class Image(Nifti1, notifier.Notifier):
self
.
name
=
name
self
.
name
=
name
self
.
__dataSource
=
dataSource
self
.
__dataSource
=
dataSource
self
.
__fileobj
=
fileobj
self
.
__nibImage
=
nibImage
self
.
__nibImage
=
nibImage
self
.
__saveState
=
dataSource
is
not
None
self
.
__saveState
=
dataSource
is
not
None
self
.
__suppressDataRange
=
False
self
.
__suppressDataRange
=
False
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/notifier.py
+
1
−
1
View file @
7b6144d2
...
@@ -94,7 +94,7 @@ class Notifier(object):
...
@@ -94,7 +94,7 @@ class Notifier(object):
if
listeners
is
None
:
if
listeners
is
None
:
return
return
callback
,
_
=
listeners
.
pop
(
name
,
None
)
callback
,
_
=
listeners
.
pop
(
name
,
(
None
,
None
)
)
# Silently absorb invalid names - the
# Silently absorb invalid names - the
# notify function may have removed gc'd
# notify function may have removed gc'd
...
...
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