Module movemeter.roi

Parametric functions to generate ROIs or grids or other combinations of ROIs

Functions

def gen_grid(gridpos, blocksize, step=1)

Fill a large ROI (gridpos) with smaller ROIs to create a grid of ROIs.

gridpos (x,y,w,h) in pixels blocksize (x,y) in pixels step Relative step between grids, in blocks

Returns a list of ROIs (x,y,w,h)

def grid_along_ellipse(gridpos, blocksize, step=1, lw=None, fill=False)

Variation of gen_grid but on circle

def grid_along_line(p0, p1, d, blocksize, step=1)

Fill a grid along a line segment, where each window is maximally at distance d from the line.

p0, p1 : array-like or tuple Start and end points (x,y) d : int Maximal window center-linepoint distance

def grid_arc_from_points(gridpos, blocksize, step=1, points=None, circle=None, lw=None)

Give a points that make up a circle

def grid_radial_line_from_points(gridpos, blocksize, step=1, points=None, circle=None, line_len=0, i_segment=0, n_segments=10)

Giving either the points or the circle parameters, create radial lines or