get_wsireader

get_wsireader(input_img)[source]

Return an appropriate WSIReader object.

Parameters
  • (str (input_img) – obj:WSIReader): Input to create a WSI object from. Supported types of input are: str and pathlib.Path which point to the location on the disk where image is stored, numpy.ndarray in which the input image in the form of numpy array (HxWxC) is stored, or :obj:WSIReader which is an already created tiatoolbox WSI handler. In the latter case, the function directly passes the input_imge to the output.

  • pathlib.Path – obj:WSIReader): Input to create a WSI object from. Supported types of input are: str and pathlib.Path which point to the location on the disk where image is stored, numpy.ndarray in which the input image in the form of numpy array (HxWxC) is stored, or :obj:WSIReader which is an already created tiatoolbox WSI handler. In the latter case, the function directly passes the input_imge to the output.

:param numpy.ndarray: obj:WSIReader):

Input to create a WSI object from. Supported types of input are: str and pathlib.Path which point to the location on the disk where image is stored, numpy.ndarray in which the input image in the form of numpy array (HxWxC) is stored, or :obj:WSIReader which is an already created tiatoolbox WSI handler. In the latter case, the function directly passes the input_imge to the output.

Parameters

or – obj:WSIReader): Input to create a WSI object from. Supported types of input are: str and pathlib.Path which point to the location on the disk where image is stored, numpy.ndarray in which the input image in the form of numpy array (HxWxC) is stored, or :obj:WSIReader which is an already created tiatoolbox WSI handler. In the latter case, the function directly passes the input_imge to the output.

Returns

an object with base WSIReader as base class.

Return type

WSIReader

Examples

>>> from tiatoolbox.wsicore.wsireader import get_wsireader
>>> wsi = get_wsireader(input_img="./sample.svs")