CircularROI#

class glue.core.roi.CircularROI(xc=None, yc=None, radius=None)[source]#

Bases: Roi

A 2D circular region of interest.

Parameters:
xcfloat, optional

x coordinate of center.

ycfloat, optional

y coordinate of center.

radiusfloat, optional

Radius of the circle.

Methods Summary

center()

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

contains(x, y)

Test which of a set of (x, y) points fall within the region of interest.

defined()

Returns True if the ROI is defined

get_center()

get_radius()

move_to(x, y)

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

reset()

Reset the circular region

set_center(x, y)

Set the center of the circular region

set_radius(radius)

Set the radius of the circular region

to_polygon()

Returns vertices vx, vy of a polygon approximating the Roi, where each is an array of vertex coordinates in x and y.

transformed([xfunc, yfunc])

A transformed version of the Roi

Methods Documentation

center()[source]#

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

contains(x, y)[source]#

Test which of a set of (x, y) points fall within the region of interest.

Parameters:
xfloat or array-like

x coordinate(s) of point(s).

yfloat or array-like

y coordinate(s) of point(s).

Returns:
insidebool or ~numpy.ndarray

An boolean iterable, where each element is True if the corresponding (x, y) tuple is inside the Roi.

Raises:
UndefinedROI

If not defined.

defined()[source]#

Returns True if the ROI is defined

get_center()[source]#
get_radius()[source]#
move_to(x, y)[source]#

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

reset()[source]#

Reset the circular region

set_center(x, y)[source]#

Set the center of the circular region

set_radius(radius)[source]#

Set the radius of the circular region

to_polygon()[source]#

Returns vertices vx, vy of a polygon approximating the Roi, where each is an array of vertex coordinates in x and y.

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

A transformed version of the Roi