Skip to content

Commit

Permalink
fix point selection
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenwagner committed Dec 4, 2023
1 parent 753813e commit eadb10d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/napari_tomotwin/load_umap.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@ def run_clusters_plotter(plotter_widget,
plotter_widget.run(features = features, plot_x_axis_name = plot_x_axis_name, plot_y_axis_name = plot_y_axis_name, plot_cluster_name = plot_cluster_name, force_redraw = force_redraw)

def show_umap(label_layer):

global plotter_widget
label_layer.opacity = 0
label_layer.visible = True

viewer = napari.current_viewer()

@viewer.mouse_drag_callbacks.append
def get_event(viewer, event):
data_coordinates = label_layer.world_to_data(event.position)
_draw_circle(data_coordinates, label_layer, umap)


widget, plotter_widget = viewer.window.add_plugin_dock_widget('napari-clusters-plotter',
widget_name='Plotter Widget')

Expand Down Expand Up @@ -110,10 +117,6 @@ def _load_umap(filename: pathlib.Path, label_layer):

return label_layer

@viewer.mouse_drag_callbacks.append
def get_event(viewer, event):
data_coordinates = label_layer.world_to_data(event.position)
_draw_circle(data_coordinates,label_layer,umap)


def stop_spinner():
Expand Down

0 comments on commit eadb10d

Please sign in to comment.