trackpy.masks.slice_image

trackpy.masks.slice_image(pos, image, radius)

Slice a box around a group of features from an image.

The box is the smallest box that contains all coordinates up to radius from any coordinate.

Parameters:
imagendarray

The image that will be sliced

positerable

An iterable (e.g. list or ndarray) that contains the feature positions

radiusnumber or tuple of numbers

Defines the size of the slice. Every pixel that has a distance lower or equal to radius to a feature position is included.

Returns:
tuple of:
  • the sliced image
  • the coordinate of the slice origin (top-left pixel)