From 735cac238ea305391abb1319464940ab2853ae32 Mon Sep 17 00:00:00 2001 From: Akhilesh Halageri Date: Wed, 8 Nov 2023 09:15:58 -0600 Subject: [PATCH] fix: handle skip connection missing lods --- src/neuroglancer/datasource/graphene/backend.ts | 4 ++++ src/neuroglancer/mesh/multiscale.ts | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/neuroglancer/datasource/graphene/backend.ts b/src/neuroglancer/datasource/graphene/backend.ts index b05598b3b..4f84fa977 100644 --- a/src/neuroglancer/datasource/graphene/backend.ts +++ b/src/neuroglancer/datasource/graphene/backend.ts @@ -150,6 +150,10 @@ function decodeMultiscaleManifestChunk(chunk: GrapheneMultiscaleManifestChunk, r clipUpperBound: vec3.clone(response.clipUpperBound), } chunk.fragmentIds = response.fragments; + chunk.manifest.clipLowerBound.fill(0); + chunk.manifest.clipUpperBound.fill(100000); + chunk.manifest.octree[5*(response.fragments.length-1) + 4] &= 0x7FFFFFFF; + chunk.manifest.octree[5*(response.fragments.length-1) + 3] |= 0x80000000; } async function decodeMultiscaleFragmentChunk( diff --git a/src/neuroglancer/mesh/multiscale.ts b/src/neuroglancer/mesh/multiscale.ts index 0cd31b060..64250efbb 100644 --- a/src/neuroglancer/mesh/multiscale.ts +++ b/src/neuroglancer/mesh/multiscale.ts @@ -153,12 +153,13 @@ export function getDesiredMultiscaleMeshChunks( if (priorLodScale === 0 || pixelSize * detailCutoff < priorLodScale) { let lodScale = lodScales[lod]; - if ((childBeginAndVirtual & (1 << 31)) !== 0) { - lodScale = 0; - } - if (lodScale !== 0) { - callback(lod, row, lodScale / pixelSize, (childEndAndEmpty >>> 31)); + const virtual = (childBeginAndVirtual >>> 31); + if (virtual) { + lodScale = 0; + } + const empty = (childEndAndEmpty >>> 31); + callback(lod, row, lodScale / pixelSize, empty | virtual); } if (lod > 0 && (lodScale === 0 || pixelSize * detailCutoff < lodScale)) {