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()

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

contains(x, y)

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

corner()

defined()

Returns whether or not the subset is properly defined

height()

move_to(x, y)

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

reset()

Reset the rectangular region.

to_polygon()

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

transformed([xfunc, yfunc])

A transformed version of the ROI

transpose([copy])

update_limits(xmin, ymin, xmax, ymax)

Update the limits of the rectangle

width()

Methods Documentation

center()[source]

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

contains(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()[source]
defined()[source]

Returns whether or not the subset is properly defined

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

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

reset()[source]

Reset the rectangular region.

to_polygon()[source]

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

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

A transformed version of the ROI

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

Update the limits of the rectangle

width()[source]