Skip to content

Expose the Dask write grid for image regions - #294

Closed
Henrik-KM wants to merge 1 commit into
BioVisionCenter:mainfrom
Henrik-KM:feat/public-dask-write-grid
Closed

Henrik-KM wants to merge 1 commit into
BioVisionCenter:mainfrom
Henrik-KM:feat/public-dask-write-grid

Conversation

@Henrik-KM

Copy link
Copy Markdown

Closes #278.

Image.write_grid(roi) returns the same per-axis block lengths that the Dask writer uses for that ROI. It uses the write pipe's ROI conversion and clipping and the existing chunk/shard planner, including the current block-size settings. Calling Image.write_grid() plans the full image. The images guide shows how to pass the returned grid to a lazy source in array order.

Interior block edges lie on write-unit boundaries in Zarr coordinates. Each block is one Dask write task.

Verification

  • All three new cases failed on upstream because the public method was unavailable. They now pass, including writes to a chunked image and a sharded image with a fractional, offset ROI that extends beyond the array. The patch uses the same grid at da.store and the complete written array matches the expected pixels.
  • 452 Dask I/O, pipe, and image tests passed in the locked Pixi development environment.
  • The repository lint task and the locked type check passed.

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md.

OpenAI Codex prepared, implemented, and tested this change.

@lorenzocerrone

Copy link
Copy Markdown
Collaborator

Hi @Henrik-KM, thanks for the interest in ngio.

I'm closing this along with #293–#296, for the same reason: the linked issues don't have an agreed solution yet, and the new-API ones in particular need a design discussion before a PR can be reviewed.

If you'd like to contribute, please propose the approach on the issue first, and open a PR once there's agreement on the direction.

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.

Expose the unit-aligned dask write grid (write_grid) for consumers

2 participants