find_overlap¶

find_overlap(read_location, read_size, image_size)[source]¶

Find the part of a region which overlaps the image area.

Parameters:
  • read_location (tuple(int)) – The location of the region to read.

  • read_size (tuple(int)) – The size of the location to read.

  • image_size (tuple(int)) – The size of the image to read from.

Returns:

Bounds of the overlapping region.

Return type:

np.ndarray

Examples

>>> from tiatoolbox.utils.image import find_overlap
>>> loc, size = (-5, -5), (10, 10)
>>> find_overlap(loc, size, (5, 5))