get_patch_extractor

get_patch_extractor(method_name, **kwargs)[source]

Return a patch extractor object as requested.

Parameters
  • method_name (str) – name of patch extraction method, must be one of “point” or “slidingwindow”.

  • **kwargs – Keyword arguments passed to PatchExtractor.

Returns

an object with base PatchExtractor as base class.

Return type

PatchExtractor

Examples

>>> from tiatoolbox.tools.patchextraction import get_patch_extractor
>>> # PointsPatchExtractor with default values
>>> patch_extract = get_patch_extractor(
...  'point', img_patch_h=200, img_patch_w=200)