RectangularROI

class glue.core.roi.RectangularROI(xmin=None, xmax=None, ymin=None, ymax=None)[source]

Bases: glue.core.roi.Roi

A 2D rectangular region of interest.

Methods Summary

center(self)

Return the (x,y) coordinates of the ROI center

contains(self, x, y)

Test whether a set of (x,y) points falls within the region of interest

corner(self)

defined(self)

Returns whether or not the subset is properly defined

height(self)

move_to(self, x, y)

Translate the ROI to a center of (x, y)

reset(self)

Reset the rectangular region.

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

transpose(self[, copy])

update_limits(self, xmin, ymin, xmax, ymax)

Update the limits of the rectangle

width(self)

Methods Documentation

center(self)[source]

Return the (x,y) coordinates of the ROI center

contains(self, x, y)[source]

Test whether a set of (x,y) points falls within the region of interest

Parameters
  • x – A scalar or numpy array of x points

  • y – A scalar or numpy array of y points

Returns

A list of True/False values, for whether each (x,y) point falls within the ROI

corner(self)[source]
defined(self)[source]

Returns whether or not the subset is properly defined

height(self)[source]
move_to(self, x, y)[source]

Translate the ROI to a center of (x, y)

reset(self)[source]

Reset the rectangular region.

to_polygon(self)[source]

Returns a tuple of x and y points, approximating the ROI as a polygon.

transformed(self, xfunc=None, yfunc=None)[source]

A transformed version of the ROI

transpose(self, copy=True)[source]
update_limits(self, xmin, ymin, xmax, ymax)[source]

Update the limits of the rectangle

width(self)[source]