Skip to content

feat: add ND2 reader and OME-Zarr converter - #436

Merged
srivarra merged 6 commits into
mainfrom
feat/convert-osprey
Jul 15, 2026
Merged

srivarra merged 6 commits into
mainfrom
feat/convert-osprey

Conversation

@srivarra

@srivarra srivarra commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Adds support for nd2 / osprey.

Todos:

  • Example Dataset as a part of CI

Will do some housekeeping after to generalize the MicroManagerFOV + MicroManagerFOVMapping class in a separate pr.

Wrap nd2.ND2File as an iohub reader (ND2Dataset/ND2FOV) and route
.nd2 paths through read_images and TIFFConverter. Each stage position
maps to one FOV; data is returned in canonical TCZYX with native dtype
preserved (no downcast, no axis swaps). Supports OME-NGFF v0.4 and v0.5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@srivarra srivarra linked an issue Jul 7, 2026 that may be closed by this pull request
nd2.to_xarray returns axes in native, non-canonical order (e.g. Z
before C for multichannel z-stacks). The round-trip comparison now
transposes the expected array to canonical TCZYX by label instead of
assuming order, so it holds for any axis combination rather than only
single-non-singleton-axis files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread tests/test_nd2.py Resolved
srivarra and others added 2 commits July 7, 2026 13:56
Add Nikon ND2 to the README supported-formats list (and Osprey to the
Biohub microscopes line), and document ND2Dataset/ND2FOV in the reader
API reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Regenerate uv.lock after adding nd2 to pyproject; pulls in nd2 and its
transitives (ome-types, xsdata, resource-backed-dask-array). No changes
to existing pins.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@srivarra
srivarra requested a review from jenniferdoherty6 July 7, 2026 21:00
@srivarra

srivarra commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

@jenniferdoherty6 I've tested this on the datasets you've provided, and it seems to work. Let me know how it goes for you.

@srivarra
srivarra requested a review from ieivanov July 7, 2026 21:04

@ieivanov ieivanov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a quick look, looks good I think

srivarra added 2 commits July 15, 2026 14:02
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
Signed-off-by: Sricharan Reddy Varra <sricharan.varra@biohub.org>
@srivarra
srivarra merged commit dc53e96 into main Jul 15, 2026
10 checks passed
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.

Add .nd2 Format Convertor to OME-Zarr

2 participants