phenotypic.tools_.napari_.PointPickerWidget#

class phenotypic.tools_.napari_.PointPickerWidget(max_points: int | None = None)[source]

Bases: object

Interactive point picker that opens a napari viewer for coordinate selection.

Parameters:

max_points (int | None) – Maximum number of points allowed. None means unlimited.

Methods

__init__

run

Open a napari viewer for interactive point selection and block until closed.

run(image) numpy.ndarray[source]

Open a napari viewer for interactive point selection and block until closed.

Parameters:

image – A PhenoTypic Image instance whose layers will be displayed.

Returns:

An (N, 2) array of confirmed (y, x) coordinates. Returns an empty (0, 2) array if the viewer is closed without confirming.

Raises:

ImportError – If napari is not installed.

Return type:

numpy.ndarray