ArbitraryROI

class caqtus.types.image.roi.ArbitraryROI(
original_image_size: tuple[Width, Height],
indices,
)

Bases: ROI

Arbitrary region of interest inside an image.

This ROI is defined by specifying the indices of the pixels in the original image that are part of the region of interest.

While this ROI is the most generic one, it becomes very inefficient when the number of pixels in the region of interest is large, because it stores the coordinates of all pixels. Whenever possible, use a more specific ROI.

indices

The indices of the pixels in the original image that are part of the

Type:

tuple[tuple[int, int], …]

region of interest.
get_indices() tuple[Iterable[int], Iterable[int]]

Return the indices of the pixels in the ROI.

classmethod from_mask(mask: ndarray) Self

Create a region of interest from a mask

Parameters:
  • mask – A boolean array with the same shape as the original image.

  • interest. (True values indicate that the pixel is part of the region of)