squidpy.im.ImageContainer.crop_center

ImageContainer.crop_center(y, x, radius, **kwargs)[source]

Extract a circular crop.

The extracted crop will have shape (radius[0] * 2 + 1, radius[1] * 2 + 1).

Parameters:
  • y (Union[int, float]) – Coordinate of the crop along the height dimension in the pixel space. If a float, it specifies the relative position and must be in [0, 1].

  • x (Union[int, float]) – Coordinate of the crop along the width dimension in the pixel space. If a float, it specifies the relative position and must be in [0, 1].

  • radius (Union[int, float, tuple[Union[int, float], Union[int, float]]]) – Radius along the height and width dimensions, respectively.

  • kwargs (Any) – Keyword arguments for crop_corner().

Return type:

ImageContainer

Returns:

: The cropped image of size size * scale.