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

Unintuitive read_region for levels #52

Open
jxu opened this issue Jul 6, 2019 · 3 comments
Open

Unintuitive read_region for levels #52

jxu opened this issue Jul 6, 2019 · 3 comments

Comments

@jxu
Copy link

jxu commented Jul 6, 2019

Context

Issue type (bug report or feature request): Feature request
Operating system (e.g. Fedora 24, Mac OS 10.11, Windows 10): RHEL 7.6
Platform (e.g. 64-bit x86, 32-bit ARM): x86_64
OpenSlide Python version (openslide.__version__): 1.1.1
OpenSlide version (openslide.__library_version__): 3.4.1
Slide format (e.g. SVS, NDPI, MRXS): SVS

Details

For read_region in non-0 level I've found out that location is relative to level 0 image (stated in docs) but size is relative to level image. The docs say

Unlike in the C interface, the image data is not premultiplied.

but this should be clarified.

@VincePlantItAi
Copy link

VincePlantItAi commented Jul 21, 2021

has anyone provided a solution for this? it's quite unintuitive.
If the admins/managers of openslide-python allow me and give simple example to make things clear,
I could totally fix it (python-side only) myself.

def read_region(<originalparams>):
# do some simple location and size calcuation here before passing to openslide lib
return user_desired_image

@bgilbert
Copy link
Member

Premultiplied refers to the pixel data, not the boundaries of the region. We match the OpenSlide API here: location is in level 0 and size is the actual size of the region we're reading.

@VincePlantItAi
Copy link

thank you @bgilbert for your reply.

So the main point behind your response is, the original openslide API should be matched, so we cannot change the python wrapper for OpenSlide into its own.

Did I get you correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants