-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add resolution level to data access #6
Conversation
CI won't pass until this other PR in bioio-base is merged and released bioio-devs/bioio-base#10 |
bioio_ome_zarr/reader.py
Outdated
def _read_delayed(self) -> xr.DataArray: | ||
return self._xarr_format(delayed=True) | ||
|
||
def _read_immediate(self) -> xr.DataArray: | ||
return self._xarr_format(delayed=False) | ||
|
||
def _xarr_format(self, delayed: bool) -> xr.DataArray: | ||
image_data = self._zarr.load(str(self.current_scene_index)) | ||
data_path = self._zarr.root_attrs["multiscales"][self.current_scene_index]["datasets"][self.current_resolution_level]["path"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: maybe check that the level is valid before indexing into datasets here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm do you think that is necessary with set_current_resolution_level()
checking to see if it is valid at set time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Link to Relevant Issue
This pull request resolves #7
Description of Changes
This adds support for getting and setting resolution levels
Testing
Tested successfully locally with changes from the required partner PR here