next up previous index
Next: ``3-D histogram'' - compute Up: Measurement Previous: ``volume properties'' - Compute

``histogram'' - compute a histogram of a volume

VFX name:
iHistogram
IMPROMPTU Equivalent:
Histogram
purpose:
Make a histogram of some property of the input volume. Two types of histograms can be made:
1.
The standard grayscale histogram. The x-axis gives the grayscale bin number and the y-axis gives the number of voxels in the volume that lie within a particular grayscale bin. This only requires one input volume.
2.
A histogram of {sum f(G)} versus G, where G represents grayscale bin number. Two volumes are needed for this type of histogram. Let v1 and v2 be the two input volumes. For a grayscale bin G, find all voxels in v1 that lie in G. Then, for these voxels, sum their respective values f(G) in v2 - this gives {sum f(G)}.
The second type of histogram is useful for computing the sum of gradient values versus grayscale, a potentially useful quantity for automatic thresholding [2].

An option exists to smooth or not smooth a histogram. The smoothing is done using a 5-point Hamming window and gives a much cleaner histogram [22].

The output is a file called ``histogram.stats'' and can be plotted using the ANALYZE PLOT program. Column 1 is the grayscale bin number and column 2 is the y axis.

input:
One or two 8-bit grayscale volumes.
output:
A file called histogram.stats that contains the desired histogram.
parameters:
Default parameters menu is
levels_per_bin = 1
smooth_hist = yes
use_volumes = input_only
image_out = undefined
second_volume = 0
You do not have to have one histogram bin per graylevel value. By using the parameter setting ``levels_per_bin = 3'', for example, you can have 3 graylevels per bin. This typically gives a smoother fuller histogram.

To make a histogram using two volumes, toggle the option ``use_volumes = ''. To only use one, leave the parameter at its default. The ``second_volume = '' parameter is only used when the two-volume histogram option is elected.

comments:
1.
A moderately fast function.
2.
I generally recommend always smoothing the histogram and using more than one grayscale value per bin. This gives much smoother results.


next up previous index
Next: ``3-D histogram'' - compute Up: Measurement Previous: ``volume properties'' - Compute
MultiDimensional Image Processing Lab, Penn State University