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

improvements for heatmap and histogram #86

Closed
1 of 2 tasks
kushalkolar opened this issue Dec 25, 2022 · 3 comments
Closed
1 of 2 tasks

improvements for heatmap and histogram #86

kushalkolar opened this issue Dec 25, 2022 · 3 comments

Comments

@kushalkolar
Copy link
Member

kushalkolar commented Dec 25, 2022

heatmap and histogram need some improvements, histogram is currently broken after #78

  • heatmaps for data larger than 8192, as discussed before this is a WGPU limitation. Need to stitch together multiple pygfx.Image world objects
  • histogram is broken because histogram "data" is different from the graphic data. I think we should subclass DataFeature to make one specific to histograms, and it could handle things like each bin and its values. We could add a method to HistogramGraphic to change the scale_factor for displaying it. We might also need to subclass ColorFeature for histograms so that indexing sets the color of each bin.
@kushalkolar kushalkolar mentioned this issue Feb 4, 2023
17 tasks
@kushalkolar
Copy link
Member Author

Some ideas to help with tiling Image WorldObject for heatmaps:

from math import ceil
from itertools import product

chunk_size = 128

x_chunks = range(ceil(mcorr.shape[1] / chunk_size))
y_chunks = range(ceil(mcorr.shape[2] / chunk_size))

chunks = list(product(x_chunks, y_chunks))
# chunks is the position of each chunk

start_ixs = [list(map(lambda c: c * chunk_size, chunk)) for chunk in chunks]
stop_ixs = [list(map(lambda c: c + chunk_size, chunk)) for chunk in start_ixs]

grid = list()
for start, stop in zip(start_ixs, stop_ixs):
    x0, y0 = start
    x1, y1 = stop
    grid.append(data[:, x0:x1, y0:y1].mean(0))

@kushalkolar
Copy link
Member Author

heatmap being done in #143

@kushalkolar
Copy link
Member Author

So we've decided histogram is not happening because current libs more than good enough for histograms, as far as I've experienced.

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

1 participant