draw_mask#

anri.index.draw_mask(image, ax=None)[source]#

Draw the sample’s outline on an image; returns a function that gives the mask of what was drawn.

As ImageD11’s InteractiveMask: click the polygon’s corners on the image, close it on the first corner, and move corners by dragging. Call the returned function (get_mask()) once done, e.g. in the next notebook cell. Needs an interactive matplotlib backend (%matplotlib widget in Jupyter).

Parameters:
Returns:

Callable – get_mask() -> [ny, nx] bool: inside the polygon (all False until one is drawn)