HistogramLUTItem¶
-
class
pyqtgraph.
HistogramLUTItem
(image=None, fillHistogram=True, rgbHistogram=False, levelMode='mono')[source]¶ This is a graphicsWidget which provides controls for adjusting the display of an image.
Includes:
Image histogram
Movable region over histogram to select black/white levels
Gradient editor to define color lookup table for single-channel images
image
(
ImageItem
orNone
) If image is provided, then the control will be automatically linked to the image and changes to the control will be immediately reflected in the image’s appearance.fillHistogram
(bool) By default, the histogram is rendered with a fill. For performance, set
fillHistogram=False
rgbHistogram
(bool) Sets whether the histogram is computed once over all channels of the image, or once per channel.
levelMode
‘mono’ or ‘rgba’. If ‘mono’, then only a single set of black/white level lines is drawn, and the levels apply to all channels in the image. If ‘rgba’, then one set of levels is drawn for each channel.
-
getLevels
()[source]¶ Return the min and max levels.
For rgba mode, this returns a list of the levels for each channel.
-
getLookupTable
(img=None, n=None, alpha=None)[source]¶ Return a lookup table from the color gradient defined by this HistogramLUTItem.
-
setHistogramRange
(mn, mx, padding=0.1)[source]¶ Set the Y range on the histogram plot. This disables auto-scaling.
-
setImageItem
(img)[source]¶ Set an ImageItem to have its levels and LUT automatically controlled by this HistogramLUTItem.