ROI#
- class pypillometry.ROI(name=None, setup=None)[source]#
Bases:
objectBase class for Region of Interest (ROI).
This class provides common functionality for different types of ROIs. Subclasses should implement the
contains()method to define their specific containment logic (coords in roiuses it for single points) and theplot()method.Coordinates are specified in pixels with origin at the upper-left corner of the screen (y increases downward). Use factory methods from_mm() or from_degrees() on subclasses for alternative coordinate systems.
- Parameters:
name (
str) – Name of the ROIsetup (
Optional[ExperimentalSetup]) – Experimental setup for coordinate conversions. If provided, enables coordinate system conversion methods.
Methods
Details
- contains(coords)[source]#
Test if coordinates are within the ROI.
Supports both single coordinate and array of coordinates.
- plot(ax=None, **kwargs)[source]#
Plot the ROI on the given axes.
- Parameters:
ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, the current axes will be used.
**kwargs (dict) – Additional keyword arguments passed to the plotting function.
- Return type:
- Returns:
the axes of the plot