Skip to content

Commit

Permalink
Merge pull request #88 from funkelab/fix_label_highlights
Browse files Browse the repository at this point in the history
fix the label highlighting when scrolling in the time dimension
  • Loading branch information
cmalinmayor authored Oct 20, 2024
2 parents 060ea6d + 8f4626b commit 08bbff7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/motile_plugin/data_views/views_coordinator/tracks_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(
self.visible = None
self.tracking_layers = TracksLayerGroup(self.viewer, self.tracks, "", self)

self.viewer.dims.events.current_step.connect(self.update_highlights)
self.selected_nodes = NodeSelectionList()
self.selected_nodes.list_updated.connect(self.update_selection)

Expand Down Expand Up @@ -183,6 +184,16 @@ def filter_visible_nodes(self) -> list[int]:
else:
return "all"

def update_highlights(self) -> None:
"""If the time dimension is changed, update the highlighting in the seg layer"""

if (
self.viewer.dims.last_used == 0
and self.tracking_layers.seg_layer is not None
):
visible = self.filter_visible_nodes()
self.tracking_layers.seg_layer.update_label_colormap(visible)

def update_selection(self) -> None:
"""Sets the view and triggers visualization updates in other components"""

Expand Down

0 comments on commit 08bbff7

Please sign in to comment.