Roi¶
-
class
glue.core.roi.
Roi
[source]¶ Bases:
object
A geometrical 2D region of interest.
Glue uses Roi’s to represent user-drawn regions on plots. There are many specific sub-classes of Roi, but they all have a
contains
method to test whether a collection of 2D points lies inside the region.Methods Summary
center
(self)Return the (x,y) coordinates of the ROI center
contains
(self, x, y)Return true/false for each x/y pair.
contains3d
(self, x, y, z)Return true/false for each x/y/z pair.
copy
(self)Return a clone of the ROI
defined
(self)Returns whether or not the subset is properly defined
move_to
(self, x, y)Translate the ROI to a center of (x, y)
to_polygon
(self)Returns a tuple of x and y points, approximating the ROI as a polygon.
transformed
(self[, xfunc, yfunc])A transformed version of the ROI
Methods Documentation
-
contains
(self, x, y)[source]¶ Return true/false for each x/y pair.
- Parameters
x – Array of X locations
y – Array of Y locations
- Returns
A Boolean array, where each element is True if the corresponding (x,y) tuple is inside the Roi.
- Raises
UndefinedROI exception if not defined
-
contains3d
(self, x, y, z)[source]¶ Return true/false for each x/y/z pair.
- Parameters
- x
numpy.ndarray
Array of x locations
- y
numpy.ndarray
Array of y locations
- z
numpy.ndarray
Array of z locations
- x
- Returns
numpy.ndarray
A boolean array, where each element is True if the corresponding (x,y,z) tuple is inside the Roi.
- Raises
- UndefinedROI
if not defined
-