The classes implemented in the masks module define how to retrieve a binary mask of the tissue from a Slide object. This step is necessary during the tiles extraction phase. The masks module already implements different approaches to retrieve specific tissue regions within the slide: the TissueMask class segments the whole tissue area in the slide leveraging a sequence of native filters, including conversion to grayscale, Otsu thresholding, binary dilation, small holes and small objects removal; the BiggestTissueBoxMask class applies the same chain of filters as TissueMask but it returns a binary mask corresponding to the bounding box of the largest connected tissue region within the slide. Alternatively, a custom binary mask can be defined with the BinaryMask class.