GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Histogram widget functionality, vmin, vmap, etc. · Issue #557 · fastplotlib/fastplotlib

Histogram widget functionality, vmin, vmap, etc.  #557

New issue
Copy link
New issue
Copy link
Open
Open
Histogram widget functionality, vmin, vmap, etc. #557
Copy link

Description

@apasarkar
apasarkar
opened on Jul 18, 2024
Issue body actions

Expanding on discussion from #555, wanted to outline a couple situations where the current Histogram widget functionality should be expanded.

(1) Fine-grained vmin/vmax control for each ImageWidget panel. Right now, via the ImageWidget constructor, you can specify a global vmin/vmax for all panels in the graphic, like this:

iw = ImageWidget(data, figure_kwargs={"shape":(3,1)}, graphic_kwargs={"vmin":1, "vmax":30}) iw.show()

This fixes every ImageGraphic to the same vmax/vmin. There are definitely many cases where we'd want to modify the vmax/vmin for different panels.

(2) In many cases we just want the adjustable contrast (i.e. the ability to use the Linear Selectors to toggle the vmin and vmax of each ImageGraphic) without actually computing a histogram.

(3) Ability to turn off histograms/scalebars for some panels but not others. For example in calcium imaging maybe I want to show colorbars for extracted sources (in grayscale). However it's less meaningful to do so for RGB, so I'd like to avoid that.

Here is one possible path forward:

  • In the ImageWidget constructor, replace histogram_widget (currently a True/False value) with a list where we specify for each dataset whether we include a histogram, what the vmin/vmax are, etc.

  • Rename HistogramLUT to ContrastLUT - it now functions more generally as an interactive colorbar. We can add to its constructor the option to include/exclude histogram calculation. As @kushalkolar mentioned in Figure_shape in imagewidget and related histogram widget bug fix #555 if histogram calculation is disabled, the "histogram" is just constant across all bins.

  • HistogramLUT now has vmin/vmax options. If these are not provided, HistogramLUT continues to use the vmin/vmax from ImageGraphic.

Activity

  1. kushalkolar commented on Jul 19, 2024

    @kushalkolar
    kushalkolar
    on Jul 19, 2024
    Member
    More actions

    (1) Fine-grained vmin/vmax control for each ImageWidget panel. Right now, via the ImageWidget constructor, you can specify a global vmin/vmax for all panels in the graphic, like this:

    iw = ImageWidget(data, figure_kwargs={"shape":(3,1)}, graphic_kwargs={"vmin":1, "vmax":30}) iw.show()

    Do you think this could become too many kwargs and lots of possible combinations to parse, what about setting them afterwards:

    iw = ImageWidget(data)
    for subplot in iw.figure:
      ig = subplot["image_widget_managed"]
      ig.vmin, ig.vmax = <pre determined vmin vmax>

    (2) In many cases we just want the adjustable contrast ... without actually computing a histogram.

    (3) Ability to turn off histograms/scalebars for some panels but not others.

    Sounds good to me, @clewis7 what do you think?

    What about:

    1. ColorbarLUTTool: basically what we have now except for the histogram, also see add colorbar to hlut tool, add pause_events() context manager #550
    2. HistogramLUTTool, subclasses ColorbarLUTTool and just adds the histogram

    In ImageWidget they can specify a kwarg like contrast_tool=["histogram", "colorbar", None], makes it easy to parse.

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

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.