Skip to content

bugfix/preserve-xarray-metadata - #236

Open
rpinho wants to merge 1 commit into
bioio-devs:mainfrom
rpinho:fix-xarray-metadata
Open

rpinho wants to merge 1 commit into
bioio-devs:mainfrom
rpinho:fix-xarray-metadata

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown

Link to Relevant Issue

No existing issue.

Description of Changes

Passing an image DataArray to BioImage can replace its metadata with a reference to its own attributes. Read dims_t3c2y32x32.nd2 with BioIO's ND2 reader and pass its xarray_data to a second BioImage. The patch preserves metadata attached to the input and copies plain attributes when a metadata entry is needed. The tests check both inputs and verify that the pixels remain equal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N


assert image.metadata == metadata
assert source.attrs == attrs
np.testing.assert_array_equal(image.get_image_data("YX"), source.values)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Line 28 seems like it test something besides the metadata; cheap and simple enough to keep it though.

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