otx.api.entities.image#
This module implements the Image entity.
Classes
|
Represents a 2D image. |
- class otx.api.entities.image.Image(data: ndarray | Callable[[], ndarray] | None = None, file_path: str | None = None, size: Tuple[int, int] | Callable[[], Tuple[int, int]] | None = None)[source]#
Bases:
IMedia2DEntity
Represents a 2D image.
The image must be instantiated with either a NumPy array containing the image data or a path to an image file.
- Parameters:
data (Optional[np.ndarray]) – NumPy data.
file_path (Optional[str]) – Path to image file.
- roi_numpy(roi: Annotation | None = None) ndarray [source]#
Obtains the numpy representation of the image for a selection region of interest (roi).
- Parameters:
roi (Optional[Annotaiton]) – The region of interest can be Rectangle in the relative coordinate system of the full-annotation.
- Returns:
Selected region as numpy array.
- Return type:
np.ndarray