darsia.ROI#

class ROI(coordinates)[source]#

Bases: object

Polygonal region of interest (ROI) in global (physical) coordinates for darsia.Image.

NOTE: Only 2D polygons are supported at the moment.

Initialize the ROI with a list of coordinates.

Parameters:
coordinateslist[darsia.Coordinate] | darsia.CoordinateArray

Coordinates defining the polygon. If first and last coordinates are not the same, the first coordinate will be appended to the end to close the polygon.

Methods

contains(point)

Check if the point is inside the polygon.

extract_subregion(image)

Apply the ROI to an image, returning a new image with the ROI applied.

contains(point)[source]#

Check if the point is inside the polygon.

extract_subregion(image)[source]#

Apply the ROI to an image, returning a new image with the ROI applied.

If provided, the exterior_value will be used to fill the area outside the polygon. If not provided, the area outside the polygon will be filled with values from the image.