Skip to content
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

Merged
merged 4 commits into from
Dec 6, 2023

Conversation

SeanLeRoy
Copy link
Contributor

@SeanLeRoy SeanLeRoy commented Dec 4, 2023

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

@SeanLeRoy SeanLeRoy self-assigned this Dec 4, 2023
@SeanLeRoy SeanLeRoy marked this pull request as ready for review December 5, 2023 05:49
@SeanLeRoy SeanLeRoy requested a review from a team as a code owner December 5, 2023 05:49
@SeanLeRoy
Copy link
Contributor Author

CI won't pass until this other PR in bioio-base is merged and released bioio-devs/bioio-base#10

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"]
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

@toloudis toloudis left a comment

Choose a reason for hiding this comment

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

LGTM

@SeanLeRoy SeanLeRoy merged commit fc14ac0 into main Dec 6, 2023
11 checks passed
@SeanLeRoy SeanLeRoy deleted the feature/add-resolution-level-support branch December 6, 2023 18:26
@SeanLeRoy SeanLeRoy restored the feature/add-resolution-level-support branch December 6, 2023 18:26
@BrianWhitneyAI BrianWhitneyAI deleted the feature/add-resolution-level-support branch December 11, 2024 19:16
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 resolution level support
3 participants