Skip to main content
Factory for WSI reader instantiation with automatic backend selection. Provides the WSI convenience class that selects the best available backend (CuCIM, OpenSlide, TiffSlide) based on the file extension and installed libraries.

get_extension

def get_extension(path: str) -> str
Extract and normalize file extension from a path.
path
str
required
File path or filename string.
returns
str
Lowercase file extension including the leading dot.

WSI

class WSI()
Factory class for creating WSI readers with automatic backend selection. Usage:
>>> reader = WSI("slide.svs", backend=WSI.Backend.AUTO)
>>> reader = WSI("slide.svs", backend=WSI.Backend.OPENSLIDE)

Backend

class Backend(str, Enum)
Supported backend identifiers and the AUTO selection flag.

list

@classmethod
def list(cls) -> List[str]
Return list of valid backend string values (excluding AUTO).

supported_extensions

@classmethod
def supported_extensions(cls) -> List[str]
Get list of all supported file extensions.
returns
List[str]
List of extension strings (e.g. [".svs", ".tiff", ...]).

available_backends

@classmethod
def available_backends(cls) -> Dict[str, bool]
Get availability status of all physical backends.
returns
Dict[str, bool]
Mapping of backend name to availability boolean.