Skip to content

Make a feature histogram exploration widget #58

Closed
@jo-mueller

Description

@jo-mueller

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.

Activity

dstansby

dstansby commented on Oct 19, 2022

@dstansby
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

jo-mueller commented on Oct 20, 2022

@jo-mueller
ContributorAuthor

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

jo-mueller commented on Nov 1, 2022

@jo-mueller
ContributorAuthor

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

The CDF button shows the cumulative density function:
Capture

dstansby

dstansby commented on Nov 16, 2022

@dstansby
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 😄

jo-mueller

jo-mueller commented on Nov 16, 2022

@jo-mueller
ContributorAuthor

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

dstansby commented on Nov 16, 2022

@dstansby
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

jo-mueller commented on Nov 16, 2022

@jo-mueller
ContributorAuthor

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

jo-mueller commented on Aug 31, 2023

@jo-mueller
ContributorAuthor

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

dstansby commented on Aug 31, 2023

@dstansby
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

jo-mueller commented on Nov 2, 2023

@jo-mueller
ContributorAuthor

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    New featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Make a feature histogram exploration widget · Issue #58 · matplotlib/napari-matplotlib