VertexROIBase

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

Bases: Roi

Parameters
  • vx (list) – initial x vertices

  • vy (list) – initial y vertices

Methods Summary

add_point(x, y)

Add another vertex to the ROI

defined()

Returns whether or not the subset is properly defined

remove_point(x, y[, thresh])

Remove the vertex closest to a reference (xy) point

replace_last_point(x, y)

reset()

Reset the vertex list.

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

Methods Documentation

add_point(x, y)[source]

Add another vertex to the ROI

Parameters
  • x – The x coordinate

  • y – The y coordinate

defined()[source]

Returns whether or not the subset is properly defined

remove_point(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(x, y)[source]
reset()[source]

Reset the vertex list.

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