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

Store original image downsample in LabeledImageServer #27

Merged
merged 8 commits into from
Nov 8, 2024

Conversation

alanocallaghan
Copy link
Contributor

@alanocallaghan alanocallaghan commented Nov 4, 2024

Continuation of changes discussed in #25

Previously all labeledservers had downsample of 1, meaning they effectively lost any concept of the original image's resolution. This lead to an inconvenient API for the most common use cases (matched use of similar labelled and original images).

This means that running

ls = LabeledImageServer(original_server.metadata, features, downsample=2)
ls.read_region(downsample=1)

will now return an image of the size of original_server, rather than downsampled by 2.

It also seems to mean that region requests are resized to the labeledserver's downsampled coordinate space, without needing to run region.downsample_region() on every request.

@alanocallaghan alanocallaghan marked this pull request as ready for review November 7, 2024 10:21
@alanocallaghan
Copy link
Contributor Author

Worth checking the tests I changed/added :)

Copy link
Contributor

@Rylern Rylern left a comment

Choose a reason for hiding this comment

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

I think it would be great if you could add a comment regarding how the new downsample behaviour works (in the docstring of the LabeledImageServer class or in its constructor). Just something to say the LabeledImageServer has the same size as the original server and level 0 can have a downsample > 1

@alanocallaghan
Copy link
Contributor Author

Great point, thanks! I will also make this clear in the notebooks before merging

@alanocallaghan
Copy link
Contributor Author

Can you have a quick look over the comment/s and see if it's clear?

Copy link
Contributor

@Rylern Rylern left a comment

Choose a reason for hiding this comment

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

It's clear, thanks

@alanocallaghan alanocallaghan merged commit 64670cf into qupath:main Nov 8, 2024
3 checks passed
@alanocallaghan alanocallaghan deleted the scaling branch November 8, 2024 15:33
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