Hist2 - Histogram MLx Home | MLx menu | MLx buttons | Widgets | Index | What's New

Example

This is a flexible histogramming utility that works on the real (actual) image data, rather than the scaled image data. Hist1 is faster, works on the scaled data, and reflects the threshold slider bar.

Note that the image being histogrammed is the front gray scale image - if there are other images in front that are RGB images, for example, they will be ignored.


Example top

 Without zooming (which is not necessary here, and just increases the file size of the illustration) there is not enough room for the image name. The blue lettering is another way to show the image name for small images - see Annotate. Anyway, the image as read in looks like this.  

 This is included here for comparison with Hist2. Note the 'toothed' appearance - similar to the hist1 example.  

Clicking on the histogram displays the x (scaled pixel value) and val (number of pixels with this value for that x position (the y position of the cursor when clicking does not matter). Red arrows show clicked position and readout for the maximum peak on the histogram.

Black number to the upper left shows the maximum value for the plot (compare with the blue val: value).

Dragging vertically (green arrows) changes the y scale of the plot. Values that are past the top of the plot (greater than the black number at the upper left) wrap around.

 This histogram has been altered a bit by dragging (blue arrow - see below) and changing the bin size (violet arrow - see below).  

This histogramming tool allows zooming in on any portion of the actual data, and changing the bin size:

  1. Vertical dragging (green arrow) changes the y scale as in hist1.
  2. Clicking without dragging displays the values for the appropriate bin: The bin index, the bin count, and the range of values in the bin.
  3. Horizontal dragging (like green arrow but horizontal) shows the bin index range, integrated counts for that range, and the range of values for those bins.
  4. Dragging the little dark green circle (purple arrow) changes the bin size. Bin width of one pixel (the smallest that it is sensible to plot) is all the way to the left, and a bin width of the plot is all the way to the right. Logarithmic spacing in between - which you will notice as you move the circle, as the bin width is contstrained to integral number of pixels.
  5. Resizing the window makes the plot wider without changing the bin size, so the number of bins increases.
  6. Dragging to one of the overflow bins (blue arrow) zooms in on the histogram, putting all of the bins you just dragged over into the overflow bin. There is a corresponding overflow bin on the right side. The gray level in the bin is a lograthmic display of the counts in the bin (display of the histogram is linear), with the top being the total counts for all of the data.
  7. Clicking on either of the overflow bins will empty that bin, resetting the histogram appropriately.