ROI

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

Bases: ABC

Base class for regions of interest inside an image.

original_image_size

The size of the original image as (width, height).

Type:

tuple[caqtus.types.image._shape.Width, caqtus.types.image._shape.Height]

get_mask() ndarray

A boolean array with the same shape as the original image.

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

abstractmethod get_indices() tuple[Iterable[int], Iterable[int]]

Return the indices of the pixels in the ROI.

property original_width: int

Return the width of the original image.

property original_height: int

Return the height of the original image.

apply(
image: ndarray[tuple[Width, Height], dtype],
) MaskedArray[tuple[Width, Height], dtype]

Apply the ROI to an image.

Returns:

A masked array with the pixels outside the ROI masked.