Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with other plugins #3

Open
haesleinhuepf opened this issue May 5, 2023 · 6 comments
Open

Compatibility with other plugins #3

haesleinhuepf opened this issue May 5, 2023 · 6 comments

Comments

@haesleinhuepf
Copy link
Contributor

haesleinhuepf commented May 5, 2023

Hi @hsidky and @JesseMckinzie ,

congrats to this very cool plugin! I just saw that you implemented very similar functionality that is also available in other plugins. In case you would like to spare a bit of code (and maintenance effort), you could consider replacing this part:
https://github.com/PolusAI/napari-nyxus/blob/7b4a6ff7289f5c01eaf6d8b78a7c60460116f117/napari_nyxus/nyx_napari.py#LL194C14-L194C33

With this:
https://github.com/haesleinhuepf/napari-skimage-regionprops/blob/5c4250c5bf6ea807b0604cfee5d5b9736c43e736/napari_skimage_regionprops/_regionprops.py#L159-L165

It would then allow the same features such as double-clicking on column headers, getting feature images, selecting individual objects etc (read more). This would also make sure that your extracted features can be post-processed by other plugins such as the napari-clusters-plotter and napari-spreadsheet.

And if that doesn't work for you, I would love to learn why. This would allow me to improve infrastructure on the other side..

Let me know what you think!

Best,
Robert

@JesseMckinzie
Copy link
Member

Hi @haesleinheupf,

Thanks for the feedback! This change looks like it would work with our plugin and would improve our table functionality. We will try updating the table to your suggestion and will let you know if there are any issues integrating it.

Thanks again for your suggestion!

Best,
Jesse

@JesseMckinzie
Copy link
Member

Hi @haesleinhuepf,

We have updated the table to your suggested implementation. Thanks for your feedback!

Best,
Jesse

@haesleinhuepf
Copy link
Contributor Author

Hi @JesseMckinzie ,

awesome, thanks for the update! I've just tried and when double-clicking the table column headers, I receive errors like these:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~\mambaforge\envs\my_first_env\lib\site-packages\napari_nyxus\nyx_napari.py:307, in NyxusNapari.onHeaderClicked(self=<napari_nyxus.nyx_napari.NyxusNapari object>, logicalIndex=3)
    304         self.colormap = layer.data 
    306 if (self.colormap is None):
--> 307     raise RuntimeError(f"Colormap layer {self.slider_layer_name} not found.")
        self.slider_layer_name = 'INTEGRATED_INTENSITY in Result of gauss_otsu_labeling'
        self = <napari_nyxus.nyx_napari.NyxusNapari object at 0x000001FE35A52BE0>
    309 self._add_range_slider(min, max)

RuntimeError: Colormap layer INTEGRATED_INTENSITY in Result of gauss_otsu_labeling not found.
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~\mambaforge\envs\my_first_env\lib\site-packages\napari_nyxus\nyx_napari.py:307, in NyxusNapari.onHeaderClicked(self=<napari_nyxus.nyx_napari.NyxusNapari object>, logicalIndex=47)
    304         self.colormap = layer.data 
    306 if (self.colormap is None):
--> 307     raise RuntimeError(f"Colormap layer {self.slider_layer_name} not found.")
        self.slider_layer_name = 'ECCENTRICITY in Result of gauss_otsu_labeling'
        self = <napari_nyxus.nyx_napari.NyxusNapari object at 0x000001E991292B80>
    309 self._add_range_slider(min, max)

RuntimeError: Colormap layer ECCENTRICITY in Result of gauss_otsu_labeling not found.

To reproduce:

  • I'm working with napari-nyxus installed in an environment together with devbio-napari.
mamba create --name my_env devbio-napari python=3.9 -c conda-forge
mamba activate my_env
pip install napari-nyxus
napari
  • Menu File > Open Samples > clesperanto > Blobs (from ImageJ)
  • Menu Tools > Segmentation / Labeling > Gauss-Otsu-Labeling (clesperanto)
  • Menu Plugins > Nyxus (napari-nyxus)
  • Hit Run button
  • Double-click table column headers
haase-19-05-2023-17-23-16.mp4

Let me know if I can help tracing down the issue and thanks again for working on this!

@JesseMckinzie
Copy link
Member

Hi @haesleinhuepf,

Thanks for the detailed instructions on how to reproduce the bug. I will take a look and get it fixed. Thanks for reporting this!

Jesse

@haesleinhuepf
Copy link
Contributor Author

@JesseMckinzie : I think I found the bug. I'll send a PR.

@haesleinhuepf
Copy link
Contributor Author

Sorry, one more question: The slider-dialog that opens on the bottom right, I'm wondering if it has advanced functionality compared to the slider napari has built-in?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants