motile_plugin.widgets.motile.run_editor

Attributes

logger

Classes

RunEditor

Module Contents

motile_plugin.widgets.motile.run_editor.logger
class motile_plugin.widgets.motile.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
generate_tracks_btn
main_layout
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

_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:
QWidget: A dropdown select with all the labels layers in layers

and a refresh button to sync with napari.

get_input_layer() napari.layers.Layer | None

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

Returns:
napari.layers.Layer | None: The points or labels layer with the name

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

reshape_labels(segmentation: numpy.ndarray) numpy.ndarray

Expect napari segmentation to have shape t, [z], y, x. Motile toolbox needs a channel dimension between time and space. This also raises an error if the input seg is not the expected shape.

Args:

segmentation (np.ndarray): _description_

Raises:

ValueError if segmentation is not 3D or 4D.

_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:
QWidget: A row widget with a line edit for run name and a button

to create a new run and start solving.

get_run() motile_plugin.backend.motile_run.MotileRun | None

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

Returns:
MotileRun: A run with name, parameters, and input segmentation.

Output segmentation and tracks not yet specified.

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: motile_plugin.backend.motile_run.MotileRun) None

Configure the run editor to copy the name and params of the given run.