RCSTATS

Generate row/column statistics


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


Outputs row or column image statistics to an array segment.
Back to top

Parameters


Name Type Caption Length Value range
FILE * String Input file name 1 - 192  
DBIC * Integer Input raster channel 1 - 1  
DBIW Integer Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
EXCLUDE Float Gray levels to exclude 0 - 16  
ARRAYOP String Statistics array operation 0 - 7 Default: COLMEAN
ARRSEG Integer Output array segment 0 - 1  
DBSN String Output array segment name 0 - 192  
DBSD String Output array segment description 0 - 192  
IMSTAT Float Image Statistics 0 - 6  

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK file that contains the image channel from which to produce row/column statistics.

DBIC

Specifies the image channel to use to generate the row/column statistics.

DBIW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) that is read from the input image. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

EXCLUDE

Optionally specifies ranges of gray-level values to exclude when generating the row/column statistics. If this parameter is not specified, all gray levels in the image window are used.

This parameter can be set as follows:

Ranges are specified in pairs of values. In each pair, the first value is the beginning of the range and the second is the end of the range. The exception here is that, if there is an odd number of values, the last value is used as a range of one value.

For example:

EXCLUDE = 1,1,20,31.7,41.3

In this example, pixels with a gray-level value of 1 (that is, a range of 1 to 1) or in the range of 20 to 31.7, or a gray level of 41.3 (that is, a range of 41.3 to 41.3) are excluded.

ARRAYOP

Optionally specifies the row or column statistics to output. If this parameter is not specified, the only column means are output.

Available options are:

ARRSEG

Optionally specifies the number of the array segment to receive the row/column statistics. If this parameter is not specified, a new array segment (type 181) is created.

If an existing segment is to be overwritten but is too small to contain the output statistics, RCSTATS exits in error.

DBSN

Optionally specifies a name (up to 8 characters) for the output segment, if one is created.

If this parameter is not specified, the default name "ARRAYOP" is used.

DBSD

Optionally describes (in up to 64 characters) the contents or origins of the output array segment.

IMSTAT

This is an output parameter and requires no user input.

Upon completion, RCSTATS writes out to the IMSTAT parameter the following information about the processed image window:

If no pixels were processed because of the EXCLUDE parameter, the IMSTAT array elements will be zeroed.

Back to top

Details

RCSTATS generates column or row image statistics and writes them to an array segment. The operations available for columns or rows are means, sums, standard deviations, variances, minimums, or maximums.

The input image file (FILE) contains the image channel (DBIC) to process. You can define a specific area to process (DBIW); otherwise, the entire image channel is processed.

You may also specify values to exclude when generating the statistics, using the EXCLUDE parameter. If this parameter is not specified, all gray levels in the image window are processed.

The ARRAYOP (Output Statistics Mode) parameter defines which statistics to generate. Available options are:

You may specify an existing array segment (ARRSEG) to overwrite. Note, however, that if the existing segment is too small to contain the output statistics, RCSTATS will exit in error.

If the output array segment is not specified, a new array segment is created and appended to the end of the input file. If a new array segment is created, the segment name (DBSN) and description (DBSD) can be be specified.

RCSTATS writes the image window statistics to the output parameter IMSTAT.

Statistics

Only image data in the image window (DBIW) and outside the exclusion range (EXCLUDE) is used as input to the statistics. For example, the column statistics available are:

COLMEAN	=	sum(  graylevels ) / count
COLSUM	=	sum(  graylevels )
COLSD	=	sqrt( sum( (graylevel - COLMEAN)**2 ) / (count - 1) )
COLVAR	=	sum( (graylevel - COLMEAN)**2 ) / (count - 1)
COLMIN	=	min(  graylevels )
COLMAX	=	max(  graylevels )
where:

The row statistics apply to the discussion above by substituting ROW for COL and "row" for "column". The image statistics output to the IMSTAT parameter apply by substituting "image" for "column".

Back to top

Example

EASI>file	=	'irvine.pix'	! input file name
EASI>dbic	=	1	! input channel
EASI>dbiw	=		! default, process entire channel
EASI>exclude	=		! default, use all imagery
EASI>arrayop	=		! default, COLMEAN
EASI>arrseg	=		! default, create new array segment
EASI>dbsn	=	''	! default, use ARRAYOP as name 
EASI>dbsd	=	''	! default, no description
EASI>imstat	=		! output statistics

EASI>RUN RCSTATS

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.