Annotation Extraction

WSI.annotation module


Title: ValidPath Toolbox - Annotation Extraction Module

Description: This is the Annotation Extraction module for the ValidPath toolbox. It is includes AnnotationExtractor class and several methods.

Classes: AnnotationExtractor

Methods: AnnotationExtractor.extract_ann (Save_dir: str,XMLs: array , WSIs: array)


class WSI.annotation.AnnotationExtractor[source]

Bases: object

extract_ann(save_dir, XMLs, WSIs, vis=False, save_mask=False)[source]

This method extracts different types for annotations from Whole Slide Images. It can save the extracted annottions to the output directory as defined in inputs. This code also handles several annotations per slide. The output directory will be generated based on the strucutr of the input directories.

Parameters:
save_dirstring

The path to the directory in order to save the annotations

WSIslist

List of whole slide image files

XMLslist

List of annotation files in XML format

Returns:

Image (array) – annotation files

make_folder(directory)[source]

This method creates a directory if not exist.

Parameters:
directorystring

Directory to be created.

Returns:
NoneNone

None.