phenotypic.tools_.napari_#

Napari-based interactive tools for PhenoTypic.

Developer utilities for visual point picking and coordinate selection using napari viewers. These are dev-time tools, not user-facing GUI components.

Classes

PointPickerWidget

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

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.

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