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

Make a feature histogram exploration widget #58

Closed
jo-mueller opened this issue Oct 13, 2022 · 10 comments · Fixed by #216
Closed

Make a feature histogram exploration widget #58

jo-mueller opened this issue Oct 13, 2022 · 10 comments · Fixed by #216
Labels
New feature New feature or request

Comments

@jo-mueller
Copy link
Contributor

jo-mueller commented Oct 13, 2022

Feature proposal

Hi @dstansby ,

I created a feature exploration widget in a different repository together with @zoccoler which shows a Layer.features in a histogram along with the cumulative density function. I think it would make sense to move it upstream (e.g., here) - what do you think of it?

Here's a small demo of how it looks/works:
ezgif com-gif-maker

The plugin is currently inheriting from HistogramWidget.

@dstansby
Copy link
Member

Oooh this looks interesting! Could you post or link to a higher resolution movie of the gif above? I can't make out the text in the plugin.

Do you have a short summary of what extra features the widget would add on top of HistogramWidget too? Perhaps we could consider just adding some of that functionality directly to HistogramWidget?

@jo-mueller
Copy link
Contributor Author

jo-mueller commented Oct 20, 2022

Thanks for the reply, will make a higher resolution gif as soon as possible 😃

As for adding the functionality to the Histogram Widget - not sure. The Histogram widget shows actual pixel intensities of an image layer whereas the example above shows features associated with any layer that supports features. Conceptionally I think it's actually closer to the ScatterBaseWidget🤔

Edit: Maybe we could merge the two functionalities ScatterBaseWidget and this histogram widget into some sort of feature exploration widget?

In the Scatter widget, this could mean:

  • only one feature is selected in the axis dropdowns --> draw histogram
  • two features are selected --> draw scatter plot

@jo-mueller
Copy link
Contributor Author

@dstansby here's a more high-res screenshot
Capture

The CDF button shows the cumulative density function:
Capture

@dstansby
Copy link
Member

Thanks for those images - I think this would be a really nice feature to add. It looks like there might be lots of smaller bits here (the image selection, changing the number of bins, adding a CDF, changing the percentiles, exporting as csv) that could be built incrementally on top of the existing histogram widget. I would strongly prefer for these features to be added in as small as possible chunks in individual PRs, which will make it much easier to review. How does that sound?

I don't have time to work or review this now, but in the new year have CZI funding to work on napari-matplotlib and I will definitely add this to our todo list 😄

@dstansby dstansby added the New feature New feature or request label Nov 16, 2022
@jo-mueller
Copy link
Contributor Author

Hi @dstansby ,

thanks for the feedback! I agree, it does make sense to build this on top of the existing histogram rather than building several widgets for specific layers. I guess the key thing would be to build the current histogram widget to feed the data from

  • image intensity if an Image layer is selected
  • layer.features if any other layer is selected?

@dstansby
Copy link
Member

👍 sounds good - PRs very welcome! I think the Historgram widget should do Image intensity for a grayscale image, are you looking for intensity for an RGB image?

@jo-mueller
Copy link
Contributor Author

Nah, I don't do RGB much, so as long as nobody complains I would leave it at that (material for another PR, I guess)

@jo-mueller
Copy link
Contributor Author

Hi @dstansby ,

with #148 merged, would you be interested in bringing the second half of this (e.g., coloring the bars of the histogram according to colormap/face_colormap/edge_colormap of the layer) to the features histogram? I think it could be done with a relatively small change here after drawing the histogram.

@dstansby
Copy link
Member

Thanks for the reminder for this issue! Mirroring the colourmap of the histgoram with the layer colourmap would definitely be a welcome feature 👍

@jo-mueller
Copy link
Contributor Author

Thanks for merging!

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

Successfully merging a pull request may close this issue.

2 participants