wsidata.reader.OpenSlideReader#
- class OpenSlideReader(file, **kwargs)#
Bases:
ReaderBaseUse OpenSlide to interface with image files.
Depends on openslide-python which wraps the openslide C library.
- Parameters:
- filestr or Path
Path to image file on disk
- property associated_images#
The associated images in a key-value pair
- create_reader()#
Create the reader
This function should be implemented in the subclass
create the reader
use set_reader to set the reader
- detach_reader()#
Detach the reader
This function will be called when the object is deleted or sent to other process
Please implement this function in the subclass
Close the reader
use set_reader to set the reader to None
Clean up any resources that are not python-managed
- get_region(x, y, width, height, level=0, **kwargs)#
Get a region from image with top-left corner.
x, y are always in level 0 coordinates. width, height are at the specified pyramid level.
This should return a numpy array in yxc format.
- get_thumbnail(size, **kwargs)#
Get a thumbnail of the image