# EllipticalROI¶

Bases: `Roi`

A 2D elliptical region of interest with semimajor/minor axes radius_[xy].

Parameters
xcfloat, optional

x coordinate of center.

ycfloat, optional

y coordinate of center.

Semiaxis along x axis.

Semiaxis along y axis.

thetafloat, optional

Angle of anticlockwise rotation around (xc, yc) in radian.

Notes

The radius_x, radius_y properties refer to the semiaxes along the x and y axes before any rotation is applied.

Methods Summary

 Returns (conservatively estimated) boundary values in x and y `contains`(x, y) Test which of a set of (x, y) points fall within the region of interest. Returns True if the ROI is defined `move_to`(xdelta, ydelta) Translate the ROI to a center of (x, y) Reset the rectangular region `rotate_to`(theta) Rotate anticlockwise around center to position angle theta. 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

bounds()[source]

Returns (conservatively estimated) boundary values in x and y

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]
move_to(xdelta, ydelta)[source]

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

reset()[source]

Reset the rectangular region

rotate_to(theta)[source]

Rotate anticlockwise around center to position angle theta.

Parameters
thetafloat

Angle of anticlockwise rotation around center in radian.

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