HISDUMP

Image histogram export


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

Back to top

Description


HISDUMP generates an image histogram report for one or more import channels. The report lists the pixel values and their counts.
Back to top

Parameters


hisdump(file, dbic, mask, hisw, hisform)

Name Type Caption Length Value range
FILE * str Input file name 1 -    
DBIC * List[int] Input raster channel(s) 1 -    
MASK List[int] Area mask 0 - 4  
HISW List[float] Histogram window 0 - 4  
HISFORM str Output histogram report format 0 - 9 RAW | RANGE | HITRANGE | CENTER | HITCENTER
Default: HITCENTER

* Required parameter
Back to top

Parameter descriptions

FILE

The name of the PCIDSK image file containing the channel or channels to histogram.

DBIC

The image channels from which to extract histogram data.

MASK

The window or bitmap that defines the area to process within the input raster.

If a single value is specified, that value represents the channel number of the bitmap segment in the input file. Only the pixels under the bitmap are processed; the rest of the image remains unchanged.

If four values are specified, they define the x,y offsets and x,y dimensions of a rectangular window identifying the area to process. 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.

If no value is specified, the entire channel is processed.

HISW

The minimum and maximum gray-level values to collect for the histogram.

If no value is specified for this parameter, the default depends on the type of the input channel:
Note: This parameter gives the low bound of the first bin and the upper bound of the highest bin; it does not specify the center of the first and last bins. Pixels that do not fall within the binning range are ignored and not included in the histogram.

HISFORM

The format of the output histogram report.

Available options are:
Back to top

Details

HISDUMP computes a histogram of one or more image channels, and exports (dumps) the result to a report file you specify. The format of the report is intended for ease of reading for statistical analysis by other functions, rather than be easily human-readable.

Note: You can generate a histogram report in a more easy-to-read format by running the HIS algorithm. CATALYST Professional Focus also has an interactive histogram tool with which you can generate a text data file or PostScript plots.

The source image channels are read from an input image file. If you want to restrict the set of pixels sampled, you can specify a window or graphic plane using the Mask (MASK) parameter.

When computing a histogram, HISDUMP establishes a histogram table with each entry in the table called a bin. A particular bin will contain a count of all sampled pixels that fall within the bin minimum (inclusive) and maximum (not included) gray-level values. You can control the overall binning range by specifying a value for the Histogram Window (HISW) parameter.

With the Histogram Dump Format (HISFORM) parameter, you can control the format of the generated histogram report. The simplest form is a "RAW" report, which generates one report line per histogram table bin, with the line containing the counts for each input channel sampled. The RANGE and CENTER report types add a column at the beginning of each line that contains the gray-level range for the bin, or the central gray-level value for the bin. The HITRANGE and HITCENTER report types are similar, but contain only lines for bins that have at least one nonzero count.

Back to top

Example

Generate a report with the histogram information for 8-bit channels from irvine.pix under one of the bit masks. Because this is 8-bit data, you do not need to control the binning.

from pci.hisdump import hisdump

file	=	r'/demo/irvine.pix'
dbic	=	[1,2,3,4,5]
mask	=	[9]	# process under bitmap 9
hisw	=	[]	# no specific histogram window
hisform	=	''	# default HITCENTER

hisdump ( file, dbic, mask, hisw, hisform )

The first 12 lines of report are shown here. The first column is the gray-level value for the center of the sampled bins followed by the counts for each bin, from channels one through five.

  0          0          0          0          0         15 
  1          0          0          0          0         25 
  2          0          0          0          0         66 
  3          0          0          0          4         91 
  4          0          0          0          3        125 
  5          0          0          0          9         77 
  6          0          0          1         22         34 
  7          0          0          0         25         12 
  8          0          0          0         38          6 
  9          0          0          1        103          3 
 10          0          0          0        172          3 
 11          0          0          2         44          4

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