Skip to content

Commit

Permalink
Merge pull request #34 from zoccoler/add_open_phasor_plotter_command
Browse files Browse the repository at this point in the history
add open phasor plotter command and update command Make FLIM Phasor P…
  • Loading branch information
zoccoler committed Aug 17, 2023
2 parents 9594f77 + 1de079b commit 87c26f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/napari_flim_phasor_plotter/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ def make_flim_phasor_plot(image_layer: "napari.layers.Image",
# TO DO: avoid using private method access to napari_viewer.window._dock_widgets (will be deprecated)
dock_widgets_names = [key for key,
value in napari_viewer.window._dock_widgets.items()]
if 'Plotter Widget' not in dock_widgets_names:
print(dock_widgets_names)
if 'Phasor Plotter Widget (napari-flim-phasor-plotter)' not in dock_widgets_names:
plotter_widget = PhasorPlotterWidget(napari_viewer)
napari_viewer.window.add_dock_widget(
plotter_widget, name='Plotter Widget')
plotter_widget, name='Phasor Plotter Widget (napari-flim-phasor-plotter)')
else:
widgets = napari_viewer.window._dock_widgets['Plotter Widget']
widgets = napari_viewer.window._dock_widgets['Phasor Plotter Widget (napari-flim-phasor-plotter)']
plotter_widget = widgets.findChild(PhasorPlotterWidget)

# UPDATE to line below once clusters_plotter updates with support to other layers
Expand Down Expand Up @@ -158,9 +159,9 @@ def make_flim_phasor_plot(image_layer: "napari.layers.Image",

# Update laser frequency spinbox
# TO DO: access and update widget in a better way
if 'Make FLIM Phasor Plot (napari-flim-phasor-plotter)' in dock_widgets_names:
if 'Calculate Phasors (napari-flim-phasor-plotter)' in dock_widgets_names:
widgets = napari_viewer.window._dock_widgets[
'Make FLIM Phasor Plot (napari-flim-phasor-plotter)']
'Calculate Phasors (napari-flim-phasor-plotter)']
laser_frequency_spinbox = widgets.children()[4].children()[
2].children()[-1]
# Set precision of spinbox based on number of decimals in laser_frequency
Expand Down
13 changes: 9 additions & 4 deletions src/napari_flim_phasor_plotter/napari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ contributions:
- id: napari-flim-phasor-plotter.load_lifetime_cat_synthetic
python_name: napari_flim_phasor_plotter._sample_data:load_lifetime_cat_synthtetic_single_image
title: Load sample data from FLIM phasor plotter
- id: napari-flim-phasor-plotter.build_phasor_plot
- id: napari-flim-phasor-plotter.calculate_phasors
python_name: napari_flim_phasor_plotter._widget:make_flim_phasor_plot
title: Make FLIM Phasor Plot
title: Calculate Phasors
- id: napari-flim-phasor-plotter.open_phasor_plot
python_name: napari_flim_phasor_plotter._plotting:PhasorPlotterWidget
title: Open FLIM Phasor Plotter
- id: napari-flim-phasor-plotter.convert_to_zarr
python_name: napari_flim_phasor_plotter._io.convert_to_zarr:convert_folder_to_zarr
title: Convert to zarr
Expand All @@ -44,9 +47,11 @@ contributions:
display_name: Lifetime Cat (2D Raw Synthetic FLIM)
key: lifetime_cat
widgets:
- command: napari-flim-phasor-plotter.build_phasor_plot
display_name: Make FLIM Phasor Plot
- command: napari-flim-phasor-plotter.calculate_phasors
display_name: Calculate Phasors
- command: napari-flim-phasor-plotter.convert_to_zarr
display_name: Convert to zarr
- command: napari-flim-phasor-plotter.apply_binning
display_name: Apply binning to TCSPC FLIM data
- command: napari-flim-phasor-plotter.open_phasor_plot
display_name: Phasor Plotter Widget

0 comments on commit 87c26f4

Please sign in to comment.