Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyfeeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
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
pyfeeds
Commits
d735f32b
Commit
d735f32b
authored
2 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
BF: Earlier changes broke support for GiftiImage objects
parent
88fa6a17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!34
Restore support for storing Gifti surfaces in ImageCache
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyfeeds/__init__.py
+1
-1
1 addition, 1 deletion
pyfeeds/__init__.py
pyfeeds/evaluate.py
+2
-2
2 additions, 2 deletions
pyfeeds/evaluate.py
pyfeeds/imagecache.py
+3
-6
3 additions, 6 deletions
pyfeeds/imagecache.py
with
6 additions
and
9 deletions
pyfeeds/__init__.py
+
1
−
1
View file @
d735f32b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
#
__version__
=
'
0.12.
0
'
__version__
=
'
0.12.
1
'
"""
The pyfeeds version number.
"""
"""
The pyfeeds version number.
"""
...
...
This diff is collapsed.
Click to expand it.
pyfeeds/evaluate.py
+
2
−
2
View file @
d735f32b
...
@@ -597,8 +597,8 @@ def evalGiftiVertices(pyf, testfile, benchmark):
...
@@ -597,8 +597,8 @@ def evalGiftiVertices(pyf, testfile, benchmark):
function.
function.
"""
"""
surf1
=
pyf
.
imageCache
[
testfile
][
1
]
surf1
=
pyf
.
imageCache
[
testfile
][
0
]
surf2
=
pyf
.
imageCache
[
benchmark
][
1
]
surf2
=
pyf
.
imageCache
[
benchmark
][
0
]
# NIFTI_INTENT_POINTSET == 1008
# NIFTI_INTENT_POINTSET == 1008
verts1
=
[
d
for
d
in
surf1
.
darrays
if
d
.
intent
==
1008
][
0
].
data
verts1
=
[
d
for
d
in
surf1
.
darrays
if
d
.
intent
==
1008
][
0
].
data
...
...
This diff is collapsed.
Click to expand it.
pyfeeds/imagecache.py
+
3
−
6
View file @
d735f32b
...
@@ -88,9 +88,8 @@ class ImageCache:
...
@@ -88,9 +88,8 @@ class ImageCache:
return
image
return
image
image
=
nib
.
load
(
imagefile
)
image
=
nib
.
load
(
imagefile
)
data
=
np
.
asanyarray
(
image
.
dataobj
)
self
[
imagefile
]
=
image
self
[
imagefile
]
=
image
,
data
return
self
[
imagefile
]
return
image
,
data
def
__setitem__
(
self
,
imagefile
,
image
):
def
__setitem__
(
self
,
imagefile
,
image
):
...
@@ -98,12 +97,10 @@ class ImageCache:
...
@@ -98,12 +97,10 @@ class ImageCache:
storing derived, in-memory-only images.
storing derived, in-memory-only images.
"""
"""
# assignments through __getitem__ will
# be an (image, ndarray) tuple
if
isinstance
(
image
,
nib
.
Nifti1Image
):
if
isinstance
(
image
,
nib
.
Nifti1Image
):
data
=
np
.
asanyarray
(
image
.
dataobj
)
data
=
np
.
asanyarray
(
image
.
dataobj
)
else
:
else
:
image
,
data
=
imag
e
data
=
Non
e
# imagefile may not be a valid
# imagefile may not be a valid
# file system path, but we transform
# file system path, but we transform
...
...
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