[WIP] Multiscale GraphArrayView - #341
Draft
TeunHuijben wants to merge 6 commits into
Draft
TeunHuijben wants to merge 6 commits into
TeunHuijben wants to merge 6 commits into
Conversation
Contributor
Author
|
Note: this PR builds upon #340, for practical reasons in downstream applications. |
Member
|
If I recall correctly, @yfukai had something similar, I might already have this implemented somewhere |
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
downscaleparameter that reduces both. Painting samples themask 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/scaleproperties, forwarddownscaleanddtypethrough to_napari_format, and complete its overloads, whichpreviously omitted three existing parameters.
I was unaware of #175, will check the overlap