Skip to content
Snippets Groups Projects
Commit 463c0009 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: only show renderable parc

parent ae9d2dd2
No related branches found
No related tags found
No related merge requests found
...@@ -231,7 +231,24 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}" ...@@ -231,7 +231,24 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}"
parcs$, parcs$,
]).pipe( ]).pipe(
map(([ templateSpaces, parcellations ]) => { map(([ templateSpaces, parcellations ]) => {
return { templateSpaces, parcellations } /**
* select only parcellations that contain renderable volume(s)
*/
const filteredParcellations = parcellations.filter(p => {
for (const spaceKey in p.volumeSrc) {
for (const hemisphereKey in p.volumeSrc[spaceKey]) {
if (p.volumeSrc[spaceKey][hemisphereKey].some(vol => vol.volume_type === 'neuroglancer/precomputed')) return true
if (p.volumeSrc[spaceKey][hemisphereKey].some(vol => vol.volume_type === 'neuroglancer/precompmesh')) return true
if (p.volumeSrc[spaceKey][hemisphereKey].some(vol => vol.volume_type === 'threesurfer/gii')) return true
if (p.volumeSrc[spaceKey][hemisphereKey].some(vol => vol.volume_type === 'threesurfer/gii-label')) return true
}
}
return false
})
return {
templateSpaces,
parcellations: filteredParcellations
}
}), }),
shareReplay(1) shareReplay(1)
) )
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment