Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-python-mirror
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Apps
siibra
siibra-python-mirror
Commits
f35c8bef
Commit
f35c8bef
authored
2 years ago
by
Timo Dickscheid
Browse files
Options
Downloads
Patches
Plain Diff
cleanup neuroglancer mesh fetching code
parent
df981a5f
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
siibra/volumes/neuroglancer.py
+7
-4
7 additions, 4 deletions
siibra/volumes/neuroglancer.py
test/features/test_voi.py
+0
-4
0 additions, 4 deletions
test/features/test_voi.py
with
7 additions
and
8 deletions
siibra/volumes/neuroglancer.py
+
7
−
4
View file @
f35c8bef
...
...
@@ -574,29 +574,32 @@ class NeuroglancerMesh(volume.VolumeProvider, srctype="neuroglancer/precompmesh"
# extract fragment information for the requested mesh
fragment_infos
=
self
.
_get_fragment_info
(
label_i
)
fragments
.
extend
(
fragment_infos
.
keys
())
if
fragment
is
None
:
# no fragment specified, return merged fragment meshes
if
len
(
fragment_infos
)
==
0
:
raise
RuntimeError
(
f
"
Invalid label
'
{
label_i
}
'
for mesh fetching.
"
)
else
:
for
url
,
transform
in
fragment_infos
.
value
s
():
for
name
,
(
url
,
transform
)
in
fragment_infos
.
item
s
():
mesh
=
self
.
_fetch_fragment
(
url
,
transform
)
mesh
[
'
labels
'
]
=
np
.
array
([
label_i
for
_
in
mesh
[
'
verts
'
]])
meshes
.
append
(
mesh
)
fragments
.
append
(
name
)
else
:
# match fragment to available fragments
matched
=
[
info
for
name
,
info
in
fragment_infos
.
items
()
(
name
,
url
,
transform
)
for
name
,
(
url
,
transform
)
in
fragment_infos
.
items
()
if
fragment
.
lower
()
in
name
]
if
len
(
matched
)
==
1
:
url
,
transform
=
next
(
iter
(
matched
))
name
,
url
,
transform
=
next
(
iter
(
matched
))
mesh
=
self
.
_fetch_fragment
(
url
,
transform
)
mesh
[
'
labels
'
]
=
np
.
array
([
label_i
for
_
in
mesh
[
'
verts
'
]])
meshes
.
append
(
mesh
)
fragments
.
append
(
name
)
else
:
raise
ValueError
(
f
"
The requested mesh fragment name
'
{
fragment
}
'
could not be resolved.
"
...
...
This diff is collapsed.
Click to expand it.
test/features/test_voi.py
+
0
−
4
View file @
f35c8bef
import
pytest
import
numpy
as
np
import
siibra
...
...
@@ -22,5 +20,3 @@ def test_pli_volume_transform():
==
"
https://neuroglancer.humanbrainproject.eu/precomputed/data-repo/HSV-FOM
"
for
p
in
feat
.
_providers
.
values
()
),
"
Expect RGB PLI volume to be present
"
This diff is collapsed.
Click to expand it.
Preview
0%
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