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

Support modes other than nearest neighbour downsampling for HeatmapVis #1721

Open
stufisher opened this issue Dec 5, 2024 · 6 comments
Open
Labels
enhancement New feature or request

Comments

@stufisher
Copy link

For diffraction applications it would be nice to support some sort of filtering beyond nearest neighbour. If you have a diffraction image being displayed at say 1/4 of its size with single pixel diffraction spots you basically cant see anything in <HeatmapVis>. I know @t20100 recently implemented this in silx, i don't know how much work it is for h5web.

@stufisher stufisher added the enhancement New feature or request label Dec 5, 2024
@loichuder
Copy link
Member

i don't know how much work it is for h5web.

Not much, I expect. We should only need to expose minFilter (https://threejs.org/docs/index.html#api/en/textures/DataTexture) up to the needed component.

@stufisher Are you using the HeatmapVis component ? Or a lower/higher component ?

@stufisher
Copy link
Author

I'm using both HeatmapVis and h5web/app

@loichuder
Copy link
Member

So we would need to expose it all the way to HeatmapVis. Unless you have another idea @axelboc ?

@axelboc
Copy link
Contributor

axelboc commented Dec 5, 2024

  • Adding a prop of sorts to HeatmapVis should be doable.
  • For @h5web/app, we're back to the same architectural challenge of allowing the visualizations to be customized/configured. Or we'd have to add a control to the Heatmap toolbar, which has UX implications obviously.

@stufisher
Copy link
Author

<HeatmapVis> alone would already be really useful i think

@t20100
Copy link
Member

t20100 commented Dec 5, 2024

Using a linear minFilter should improve the display but peaks will also disappear at some point.

What is done in silx is a bit different: it takes the maximum (or mean/minimum) of the data points that are inside each pixel of the screen as the displayed value. It's a sort of 2D histogram where each pixel of the screen is a bin.
It's done in Python (so in the case of silx it also works with matplotlib:
https://github.com/silx-kit/silx/blob/a9eddc5917d0d0b5c774d7cc4df3a074cf538ee6/src/silx/gui/plot/items/image_aggregated.py#L105-L129
but that should be possible to do a shader for this as well.

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

No branches or pull requests

4 participants