Refactor to_imaris() to use intermediate Zarr strategy#175
Draft
Copilot wants to merge 4 commits intocopilot/make-to-imaris-memory-safefrom
Draft
Refactor to_imaris() to use intermediate Zarr strategy#175Copilot wants to merge 4 commits intocopilot/make-to-imaris-memory-safefrom
Copilot wants to merge 4 commits intocopilot/make-to-imaris-memory-safefrom
Conversation
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor to_imaris function for zarr intermediate output
Refactor to_imaris() to use intermediate Zarr strategy
Dec 16, 2025
Member
|
@copilot: one suggestion, when reading from intermediate zarr to write to hdf5, use the .blocks interface instead of grabbing slice indices, so that it is always block-aligned access.. simpler and less error prone |
Refactored to_imaris() to use arr.blocks[block_id] instead of manual slice indices when reading from intermediate Zarr. This provides: - Simpler, less error-prone code - Always block-aligned access - No need to manually calculate slice boundaries Changes: - Statistics computation now uses blocks interface - Data copying uses blocks interface - Thumbnail generation uses blocks interface - Properly handles multi-channel arrays by squeezing channel dimension Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Contributor
Author
Updated to use the
This is simpler and always block-aligned. Committed in e421d14. |
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.
Refactor to_imaris() to use intermediate Zarr strategy ✅
Completed Work - ALL DONE ✅
Summary of Changes
Implementation:
to_imaris()to use 3-step process:to_ome_zarr()(Dask-powered, memory-safe).blocksinterface for simpler, block-aligned accesstmp_dirparameter for custom intermediate file location (default: system temp)ome-zarr-pybackend withcompute=Truefor proper Dask evaluationuse_consolidated=Falseto avoid metadata issuesfinallyblockBenefits:
tmp_dirparameter)Documentation:
tmp_dirparameterTest Results
This refactor successfully implements the requested intermediate Zarr strategy with block-aligned access while maintaining full backward compatibility.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.