wsidata.reader.SpatialDataImage2DReader#

class SpatialDataImage2DReader(img, key=None, **kwargs)#

Bases: ReaderBase

A wrapper around spatialdata to interface with image files.

Parameters:
img: Image2DModle
property associated_images#

The associated images in a key-value pair

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