Skip to content

One _echo_finished and added TransformFunction Protocol#328

Draft
srivarra wants to merge 2 commits into
zarr3-devfrom
ome-zarr-review-updates
Draft

One _echo_finished and added TransformFunction Protocol#328
srivarra wants to merge 2 commits into
zarr3-devfrom
ome-zarr-review-updates

Conversation

@srivarra
Copy link
Copy Markdown
Collaborator

@srivarra srivarra commented Sep 8, 2025

  • one echo finished, and added protocol for Transform for NDArrays

@srivarra srivarra linked an issue Sep 8, 2025 that may be closed by this pull request
@srivarra srivarra changed the base branch from main to zarr3-dev September 8, 2025 22:06
Comment thread iohub/ngff/utils.py
Comment on lines +179 to +185

Returns
-------
NDArray
Transformed data with same shape as input.

Examples
Copy link
Copy Markdown
Contributor

@ziw-liu ziw-liu Sep 8, 2025

Choose a reason for hiding this comment

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

Not sure if I understand this. Are these examples of functions that are compatible with the protocols?

Copy link
Copy Markdown
Collaborator Author

@srivarra srivarra Sep 8, 2025

Choose a reason for hiding this comment

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

Yup, exactly.

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.

But these functions will throw an error when input_time_index is given as an argument.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh I see that now, what about something like this?

def gaussian_blur(data: NDArray, input_time_index: None | int, **kwargs) -> NDArray:
	from skimage.filters import gaussian
	if input_time_index:
		data = data[input_time_index,...]
	return gaussian(data, **kwargs)

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.

You can test this by running it as a concrete parametrized test case.

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.

OME-Zarr v0.5 (Zarr v3) Review Updates

3 participants