Closed
Description
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:
The plugin is currently inheriting from HistogramWidget
.
Activity
dstansby commentedon Oct 19, 2022
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 toHistogramWidget
?jo-mueller commentedon 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:
jo-mueller commentedon Nov 1, 2022
@dstansby here's a more high-res screenshot

The CDF button shows the cumulative density function:

dstansby commentedon Nov 16, 2022
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 commentedon Nov 16, 2022
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
layer is selectedlayer.features
if any other layer is selected?dstansby commentedon Nov 16, 2022
👍 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 commentedon Nov 16, 2022
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 commentedon Aug 31, 2023
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 commentedon Aug 31, 2023
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 commentedon Nov 2, 2023
Thanks for merging!