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

Zarr Tile Sink: Generate Downsampled Levels #1490

Merged
merged 27 commits into from
Apr 5, 2024
Merged

Zarr Tile Sink: Generate Downsampled Levels #1490

merged 27 commits into from
Apr 5, 2024

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Mar 29, 2024

Resolves #1466

This PR adds a new file to large_image.tilesource called resample.py. This new file contains an enum called ResampleMethod and the implementations for using each resample method to downsample a tile to half resolution. This file includes a function downsampleTileHalfRes to perform this downsampling given a tile and a resample method.

This PR updates the ZarrFileTileSource to use the downsampleTileHalfRes function in a new class function _generateDownsampledLevels. These updates include changes to addTile and the cropping method used in write.

This PR also adds tests to confirm the shapes of the generated downsampled levels.

test/test_sink.py Outdated Show resolved Hide resolved
@annehaley annehaley marked this pull request as ready for review April 4, 2024 17:21
test/test_sink.py Outdated Show resolved Hide resolved
Copy link
Member

@manthey manthey left a comment

Choose a reason for hiding this comment

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

I made one comment about testing odd sized tiles, but otherwise this looks good.

@manthey
Copy link
Member

manthey commented Apr 5, 2024

I made one comment about testing odd sized tiles, but otherwise this looks good.

Great. Merge away.

@annehaley annehaley merged commit ef47fe8 into master Apr 5, 2024
16 checks passed
@annehaley annehaley deleted the downsample branch April 5, 2024 19:53
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.

Tile sink output options (lower resolution tiles)
2 participants