napari_track_edit.motile.menus.run_editor

Attributes

logger

Classes

RunEditor

Module Contents

napari_track_edit.motile.menus.run_editor.logger
class napari_track_edit.motile.menus.run_editor.RunEditor(viewer: napari.Viewer)

Bases: qtpy.QtWidgets.QGroupBox

start_run
viewer
solver_params_widget
run_name: qtpy.QtWidgets.QLineEdit
layer_selection_box: qtpy.QtWidgets.QComboBox
update_labels_layers() → None

Update the layer selection box with the input layers in the viewer

update_layer_selection() → None

Update the rest of the UI when the selected layer is updated

_update_max_frames() → None

Update the max frame constraint from viewer dims.

_labels_layer_widget() → qtpy.QtWidgets.QWidget

Create the widget to select the input layer. Uses magicgui, but explicitly connects to the viewer layers events to keep it synced.

Returns:

A dropdown select with all the labels layers in layers

and a refresh button to sync with napari.

Return type:

QWidget

get_input_layer() → napari.layers.Layer | None

Get the input segmentation or points in current selection in the layer dropdown.

Returns:

The points or labels layer with the name

that is selected, or None if no layer is selected.

Return type:

napari.layers.Layer | None

_run_widget() → qtpy.QtWidgets.QWidget

Construct a widget where you set the run name and start solving. Initializes self.run_name and connects the generate tracks button to emit the new_run signal.

Returns:

A row widget with a line edit for run name and a button

to create a new run and start solving.

Return type:

QWidget

get_run() → napari_track_edit.motile.backend.MotileRun | None

Construct a motile run from the current state of the run editor widget.

Returns:

A run with name, parameters, and input segmentation.

Output segmentation and tracks not yet specified.

Return type:

MotileRun

_convert_da_to_np_array(dask_array: dask.array.core.Array) → numpy.ndarray

Convert from dask array to in-memory array.

Parameters:

dask_array (da.core.Array) – a dask array

Returns:

data as an in-memory numpy array

Return type:

np.ndarray

emit_run() → None

Construct a run and start solving by emitting the start run signal for the main widget to connect to. If run is invalid, will not emit the signal.

new_run(run: napari_track_edit.motile.backend.MotileRun) → None

Configure the run editor to copy the name and params of the given run. A run loaded from a directory with no params file has no solver_params — leave the editor at its current values rather than emitting None.