napari_track_edit.motile.menus.params_editor ============================================ .. py:module:: napari_track_edit.motile.menus.params_editor Classes ------- .. autoapisummary:: napari_track_edit.motile.menus.params_editor.EditableParam napari_track_edit.motile.menus.params_editor.OptionalEditableParam napari_track_edit.motile.menus.params_editor.SolverParamsEditor Functions --------- .. autoapisummary:: napari_track_edit.motile.menus.params_editor._get_base_type Module Contents --------------- .. py:function:: _get_base_type(annotation: type) -> type Extract the base numeric type from a type annotation. For example: int -> int float -> float int | None -> int float | None -> float .. py:class:: EditableParam(param_name: str, solver_params: napari_track_edit.motile.backend.SolverParams, negative: bool = False) Bases: :py:obj:`qtpy.QtWidgets.QWidget` .. py:attribute:: param_name .. py:attribute:: dtype .. py:attribute:: title .. py:attribute:: negative :value: False .. py:attribute:: param_label .. py:attribute:: param_value .. py:method:: _param_label_widget() -> qtpy.QtWidgets.QLabel .. py:method:: update_from_params(params: napari_track_edit.motile.backend.SolverParams) .. py:class:: OptionalEditableParam(param_name: str, solver_params: napari_track_edit.motile.backend.SolverParams, negative: bool = False) Bases: :py:obj:`EditableParam` .. py:attribute:: ui_default .. py:method:: _param_label_widget() -> qtpy.QtWidgets.QCheckBox .. py:method:: update_from_params(params: napari_track_edit.motile.backend.SolverParams) .. py:method:: toggle_enable(checked: bool) .. py:method:: toggle_visible(visible: bool) .. py:class:: SolverParamsEditor Bases: :py:obj:`qtpy.QtWidgets.QWidget` Widget for editing SolverParams. Spinboxes will be created for each parameter in SolverParams and linked such that editing the value in the spinbox will change the corresponding parameter. Checkboxes will also be created for each optional parameter (group) and linked such that unchecking the box will update the parameter value to None, and checking will update the parameter to the current spinbox value. To update for a backend change to SolverParams, emit the new_params signal, which the spinboxes and checkboxes will connect to and use to update the UI and thus the stored solver params. .. py:attribute:: new_params .. py:attribute:: solver_params .. py:attribute:: param_categories .. py:attribute:: iou_row :type: OptionalEditableParam .. py:attribute:: window_size_row :type: OptionalEditableParam .. py:attribute:: overlap_size_row :type: OptionalEditableParam .. py:attribute:: single_window_start_row :type: OptionalEditableParam .. py:method:: _params_group(title: str, param_category: str, negative: bool) -> qtpy.QtWidgets.QWidget .. py:method:: _setup_chunking_constraints() -> None Set up validation constraints for chunking fields. .. py:method:: _update_overlap_constraints(window_size: int | None) -> None Update overlap_size spinbox maximum based on window_size. .. py:method:: _toggle_chunking_fields(enabled: bool) -> None Enable/disable overlap_size and single_window_start based on window_size. .. py:method:: _on_overlap_toggled(checked: bool) -> None When overlap_size is checked, uncheck single_window_start and remember choice. .. py:method:: _on_single_window_toggled(checked: bool) -> None When single_window_start is checked, uncheck overlap_size and remember choice. .. py:method:: set_max_frames(max_frame: int) -> None Set the maximum frame index for single_window_start. :param max_frame: The maximum valid frame index (typically num_frames - 1).