Skip to content

[WIP] Multiscale GraphArrayView - #341

Draft
TeunHuijben wants to merge 6 commits into
royerlab:mainfrom
TeunHuijben:multiscale
Draft

TeunHuijben wants to merge 6 commits into
royerlab:mainfrom
TeunHuijben:multiscale

Conversation

@TeunHuijben

Copy link
Copy Markdown
Contributor

Add spatial downscaling to GraphArrayView

Rendering large 3D+t graphs in napari materialized full-resolution
volumes: NDChunkCache allocates one whole-volume buffer per timepoint
(~16 GB/frame at 500x2000x2000 int64), and _fill_array painted every
mask at full resolution.

Add a downscale parameter that reduces both. Painting samples the
mask on a strided view anchored to the global output grid, so cost
scales with nnz/f^ndim rather than nnz, and neighboring objects always
sample the same phase. Objects thinner than the factor get a single
voxel at their bbox center so they stay visible and selectable.

Measured on 40 objects of 60k voxels in 64x512x512: 5.9x faster and
16x smaller at downscale=(1, 4, 4), 6.2x/32x with dtype=np.uint32.

Also expose downscale/scale properties, forward downscale and
dtype through to_napari_format, and complete its overloads, which
previously omitted three existing parameters.

I was unaware of #175, will check the overlap

@TeunHuijben TeunHuijben changed the title [WIP] Multiscale [WIP] Multiscale GraphArrayView Sep 16, 2026
@TeunHuijben

Copy link
Copy Markdown
Contributor Author

Note: this PR builds upon #340, for practical reasons in downstream applications.

@JoOkuma

JoOkuma commented Sep 18, 2026

Copy link
Copy Markdown
Member

If I recall correctly, @yfukai had something similar, I might already have this implemented somewhere

@TeunHuijben

Copy link
Copy Markdown
Contributor Author

Hi @JoOkuma, correct, I found that after implementing 😅, it is #340. However, that one was quite behind on API. This PR uses exactly the same logic, but fully up to date. Sorry for the duplication...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants