OtsuTissueMasker

class OtsuTissueMasker[source]

Tissue masker which uses Otsu’s method to determine background.

Otsu’s method

Examples

>>> from tiatoolbox.tools.tissuemask import OtsuTissueMasker
>>> masker = OtsuTissueMasker()
>>> masker.fit(thumbnail)
>>> masks = masker.transform([thumbnail])
>>> from tiatoolbox.tools.tissuemask import OtsuTissueMasker
>>> masker = OtsuTissueMasker()
>>> masks = masker.fit_transform([thumbnail])

Methods

fit

Find a binary threshold using Otsu's method.

transform

Create masks using the threshold found during fit().

Return type

None

fit(images, masks=None)[source]

Find a binary threshold using Otsu’s method.

Parameters
  • images (numpy.ndarray) – List of images with a length 4 shape (N, height, width, channels).

  • masks (numpy.ndarray) – Unused here, for API consistency.

Return type

None

transform(images)[source]

Create masks using the threshold found during fit().

Parameters

images (numpy.ndarray) – List of images with a length 4 shape (N, height, width, channels).

Returns

List of images with a length 4

shape (N, height, width, channels).

Return type

numpy.ndarray