roi¶
Region of interest creation
-
class
pdsspect.roi.ROIBase(image_set, view_canvas, color='red', linewidth=1, linestyle='solid', showcap=False, fill=True, fillcolor=None, alpha=1.0, drawdims=False, font='Sans Serif', fillalpha=1.0, **kwargs)[source]¶ Bases:
ginga.canvas.types.basic.PolygonBase class for all ROI shapes
-
contains_arr(x_arr, y_arr)[source]¶ Determine whether the points in the ROI are in arrays
The arrays must be the same shape. The arrays should be result of
np.mgrid[y1:y2:1, x1:x2:1]Parameters: - x_arr (
numpy.ndarray) – Array of x coodinates - y_arr (
numpy.ndarray) – Array of y coordinates
Returns: result – Boolean array where coordinates that are in ROI are True
Return type: - x_arr (
-
create_ROI(points=None)[source]¶ Create a Region of interest
Parameters: points ( listoftupleof twoint) – Points that make up the vertices of the ROIReturns: coordinates – m x 2array of coordinates.Return type: numpy.ndarray
-
lock_coords_to_pixel(data_x, data_y)[source]¶ Lock the coordinates to the pixel
The coordinate of the pixel is located at the bottom left corner of the pixel square while the center of the pixel .5 units up and to the right of the corner. So if the given coordinates are (2.3, 3.7), the pixel coordinates will be (2, 3) and the center of the pixel is (2.5, 3.5). This method locks the given coordinates to the pixel’s coordinates
Parameters: Returns:
-
-
class
pdsspect.roi.Polygon(image_set, view_canvas, color='red', linewidth=1, linestyle='solid', showcap=False, fill=True, fillcolor=None, alpha=1.0, drawdims=False, font='Sans Serif', fillalpha=1.0, **kwargs)[source]¶ Bases:
pdsspect.roi.ROIBasePolygon Region of Interest
-
extend_ROI(data_x, data_y)[source]¶ Extend the current edge of the polygon on mouse motion
Parameters:
-
-
class
pdsspect.roi.Rectangle(image_set, view_canvas, color='red', linewidth=1, linestyle='solid', showcap=False, fill=True, fillcolor=None, alpha=1.0, drawdims=False, font='Sans Serif', fillalpha=1.0, **kwargs)[source]¶ Bases:
pdsspect.roi.ROIBaseRectangle Region of interest
-
extend_ROI(data_x, data_y)[source]¶ Exend the rectangle on region of interest on mouse motion
Parameters:
-
-
class
pdsspect.roi.Pencil(*args, **kwargs)[source]¶ Bases:
pdsspect.roi.ROIBaseSelect individual pixels
-
move_delta(delta_x, delta_y)[source]¶ Override the move_delta function to move all the points
Parameters:
-