Skip to content

improvements for heatmap and histogram #86

Closed

Description

@kushalkolar

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.

Activity

  1. kushalkolar commented on Mar 1, 2023

    @kushalkolar
    MemberAuthor

    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))
  2. kushalkolar commented on Mar 4, 2023

    @kushalkolar
    MemberAuthor

    heatmap being done in #143

  3. kushalkolar commented on Oct 28, 2023

    @kushalkolar
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions