napari_track_edit.application_menus.visualization_widget

Classes

VisualizationConfigWidget

Sliders and checkboxes for adjusting the opacity and contour display.

ColorByWidget

A "Color by" label and the dropdown picking the feature to color by.

ModeWidget

Compact radio buttons for display mode.

VisualizationWidget

Widget to adjust opacity and contour display in different TrackLabels layer display modes.

Module Contents

class napari_track_edit.application_menus.visualization_widget.VisualizationConfigWidget(label: str, default_opacity: float, default_contour: bool, use_contour: bool = True)

Bases: qtpy.QtWidgets.QWidget

Sliders and checkboxes for adjusting the opacity and contour display.

update_visualization
opacity
contour = None
class napari_track_edit.application_menus.visualization_widget.ColorByWidget(tracks_viewer: napari_track_edit.data_views.views_coordinator.tracks_viewer.TracksViewer)

Bases: 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.

tracks_viewer
combo
showEvent(event)
_populate(*_args) → None

Rebuild the entries and show the feature currently in use.

_on_selected(index: int) → None
class napari_track_edit.application_menus.visualization_widget.ModeWidget

Bases: qtpy.QtWidgets.QWidget

Compact radio buttons for display mode.

update_mode
radio_group
property current_mode: str
button_for_mode(mode: str) → qtpy.QtWidgets.QRadioButton
_on_toggled(button, checked)
class napari_track_edit.application_menus.visualization_widget.VisualizationWidget(viewer: napari.Viewer)

Bases: qtpy.QtWidgets.QWidget

Widget to adjust opacity and contour display in different TrackLabels layer display modes.

viewer
tracks_viewer
mode_widget
highlight_widget
foreground_widget
background_widget
color_by_widget
show_ortho_views
show_viewer_overlay
cleanup() → None

Stop following the TracksViewer, which outlives this widget.

Called by MenuManager when the dock is destroyed.

toggle_viewer_text_overlay(checked: bool)

Change the visibility of the text overlay

toggle_ortho_views(checked: bool)

Show or hide the ortho views, creating them the first time.

_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.

_update_mode(mode: str) → None

Update the display mode on the Tracksviewer

_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.

_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.