napari_track_edit.application_menus.visualization_widget ======================================================== .. py:module:: napari_track_edit.application_menus.visualization_widget Classes ------- .. autoapisummary:: napari_track_edit.application_menus.visualization_widget.VisualizationConfigWidget napari_track_edit.application_menus.visualization_widget.ColorByWidget napari_track_edit.application_menus.visualization_widget.ModeWidget napari_track_edit.application_menus.visualization_widget.VisualizationWidget Module Contents --------------- .. py:class:: VisualizationConfigWidget(label: str, default_opacity: float, default_contour: bool, use_contour: bool = True) Bases: :py:obj:`qtpy.QtWidgets.QWidget` Sliders and checkboxes for adjusting the opacity and contour display. .. py:attribute:: update_visualization .. py:attribute:: opacity .. py:attribute:: contour :value: None .. py:class:: ColorByWidget(tracks_viewer: napari_track_edit.data_views.views_coordinator.tracks_viewer.TracksViewer) Bases: :py:obj:`qtpy.QtWidgets.QWidget` A "Color by" label and the dropdown picking the feature to color by. Selecting an entry goes through `TracksViewer.set_color_feature`, which updates the shared colormap *and* rebuilds the labels, points, tracks, tree and table. Currently, only categorical features are offered (see `categorical_feature_keys`), plus "None", which paints every node one flat color. .. py:attribute:: tracks_viewer .. py:attribute:: combo .. py:method:: showEvent(event) .. py:method:: _populate(*_args) -> None Rebuild the entries and show the feature currently in use. .. py:method:: _on_selected(index: int) -> None .. py:class:: ModeWidget Bases: :py:obj:`qtpy.QtWidgets.QWidget` Compact radio buttons for display mode. .. py:attribute:: update_mode .. py:attribute:: radio_group .. py:property:: current_mode :type: str .. py:method:: button_for_mode(mode: str) -> qtpy.QtWidgets.QRadioButton .. py:method:: _on_toggled(button, checked) .. py:class:: VisualizationWidget(viewer: napari.Viewer) Bases: :py:obj:`qtpy.QtWidgets.QWidget` Widget to adjust opacity and contour display in different TrackLabels layer display modes. .. py:attribute:: viewer .. py:attribute:: tracks_viewer .. py:attribute:: mode_widget .. py:attribute:: highlight_widget .. py:attribute:: foreground_widget .. py:attribute:: background_widget .. py:attribute:: color_by_widget .. py:attribute:: show_ortho_views .. py:attribute:: show_viewer_overlay .. py:method:: cleanup() -> None Stop following the TracksViewer, which outlives this widget. Called by MenuManager when the dock is destroyed. .. py:method:: toggle_viewer_text_overlay(checked: bool) Change the visibility of the text overlay .. py:method:: toggle_ortho_views(checked: bool) Show or hide the ortho views, creating them the first time. .. py:method:: _follow_ortho_checkbox(manager) -> None Keep our checkbox in sync with the ortho views' own checkbox. This is a Qt-to-Qt connection, so Qt drops it when either checkbox is deleted and nothing needs to be disconnected by hand. .. py:method:: _update_mode(mode: str) -> None Update the display mode on the Tracksviewer .. py:method:: _update_widget_availability() Update the radio buttons, show/hide the contour checkboxes when changing between contour and normal mode. Disable the background widget when the display mode is 'All', as there are no background labels in that case. .. py:method:: _update_visualization() Apply the values from the widget and send an update signal. Returns without touching the layer when the widgets already agree with it. This runs on every `mode_updated`, which includes pressing Q - and there only the *enabled* state of these widgets changes, never their values. Applying them anyway triggers a second `update_selection`, and each one re-slices the whole displayed volume: 6 s in 3D on a 1.7e9-voxel timepoint, for a result identical to the refresh `set_display_mode` has already done.