miscΒΆ

Miscellaneous small functions repeatedly used in tiatoolbox.

Functions

assert_dtype_int

Generate error if dtype is not int.

contrast_enhancer

Enhancing contrast of the input image using intensity adjustment.

download_data

Download data from a given URL to location.

get_bounding_box

Get bounding box coordinate information.

get_luminosity_tissue_mask

Get tissue mask based on the luminosity of the input image.

grab_files_from_dir

Grab file paths specified by file extensions.

imread

Read an image as numpy array.

imwrite

Write numpy array to an image.

load_stain_matrix

Load a stain matrix as a numpy array.

model_to

Transfers model to cpu/gpu.

parse_cv2_interpolaton

Convert a string to a OpenCV (cv2) interpolation enum.

prepare_file_dir_cli

Prepares CLI for running code on multiple files or a directory.

prepare_model_cli

Prepares cli for running models.

read_locations

Read annotations as pandas DataFrame.

save_as_json

Save data to a json file.

save_yaml

Save dictionary as yaml.

select_device

Selects the appropriate device as requested.

split_path_name_ext

Split path of a file to directory path, file name and extensions.

string_to_tuple

Splits input string to tuple at ','.

unzip_data

Extract data from zip file.