Skip to content

Commit

Permalink
fix: handle skip connection missing lods
Browse files Browse the repository at this point in the history
  • Loading branch information
akhileshh committed Nov 8, 2023
1 parent d6dc9b3 commit 735cac2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/neuroglancer/datasource/graphene/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 6 additions & 5 deletions src/neuroglancer/mesh/multiscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 735cac2

Please sign in to comment.