napari_track_edit.motile.menus ============================== .. py:module:: napari_track_edit.motile.menus Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/napari_track_edit/motile/menus/motile_widget/index /autoapi/napari_track_edit/motile/menus/param_values/index /autoapi/napari_track_edit/motile/menus/params_editor/index /autoapi/napari_track_edit/motile/menus/params_viewer/index /autoapi/napari_track_edit/motile/menus/run_editor/index /autoapi/napari_track_edit/motile/menus/run_viewer/index Classes ------- .. autoapisummary:: napari_track_edit.motile.menus.MotileWidget Package Contents ---------------- .. py:class:: MotileWidget(viewer: napari.Viewer) Bases: :py:obj:`qtpy.QtWidgets.QWidget` A widget that controls the backend components of the motile tracker. Recieves user input about solver parameters, runs motile, and passes results to the TracksViewer. .. py:attribute:: solver_update .. py:attribute:: new_run .. py:attribute:: viewer :type: napari.Viewer .. py:attribute:: edit_run_widget .. py:attribute:: view_run_widget .. py:method:: view_run(tracks: funtracks.data_model.Tracks) -> None Populates the run viewer with the output of the provided run. :param run: The run to view :type run: MotileRun .. py:method:: edit_run(run: napari_track_edit.motile.backend.MotileRun | None) Create or edit a new run in the run editor. Also removes solution layers from the napari viewer. :param run: Initialize the new run with the parameters and name from this run. If not provided, uses the SolverParams default values. :type run: MotileRun | None .. py:method:: _generate_tracks(run: napari_track_edit.motile.backend.MotileRun) -> None Called when we start solving a new run. Switches from run editor to run viewer and starts solving of the new run in a separate thread to avoid blocking. :param run: Start solving this motile run. :type run: MotileRun .. py:method:: solve_with_motile(run: napari_track_edit.motile.backend.MotileRun) -> napari_track_edit.motile.backend.MotileRun Runs the solver and relabels the segmentation to match the solution graph. Emits: self.solver_event when the solver provides an update (will be emitted from the thread, which is why it needs to be an event and not just a normal function callback) :param run: A run with name, parameters, and input segmentation, but not including the output graph or segmentation. :type run: MotileRun :returns: The provided run with the output graph and segmentation included. :rtype: MotileRun .. py:method:: _on_solver_event(run: napari_track_edit.motile.backend.MotileRun, event_data: dict) -> None Parse the solver event and set the run status and gap accordingly. Also emits a solver_update event to tell the run viewer to update. Note: This will simply tell the run viewer to refresh its plot and status. If the run viewer is not viewing this run, it will refresh anyways, which is pointless but not harmful. :param run: The run that the solver is working on :type run: MotileRun :param event_data: The solver event data from ilpy.EventData :type event_data: dict .. py:method:: _on_solve_complete(run: napari_track_edit.motile.backend.MotileRun) -> None Called when the solver thread returns. Updates the run status to done and tells the run viewer to update. :param run: The completed run :type run: MotileRun .. py:method:: _title_widget() -> qtpy.QtWidgets.QWidget Create the intro paragraph widget, with links to motile docs. :returns: A widget describing the tracking tab and linking to motile docs :rtype: QWidget