TIAToolbox 0.5.0
Pre-release
Pre-release
Major and Feature Improvements
- Adds
get_wsireader()to return appropriate WSIReader. - Adds new functions to allow reading of regions using WSIReader at different resolutions given in units of:
- microns per-pixel (mpp)
- objective lens power (power)
- pixels-per baseline (baseline)
- resolution level (level)
- Adds functions for reading regions are
read_boundsandread_rect.read_boundstakes a tuple (left, top, right, bottom) of coordinates in baseline (level 0) reference frame and returns a region bounded by those.read_recttakes one coordinate in baseline reference frame and an output size in pixels.
- Adds
VirtualWSIReaderas a subclass of WSIReader which can be used to read visual fields (tiles).VirtualWSIReaderaccepts ndarray or image path as input.
- Adds MPP fall back to standard TIFF resolution tags with warning.
- If OpenSlide cannot determine microns per pixel (
mpp) from the metadata, checks the TIFF resolution units (TIFF tags:ResolutionUnit,XResolutionandYResolution) to calculate MPP. Additionally, add function to estimate missing objective power if MPP is known of derived from TIFF resolution tags.
- If OpenSlide cannot determine microns per pixel (
- Estimates missing objective power from MPP with warning.
- Adds example notebooks for stain normalisation and WSI reader.
- Adds caching to slide info property. This is done by checking if a private
self._m_infoexists and returning it if so, otherwiseself._infois called to create the info for the first time (or to force regenerating) and the result is assigned toself._m_info. This could in future be made much simpler with thefunctools.cached_propertydecorator in Python 3.8+. - Adds pre processing step to stain normalisation where stain matrix encodes colour information from tissue region only.
Changes to API
read_regionrefactored to be backwards compatible with openslide arguments.slide_infochanged toinfo- Updates WSIReader which only takes one input
WSIReaderinput_pathvariable changed toinput_img- Adds
tile_read_size,tile_objective_valueandoutput_dirto WSIReader.save_tiles() - Adds
tile_read_sizeas a tuple transforms.imresizetakes additional argumentsoutput_sizeand interpolation method 'optimise' which selectscv2.INTER_AREAforscale_factor<1andcv2.INTER_CUBICforscale_factor>1
Bug Fixes and Other Changes
- Refactors glymur code to use index slicing instead of deprecated read function.
- Refactors thumbnail code to use
read_boundsand be a member of the WSIReader base class. - Updates
README.mdto clarify installation instructions. - Fixes slide_info.py for changes in WSIReader API.
- Fixes save_tiles.py for changes in WSIReader API.
- Updates
example_wsiread.ipynbto reflect the changes in WSIReader. - Adds Google Colab and Kaggle links to allow user to run notebooks directly on colab or kaggle.
- Fixes a bug in taking directory input for stainnorm operation for command line interface.
- Pins
numpy<=1.19.3to avoid compatibility issues with opencv. - Adds
scikit-imageorjupyterlabas a dependency.
Development related changes
- Moved
test_wsireader_jp2_save_tilesto test_wsireader.py. - Change recipe in Makefile for coverage to use pytest-cov instead of coverage.
- Runs travis only on PR.
- Adds pre-commit for easy setup of client-side git hooks for black code formatting and flake8 linting.
- Adds flake8-bugbear to pre-commit for catching potential deepsource errors.
- Adds constants for test regions in
test_wsireader.py. - Rearranges
usage.rstfor better readability. - Adds
pre-commit,flake8,flake8-bugbear,black,pytest-covandrecommonmarkas dependency.
Co-authored-by: Shan E Ahmed Raza @shaneahmed, John Pocock @John-P, Simon Graham @simongraham, Dang Vu @vqdang, Mostafa Jahanifar @mostafajahanifar Srijay Deshpande @Srijay-lab, Saad Bashir @rajasaad