FsspecJsonWSIReader¶

class FsspecJsonWSIReader(input_img, mpp=None, power=None, cache_size=268435456)[source]¶

Reader for fsspec zarr JSON generated by: tiatoolbox/utils/tiff_to_fsspec.py.

The fsspec zarr JSON file represents a SVS or TIFF file that be accessed using byte range HTTP API.

All the information on the chunk locations in the SVS or TIFF file is outlined as byte-ranges in the JSON. This ensures that the reader requests only chunks that are needed to display requested tiles, rather than the entire SVS or TIFF file.

Initialize FsspecJsonWSIReader.

Methods

is_valid_zarr_fsspec

Check if the input path is a valid Zarr fsspec JSON file.

read_bounds

See TIFFWSIReaderDelegate.read_bounds docs for details.

read_rect

See TIFFWSIReaderDelegate.read_rect docs for details.

Attributes

Parameters:
  • input_img (str | Path | np.ndarray)

  • mpp (tuple[Number, Number] | None)

  • power (Number | None)

  • cache_size (int)

static is_valid_zarr_fsspec(file_path)[source]¶

Check if the input path is a valid Zarr fsspec JSON file.

Checks if the file_path is a valid Zarr fsspec JSON file generated by: tiatoolbox/utils/tiff_to_fsspec.py

Parameters:

file_path (str) – str Path to the file to check.

Returns:

True if the file is a valid Zarr fsspec JSON file

Return type:

bool

read_bounds(bounds, resolution=0, units='level', interpolation='optimize', pad_mode='constant', pad_constant_values=0, coord_space='baseline', **kwargs)[source]¶

See TIFFWSIReaderDelegate.read_bounds docs for details.

Parameters:
  • self (FsspecJsonWSIReader)

  • bounds (IntBounds)

  • resolution (Resolution)

  • units (Units)

  • interpolation (str)

  • pad_mode (str)

  • pad_constant_values (int | IntPair)

  • coord_space (str)

  • kwargs (dict)

Return type:

np.ndarray

read_rect(location, size, resolution=0, units='level', interpolation='optimize', pad_mode='constant', pad_constant_values=0, coord_space='baseline', **kwargs)[source]¶

See TIFFWSIReaderDelegate.read_rect docs for details.

Parameters:
  • self (FsspecJsonWSIReader)

  • location (IntPair)

  • size (IntPair)

  • resolution (Resolution)

  • units (Units)

  • interpolation (str)

  • pad_mode (str)

  • pad_constant_values (int | IntPair)

  • coord_space (str)

  • kwargs (dict)

Return type:

np.ndarray