wsidata.reader.BioFormatsReader#

class BioFormatsReader(file, memorize=False, **kwargs)#

Bases: ReaderBase

Use Bio-Formats to interface with image files.

Depends on scyjava

Parameters:
filestr or Path

Path to image file on disk

create_reader()#

Create the reader

This function should be implemented in the subclass

  1. create the reader

  2. 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

  1. Close the reader

  2. use set_reader to set the reader to None

  3. 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