Help for PIXSTAT
PURPOSE
PIXSTAT is a VICAR applications program for calculating statistical
quantities in local areas surrounding each pixel in an input image.
The local mean, second moment, variance and standard deviation are
quantities that may be obtained.
EXECUTION FORMAT
PIXSTAT IN OUT [NLW,NSW,SCALE,OFFSET,CALC]
where
IN is the input data set (VICAR labeled image).
OUT is the output image of the selected statistic.
NLW is the number of lines in the local area window.
This number must be odd to insure a center line.
The default value is 11. The maximum value is 129
NSW is the number of samples in the local area window.
This number must be odd to insure a center sample.
The default value is 11. The maximum value is 129
SCALE is the scaling factor that each output pixel will be
multiplied by. The default value is 1
OFFSET is the constant which is added to each scaled pixel
befor it is output. The default value is 0
CALC is a keyword selecting the statistic to be calculated.
'MEAN, 'MOMENT, 'VARIANCE and 'SDEV (standard deviation)
are the valid selections. 'SDEV is the default selection.
All numerical parameters are integers.
OPERATION
PIXSTAT performs a sliding window statistical analysis on an input
image. An output pixel's position represents the center position of
the window for the input image and its value represents statistics
based on data within the window only. The window moves along one sample
at a time and one line at a time until each pixel in the input has
been at the center of the window. In other words statistics are
compiled for the local area around each and every pixel in the input
image.
The edge conditions are handled as follows. Any window positions that
extend beyond the edge of the image are handled by using data from the
nearest pixel on the image. This is not a reflection scheme like some
sliding window algorithms have.
Half word input results in half word output. Byte input results in
byte output. This is automatic and requires no specification by the
user. Half word values that exceed the half word maximum integer value
(32767) are set to 32767. Similarly byte values that exceed 255 are
set to 255. Input images must have less than 4001 samples. There is
no limit to the number of lines in the input.
EQUATIONS
MEAN
The mean is a result of the sum of all DN values in the
window divided by the number of pixels in the window.
(the average of the DNs)
WINDOWSUM / NPIXWNDO
SECOND MOMENT
The second moment is a result of the sum of the squares
of all DN values in the window divided by the number of
pixels in the window. (the average of the squares of the DNs)
DNSQRSUM / NPIXWNDO
VARIANCE
The variance is the difference between the second moment
and the square of the mean.(average square - average squared)
SECOND MOMENT - MEAN ** 2
STANDARD DEVIATION
The standard deviation is the square root of the variance.
VARIANCE ** 0.5
Original Programmer: Leo Bynum March 1985
Cognizant Programmer: Leo Bynum
Revision 3 May 1988
PARAMETERS:
INP
INPUT IMAGE FILE
OUT
OUTPUT IMAGE FILE
NLW
NUMBER OF LINES IN THE WINDOW
OVER WHICH THE CALCULATION
WILL BE PREFORMED (ODD)
NSW
NUMBER OF SAMPLES IN THE WINDOW
OVER WHICH THE CALCULATION
WILL BE PREFORMED (ODD)
SCALE
SCALE FACTOR BY WHICH EACH PIXEL
WILL BE MULTIPLIED
OFFSET
OFFSET ADDED TO EACH PIXEL
TO BE OUTPUT
CALC
OUTPUT VALUES WILL REPRESENT
ONE OF THE FOLLOWING:
MEAN, SDEV, MOMENT, VARIANCE
NL
Number of input lines
NS
Number of input samples
(Maximum 4000)
SL
Starting line
SS
Starting sample
SIZE
Standard VICAR size field
See Examples:
Cognizant Programmer: