misc¶
tiatoolbox.utils.misc
Miscellaneous small functions repeatedly used in tiatoolbox.
Functions
Add annotations from a .dat file to an existing store. |
|
Helper function to create list of Annotation objects. |
|
Generate error if dtype is not int. |
|
Cast the input array to the minimal data type required to represent its values. |
|
Enhance contrast of the input image using intensity adjustment. |
|
Allocate a NumPy or Zarr array depending on available memory and a threshold. |
|
Converts output of the PatchPredictor engine to AnnotationStore or QuPath json. |
|
Converts output of TIAToolbox SemanticSegmentor engine to AnnotationStore. |
|
Download data from a given URL to location. |
|
Get bounding box coordinate information. |
|
Get tissue mask based on the luminosity of the input image. |
|
Converts a zarr array into a numpy array. |
|
Grab file paths specified by file extensions. |
|
Read an image as |
|
Write numpy array to an image. |
|
Load a stain matrix as a numpy array. |
|
Helper function to create a default typedict if none is provided. |
|
Helper function to make a valid polygon. |
|
Convert a string to a OpenCV (cv2) interpolation enum. |
|
Helper function to generate annotation per patch predictions. |
|
Helper function to generate QuPath JSON per patch predictions. |
|
Convert pixels per unit (ppu) to microns per pixel (mpp). |
|
Process contours and hierarchy to create annotations. |
|
Read annotations as pandas DataFrame. |
|
Saves Annotation Store to disk. |
|
Save data to a json file. |
|
Saves QuPath JSON to disk. |
|
Save dictionary as yaml. |
|
Return appropriate interpolation method for opencv based image resize. |
|
Selects the appropriate device as requested. |
|
Split path of a file to directory path, file name and extensions. |
|
Load annotations from a hovernet-style .dat file. |
|
Splits input string to tuple at ','. |
|
Helper function for tqdm_dask_progress_bar. |
|
Extract data from zip file. |
|
Helper function to update tqdm progress bar description. |
|
Saves output probability maps from segmentation models as heatmaps. |