VertexROIBase

class glue.core.roi.VertexROIBase(vx=None, vy=None)[source]

Bases: glue.core.roi.Roi

Parameters
  • vx (list) – initial x vertices

  • vy (list) – initial y vertices

Methods Summary

add_point(self, x, y)

Add another vertex to the ROI

defined(self)

Returns whether or not the subset is properly defined

remove_point(self, x, y[, thresh])

Remove the vertex closest to a reference (xy) point

replace_last_point(self, x, y)

reset(self)

Reset the vertex list.

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

add_point(self, x, y)[source]

Add another vertex to the ROI

Parameters
  • x – The x coordinate

  • y – The y coordinate

defined(self)[source]

Returns whether or not the subset is properly defined

remove_point(self, x, y, thresh=None)[source]

Remove the vertex closest to a reference (xy) point

Parameters
  • x – The x coordinate of the reference point

  • y – The y coordinate of the reference point

  • thresh – An optional threshold. If present, the vertex closest to (x,y) will only be removed if the distance is less than thresh

replace_last_point(self, x, y)[source]
reset(self)[source]

Reset the vertex list.

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