WSI Handler
WSI.readwsi module
Title: ValidPath Toolbox - WSI Handler module
Description: This is the WSI Handler module for the ValidPath toolbox. It is includes ReadWsi class and several methods
Classes: WSIReader
Methods: There are three methods in the ReadWSI module as follows:
Reader: wsi_obj = WSIReader.wsi_reader(path)
Region Extractor: WSIReader.extract_region(wsi_obj,location,level,size)
Extract Bounds: WSIReader.extract_bounds(wsi_obj,bounds,level)
- class WSI.readwsi.WSIReader[source]
Bases:
object
- extract_bounds(bounds, level)[source]
This method process the WSIs and extract image.
- Parameters:
- wsi_objobject
recieve the WSI object
- boundstuple
recieve the locations for extracting image from WSI
- levelint
WSI level to extract image from
- Returns:
- IMGImage
Image data
- extract_region(location, level, size)[source]
This method process the WSIs and extract regions.
- Parameters:
- wsi_objobject
recieve the WSI object
- Returns:
- IMGImage
Image data
- wsi_reader()[source]
This code read a WSI and return the WSI object. This code can read the WSIs with the following formats: Aperio (.svs, .tif) Hamamatsu (.vms, .vmu, .ndpi) Leica (.scn) MIRAX (.mrxs) Philips (.tiff) Sakura (.svslide) Trestle (.tif) Ventana (.bif, .tif) Generic tiled TIFF (.tif)
- Parameters:
- WSI_pathstring
The address to the WSI file.
- Returns:
- wsi_objobject
WSI object
- wsi_xml_list()[source]
This code process the WSIs and XML list and returns these lists. Only WSI are included if there is an XML file with the same name.
- Parameters:
- wsis_dirstring
Input Directory which has the original WSIs and XML files
- Returns:
- WSIslist
List of included WSIs
- xml_list
List of XML files associated with included WSIs