next up previous
Next: ``3-D histogram'' -- Up: Manipulation Previous: ``Gray-scale inversion'' --

 

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

 

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
no. of graylevels per bin = 2
* smooth histogram = yes
* use volumes = input only
* input from vol # = 0
* second volume = 0
*
You do not have to have one histogram bin per graylevel value. By using the parameter setting ``no. of graylevels 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
Next: ``3-D histogram'' -- Up: Manipulation Previous: ``Gray-scale inversion'' --



 

Philip Americus
The Multidimensional Image Processing Lab
Fri Aug 30 10:26:42 EDT 1996