Description
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.