DATAMANIP commands


PROGRAM NAME

khstr - Perform Histogram Stretching

DESCRIPTION

The Stretch Histogram operator (khstr) is used to perform histogram stretching on the Input object (i). The idea is to spread out the histogram values to fully occupy the range of the data type to enhance detail that would be otherwise lost. The grey levels in the data can be optionally inverted after histogram processing (this is often helpful for astronomical data).

Histogram stretching employs a simple linear mapping. Stretching can bring out some detail but preserves the relative brightness of the data. Histogram stretching is described in detail in texts on image processing.

If a mask is present with the input object, data points that are masked off are ignored in the histogramming. The mask is propagated to the output object.

If a map is present with the input object, all data will be pulled through the mask before histogramming. The output object will have no map.

For signed data types, the output will span the whole range of the data type, just as for the unsigned data types. Note that for signed types, this will include the negative part of the range. If this behavior is not desired, the data should be converted to unsigned prior to the application of the histogram stretching.

The data types that can be handled are currently limited to signed and unsigned byte, and signed and unsigned short integer. The number of bits in a data point is further limited by the internal algorithms to be at most 16, signed or unsigned. If an otherwise acceptable data type is found that exceeds 16 bits (say a 32 bit short) then an error message will be printed. Resolution of this problem is architecture dependent.

The histogram stretching can be performed in units of data that can span any of the polymorphic data model dimensions. By default, the unit is composed of 2D planes across width and height (i.e. a normal "image"). It is possible to select processing in volumes, sequences, slices, rows, columns or the whole 5D data set if that is desired. Each unit is histogrammed independently of the others.

This operator supports processing of large data sets via data services. Data access speed is a function of the processing unit dimensions, so significant processing time variance can be observed for varying unit geometries even though the total number of points processed is the same.

Executing Stretch Histogram runs the program khistops with the -stretch flag.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input data object
-o
type: outfile
desc: Resulting output data object

OPTIONAL ARGUMENTS

-invert
type: flag
desc: invert grey levels after processing

Mutually Exclusive Group; if desired, specify ONE of:

-whole
type: flag
desc: process whole data set at one time
OR

AT LEAST ONE OF the Group:

-w
type: flag
desc: include width in processing unit
AND/OR
-h
type: flag
desc: include height in processing unit
AND/OR
-d
type: flag
desc: include depth in processing unit
AND/OR
-t
type: flag
desc: include time in processing unit
AND/OR
-e
type: flag
desc: include elements in processing unit

EXAMPLES

SEE ALSO

DATAMANIP::khistops, DATAMANIP::kheq, DATAMANIP::khisto

RESTRICTIONS

Only KBYTE, KUBYTE, KSHORT, and KUSHORT data is supported, and only then if they are 16 bits or less in length.

REFERENCES

R.C. Gonzalez and P.A. Wintz, "Digital Image Processing", Addison-Wesley, 1987, ISBN 0-201-11026-1.

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.