H5_BROWSER $RSI/h5_browser.pro
[Previous] [Next]
 NAME:
   H5_BROWSER

 PURPOSE:
   Provides a graphical user interface (GUI) to examine HDF5 files
   and import data into IDL.

 CALLING SEQUENCE:
   Result = H5_BROWSER(Files [, /DIALOG_READ] )

 RETURN VALUE:
   Result: If the DIALOG_READ keyword is set, then the Result is either
          a structure containing the dataset/group, or a 0 if the Cancel
          button was pressed.
          If DIALOG_READ is not set, then the Result is the widget ID
          for the base widget.

 INPUTS:
   Files: A scalar or array of strings giving the file(s) to open
          in the browser. Users can also interactively import new files.
          Files may contain wildcard characters.

 KEYWORD PARAMETERS:

   DIALOG_READ = If this keyword is set then the HDF5 browser is created
          as a modal Open/Cancel dialog instead of a standalone GUI.
          In this case, the IDL command line is blocked, and no further
          input is taken until the Open or Cancel button is pressed.
          If the GROUP_LEADER keyword is specified, then that widget ID
          is used as the group leader, otherwise a default group leader
          base is created.

   All keywords to WIDGET_BASE such as GROUP_LEADER, TITLE, etc.
   are passed on to the top level base.


 EXAMPLE
   file = FILEPATH('hdf5_test.h5', SUBDIR=['examples','data'])
   r = H5_BROWSER(file)

 CALLS: ***
	ARRAY_INDICES, CONGRID, CW_TREESTRUCTURE, FILEPATH, H5_BROWSER_ADDFILE
	H5_BROWSER_CHECKNAME, H5_BROWSER_EVENT, H5_BROWSER_FILEEXIT
	H5_BROWSER_FILEOPEN, H5_BROWSER_GET_PALETTE, H5_BROWSER_IMPORT
	H5_BROWSER_KILLNOTIFY, H5_BROWSER_PARSEVALUE, H5_BROWSER_STRMIXCASE
	H5_BROWSER_TOGGLE, H5_BROWSER_TREE_EVENT, H5_BROWSER_TREE_PREVIEW, H5_PARSE
	LOADCT, REVERSE, STRSPLIT, XMANAGER
 MODIFICATION HISTORY:
   Written by:  CT, RSI, June 2002
   Modified by:
       AJ, CREASO B.V., February 12th 2003: Use with ENVI


H5_CREATE $RSI/h5_create.pro
[Previous] [Next]
 NAME:
   H5_CREATE

 PURPOSE:
   Creates an HDF5 file based on a nested structure containing all of
   the groups, datasets, and attributes.

 CALLING SEQUENCE:

   H5_CREATE, File, Data

 INPUTS:

   FILE: A scalar string giving the file to parse.

   DATA: A (nested) structure


 KEYWORD PARAMETERS:

   NONE

 CALLS: ***
	H5_CREATE_IDL_CREATE, IDLFFH5CREATE::H5_CREATE_ATTRIBUTE
	IDLFFH5CREATE::H5_CREATE_DATASET, IDLFFH5CREATE::H5_CREATE_DATATYPE
	IDLFFH5CREATE::H5_CREATE_DATATYPE_GET_DATA, IDLFFH5CREATE::H5_CREATE_GROUP
	IDLFFH5CREATE::H5_CREATE_IDL_CREATE
	IDLFFH5CREATE::H5_CREATE_IDL_CREATE_STRUCT, IDLFFH5CREATE::H5_CREATE_LINK
	IDLFFH5CREATE::H5_CREATE_VALIDATE_STRUCTURE, IDLFFH5CREATE::INIT
	IDLFFH5CREATE__DEFINE
 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, August 2004
   Modified by:


H5_PARSE $RSI/h5_parse.pro
[Previous] [Next]
 NAME:
   H5_PARSE

 PURPOSE:
   Parses an HDF5 file and returns a nested structure containing all of
   the groups, datasets, and attributes.

 CALLING SEQUENCE:

   Result = H5_PARSE(File [, /READ_DATA])
 or
   Result = H5_PARSE(Hid, Name
             [, FILE=string] [, PATH=string] [, /READ_DATA])

 RETURN VALUE:
   Result: A nested structure.

 INPUTS:

   File: A scalar string giving the file to parse.

   Hid: An integer giving the identifier of the file or
        group in which to access the object.

   Name: A string giving the name of the group, dataset, or datatype
         within Hid to parse.


 KEYWORD PARAMETERS:

   FILE = Set this optional keyword to a string containing the filename
          to which the Hid belongs. This value is only used to fill
          in the FILE field within the structure.
          This keyword is ignored when the File argument is supplied.

   PATH = Set this optional keyword to a string containing the fully
          qualified path within the HDF5 file of the Hid group.
          This value is only used to fill in the PATH field
          within the structure.
          This keyword is ignored when the File argument is supplied.

   READ_DATA = Set this keyword to automatically read in all data
          while parsing the file. The default is to only read datasets
          or attributes with 10 elements or less.


 CALLS: ***
	H5_ATTRIBUTE_PARSE, H5_DATASET_PARSE, H5_DATASPACE_PARSE, H5_DATATYPE_PARSE
	H5_GROUP_PARSE, H5_OBJECT_PARSE, H5_PARSE_ATTRIBUTES, H5_PARSE_READDATA
	H5_PARSE_VALIDATE_TAGNAME
 CALLED BY:
	H5_BROWSER
 EXAMPLE:

  Parsing an entire file:
     file = FILEPATH('hdf5_test.h5', SUBDIR=['examples','data'])
     struc = H5_PARSE(file, /READ_DATA)
     image = struc.images.eskimo
     palette = struc.images.eskimo_palette
     DEVICE, DECOMPOSED=0
     WINDOW, XSIZE=image._dimensions[0], YSIZE=image._dimensions[1]
     TVLCT, TRANSPOSE(palette._data)
     TV, image._data, /ORDER

  Parsing an already open group:
     hid = H5F_OPEN(file)
     gid = H5G_OPEN(hid, '/arrays')
     struc = H5_PARSE(gid, '2D float array', $
           FILE='hdf5_test.h5', PATH='/arrays', /READ_DATA)
     TVSCL, struc._data


 MODIFICATION HISTORY:
   Written by:  CT, RSI, June 2002
   Modified by:


H5T_ENUM_GET_DATA $RSI/h5t_enum_get_data.pro
[Previous] [Next]
 NAME:
   H5T_ENUM_GET_DATA

 PURPOSE:
   Retrieves all the data from an enumeration datatype and bundles it
   up into an array of structures.

 CALLING SEQUENCE:
   result = H5T_ENUM_GET_DATA(datatype_id)

 PARAMETERS:
   DATATYPE_ID : An integer giving the identifier of the enumeration
   datatype.

 KEYWORD PARAMETERS:
   NONE

 CALLED BY:
	H5T_ENUM_VALUES_TO_NAMES
 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, June 2005
   Modified:


H5T_ENUM_SET_DATA $RSI/h5t_enum_set_data.pro
[Previous] [Next]
 NAME:
   H5T_ENUM_SET_DATA

 PURPOSE:
   Sets multiple name/value data pairs on an enumeration datatype.

 CALLING SEQUENCE:
   H5T_ENUM_SET_DATA, datatype_id, data, values

 PARAMETERS:
   DATATYPE_ID - An integer giving the identifier of the enumeration
                 datatype.

   DATA - If Data is a string array then Data gives the names of the
          corresponding members and Values is required. If Data is an
          array of structures, each with two fields, NAME, a string,
          and VALUE, an integer, then Data supplies all the needed
          information and Values is ignored.

   VALUES - An integer array giving the values of the corresponding
            members.  This is needed only if Data is a string array.

 KEYWORD PARAMETERS:
   NONE

 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, June 2005
   Modified:


H5T_ENUM_VALUES_TO_NAMES $RSI/h5t_enum_values_to_names.pro
[Previous] [Next]
 NAME:
   H5T_ENUM_VALUES_TO_NAMES

 PURPOSE:
   Converts values returned from H5D_READ to names

 CALLING SEQUENCE:
   result = H5T_ENUM_VALUES_TO_NAMES(datatype_id, values)

 PARAMETERS:
   DATATYPE_ID : An integer giving the identifier of the enumeration
   datatype.

   VALUES : A integer array of data returned from H5D_READ.

 KEYWORD PARAMETERS:
   NONE

 CALLS: ***
	H5T_ENUM_GET_DATA
 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, July 2005
   Modified:


H5T_STR_TO_VLEN $RSI/h5t_str_to_vlen.pro
[Previous] [Next]
 NAME:
   H5T_STR_TO_VLEN

 PURPOSE:
   Converts an IDL string array to an IDL_H5_VLEN array of strings

 CALLING SEQUENCE:
   result = H5T_STR_TO_VLEN(array)

 PARAMETERS:
   ARRAY : A string array

 KEYWORD PARAMETERS:
   NO_COPY : If set the original data will be lost after the routine
   exits

 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, July 2005
   Modified:


H5T_VLEN_TO_STR $RSI/h5t_vlen_to_str.pro
[Previous] [Next]
 NAME:
   H5T_VLEN_TO_STR

 PURPOSE:
   Converts an IDL_H5_VLEN array of strings to an IDL string array

 CALLING SEQUENCE:
   result = H5T_VLEN_TO_STR(array)

 PARAMETERS:
   ARRAY : An array of IDL_H5_VLEN structures pointing to strings

 KEYWORD PARAMETERS:
   PTR_FREE : If set then free the pointers in the IDL_H5_VLEN array

 MODIFICATION HISTORY:
   Written by:  AGEH, RSI, July 2005
   Modified:


H_EQ_CT $RSI/h_eq_ct.pro
[Previous] [Next]
 NAME:
	H_EQ_CT

 PURPOSE:
	Histogram-equalize the color tables for an image or a region
	of the display.

 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	H_EQ_CT, Image	;To histogram equalize from an image.
	H_EQ_CT		;To histogram equalize from a region

 INPUTS:
	Image:	Image whose histogram is to be used in determining
		the new color tables.  If this value is omitted, the user 
		is prompted to mark the diagonal corners of a region of the 
		display.

		Image MUST be a byte image, scaled the same way as
		the image loaded to the display.

 OUTPUTS:
	No explicit outputs.  The result is applied to the current color
	tables.

 CALLS: ***
	BOX_CURSOR
 COMMON BLOCKS:
	COLORS:	The IDL color table common block.

 SIDE EFFECTS:
	The current color table is modified.

 RESTRICTIONS:
	If a parameter is supplied, it is assumed to be an image that
	was just displayed.

 PROCEDURE:
	Either the image parameter or the region of the display marked by
	the user is used to obtain a pixel-distribution histogram.  The
	cumulative integral is taken and scaled.  This function is applied
	to the current color tables.

 MODIFICATION HISTORY:
	DMS, March, 1988, written.
	DMS, May, 1990, added BOX_CURSOR.
	AB, 21 September 1992,renamed from HIST_EQUAL_CT to H_EQ_CT to
		avoid DOS filename limitations. HIST_EQUAL_CT is still
		available as a wrapper to this routine under operating
		systems that can handle longer file names.


H_EQ_INT $RSI/h_eq_int.pro
[Previous] [Next]
 NAME:
	H_EQ_INT

 PURPOSE:
	Interactively histogram-equalize the color tables of an image
	or a region of the display.  By moving the cursor across
	the screen, the amount of histogram equalization is varied.

 CATEGORY:
	Image processing.

 CALLING SEQUENCE:
	H_EQ_INT, Image		;To histogram equalize from an image.
	H_EQ_INT		;To histogram equalize from a region.

 INPUTS:
	Image:	The image whose histogram is to be used in determining
		the new color tables.  If this value is omitted, the user
		is prompted to mark the diagonal corners of a region of the
		display.

		Image MUST be a byte image, scaled the same way as
		the image loaded to the display.

 OUTPUTS:
	No explicit outputs.  The result is applied to the current color
	tables.

 COMMON BLOCKS:
	COLORS:	The IDL color table common block.

 SIDE EFFECTS:
	The current color table is modified.

 RESTRICTIONS:
	If a parameter is supplied, it is assumed to be an image that
	was just displayed.

 PROCEDURE:
	Either the image parameter or the region of the display marked by
	the user is used to obtain a pixel-distribution histogram.  The
	cumulative integral is taken and scaled.  This function is applied
	to the current color tables.

	A window is created and the histogram equalization function is
	plotted.

	A linear ramp is overplotted.  Move the cursor from left
	to right to vary the amount of histogram equalization applied to the
	color tables from 0 to 100%.  Press the right mouse button to exit.

 MODIFICATION HISTORY:
	DMS, November, 1989, written.
	AB, 21 September 1992,renamed from HIST_EQUAL_INT to H_EQ_INT to
		avoid DOS filename limitations. HIST_EQUAL_INT is still
		available as a wrapper to this routine under operating
		systems that can handle longer file names.
	JWG, 14 December 1992,routine did not restore font.


HANNING $RSI/hanning.pro
[Previous] [Next]
 NAME:
   HANNING

 PURPOSE:
   Window function for Fourier Transform filtering.  May be used
       for both the Hanning and Hamming windows.

 CATEGORY:
   Signal, image processing.

 CALLING SEQUENCE:
   Result = HANNING(N1) ;For 1 dimension.

   Result = HANNING(N1, N2) ;For 2 dimensions.

 INPUTS:
   N1: The number of columns of the result.

   N2: The number of rows of the result.

 Keyword Parameters:
   ALPHA = width parameter of generalized Hamming window.  Alpha
       must be in the range of 0.5 to 1.0.  If Alpha = 0.5,
       the default, the function is called the "Hanning" window.
       If Alpha = 0.54, the result is called the "Hamming" window.

   DOUBLE = Set this keyword to force the computations to be done
            in double-precision arithmetic.

 OUTPUTS:
   Result(i) = 1/2 [1 - COS(2 PI i / N]

   For two dimensions, the result is the same except that "i" is replaced
   with "i*j", where i and j are the row and column subscripts.

 COMMON BLOCKS:
   None.

 SIDE EFFECTS:
   None.

 RESTRICTIONS:
   None.

 PROCEDURE:
   Straightforward.

 MODIFICATION HISTORY:
   DMS, May, 1987.
   DMS, Jan, 1994. Added generalized width parameter.
   CT, RSI, May 2000: Added double-precision support.
   CT, RSI, August 2001: Changed formula to divide by N rather than N-1.
               This now agrees with Numerical Recipes in C, 2nd ed.


HDF_EOS_QUERY $RSI/eos_query.pro
[Previous] [Next]
 NAME:
   HDF_EOS_QUERY

 PURPOSE:
   Read the header of an HDF file and report on the number of EOS
   extensions as well as their names.

 CATEGORY:
   Input/Output.

 CALLING SEQUENCE:
   Result = EOS_QUERY(File [, Info])

 INPUTS:
   File:   Scalar string giving the name of the HDF file to query.

 Keyword Inputs:
   None.

 OUTPUTS:
   Result is a long with the value of 1 if the query was successful (and the
   file type was correct) or 0 on failure.

   Info: (optional)  An anonymous structure containing information about
		the file.  This structure is valid only when the return value of
       the function is 1.  The Info structure has the following fields:

           Field       IDL data type   Description
           -----       -------------   -----------
           GRID_NAMES	String array	Names of grids
			NUM_GRIDS	Long			Number of grids in file
			NUM_POINTS	Long			Number of points in file
			NUM_SWATHS	Long			Number of swaths in file
			POINT_NAMES	String array	Names of points
			SWATH_NAMES	String array	Names of swaths

 CALLS: ***
	EOS_QUERY, IS_HDF_EOS
 RESTRICTIONS:
   None.

 EXAMPLE:
   To retrieve information from the HDF file named "foo.hdf"
   in the current directory, enter:

       result = EOS_QUERY("foo.hdf", info)
       IF (result GT 0) THEN BEGIN
           HELP, /STRUCT, info
       ENDIF ELSE BEGIN
           PRINT, 'HDF file not found or file does not contain EOS extensions.'
       ENDELSE

 MODIFICATION HISTORY:
   Written December 1998, Scott J. Lasica


HDF_EXISTS $RSI/hdf_exists.pro
[Previous] [Next]
 NAME:
	HDF_EXISTS

 PURPOSE:
	Test for the existence of the HDF library

 CATEGORY:
	File Formats

 CALLING SEQUENCE:
	Result = HDF_EXISTS()

 INPUTS:
	None.

 KEYWORD PARAMETERS:
	None.

 OUTPUTS:
	Returns TRUE (1) if the HDF data format library is
	supported. Returns FALSE(0) if it is not.

 EXAMPLE:
	IF hdf_exists() EQ 0 THEN Fail,"HDF not supported on this machine"

 MODIFICATION HISTORY
	Written by:	Joshua Goldstein,  12/21/92
	Modified by:    Steve Penton,	   12/27/95
					Scott Lasica	8/4/99


HILBERT $RSI/hilbert.pro
[Previous] [Next]
 NAME:
	HILBERT

 PURPOSE:
	Return a series that has all periodic terms shifted by 90 degrees. 

 CATEGORY:
	G2 - Correlation and regression analysis
	A1 - Real arithmetic, number theory.

 CALLING SEQUENCE:
	Result = HILBERT(X [, D])

 INPUT:
	X:	A floating- or complex-valued vector containing any number 
		of elements.

 OPTIONAL INPUT:
	D:	A flag for rotation direction.  Set D to +1 for a 
		positive rotation.  Set D to -1 for a negative rotation.
		If D is not provided, a positive rotation results.

 OUTPUTS:
	Returns the Hilbert transform of the data vector, X.  The output is 
	a complex-valued vector with the same size as the input vector.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	HILBERT uses FFT() so this procedure exhibits the same side 
	effects with respect to input arguments as that function.

 PROCEDURE:
	A Hilbert transform is a series	that has had all periodic components 
	phase-shifted by 90 degrees.  It has the interesting property that the 
	correlation between a series and its own Hilbert transform is 
	mathematically zero.

	The method consists of generating the fast Fourier transform using 
	the FFT() function and shifting the first half of the transform 
	products by +90 degrees and the second half by -90 degrees.  The 
	constant elements in the transform are not changed.

	Angle shifting is accomplished by multiplying or dividing by the 
	complex number, I=(0.0000, 1.0000).  The shifted vector is then
	submitted to FFT() for transformation back to the "time" domain and the
	output is divided by the number elements in the vector to correct for
	multiplication effect peculiar to the FFT algorithm.  

 REVISION HISTORY:
	JUNE, 1985,	Written, Leonard Kramer, IPST (U. of Maryland) on site
			contractor to NASA(Goddard Sp. Flgt. Cntr.)


HIST_2D $RSI/hist_2d.pro
[Previous] [Next]
 NAME:
   HIST_2D

 PURPOSE:
   Return the density function (histogram) of two variables.

 CATEGORY:
   Image processing, statistics, probability.

 CALLING SEQUENCE:
   Result = hist_2d(V1, V2)
 INPUTS:
   V1 and V2 = arrays containing the variables.  May be any non-complex
       numeric type.

 Keyword Inputs:
       MIN1:   MIN1 is the minimum V1 value to consider. If this
               keyword is not specified, then if the smallest value of
               V1 is greater than zero, then MIN1=0 is used, otherwise
               the smallest value of V1 is used.

       MIN2:   MIN2 is the minimum V2 value to consider. If this
               keyword is not specified, then if the smallest value of
               V2 is greater than zero, then MIN2=0 is used, otherwise
               the smallest value of V2 is used.

       MAX1:   MAX1 is the maximum V1 value to consider. If this
               keyword is not specified, then V1 is searched for
               its largest value.

       MAX2    MAX2 is the maximum V2 value to consider. If this
               keyword is not specified, then V2 is searched for
               its largest value.

       BIN1    The size of each bin in the V1 direction (column
               width).  If this keyword is not specified, the
               size is set to 1.

       BIN2    The size of each bin in the V2 direction (row
               height).  If this keyword is not specified, the
               size is set to 1.

 OUTPUTS:
   The two dimensional density function of the two variables,
   a longword array of dimensions (m1, m2), where:
       m1 = Floor((max1-min1)/bin1) + 1
      and  m2 = Floor((max2-min2)/bin2) + 1
   and Result(i,j) is equal to the number of sumultaneous occurences
   of an element of V1 falling in the ith bin, with the same element
   of V2 falling in the jth bin.

 RESTRICTIONS:
   Not usable with complex or string data.

 PROCEDURE:
   Creates a combines array from the two variables, equal to the
   linear subscript in the resulting 2D histogram, then applies
   the standard histogram function.

 EXAMPLE:
   Return the 2D histogram of two byte images:
       R = HIST_2D(image1, image2)

   Return the 2D histogram made from two floating point images
   with range of -1 to +1, and with 101 (= 2/.02 + 1) bins:
       f1 = RANDOMN(seed, 256, 256)
       f2 = RANDOMN(seed, 256, 256)
       R = HIST_2D(f1, f2, MIN1=-1, MIN2=-1, MAX1=1, MAX2=1, $
           BIN1=.02, BIN2=.02)
       TVSCL, R

 MODIFICATION HISTORY:
   Written by:
   DMS, Sept, 1992     Written
   DMS, Oct, 1995      Added MIN, MAX, BIN keywords following
               suggestion of Kevin Trupie, GSC, NASA/GSFC.
   CT, RSI, May 2001: Corrected MIN, MAX keywords so that the out-of-range
               values are ignored rather than truncated to be within range.
               Allow input arrays with negative values.


HIST_EQUAL $RSI/hist_equal.pro
[Previous] [Next]
 NAME:
	HIST_EQUAL

 PURPOSE:
	Return a histogramequalized or modified image or vector.

 CATEGORY:
	Z1 - Image processing, spatially invariant.

 CALLING SEQUENCE:
	Result = HIST_EQUAL(A [, BINSIZE=value] [, /HISTOGRAM_ONLY]
        [, MAXV=value] [, MINV=value] [, OMAX=variable] [, OMIN=variable]
        [, PERCENT=value] [, TOP=value] [, FCN=vector])

 INPUTS:
	A:	The array to be histogram-equalized.

 KEYWORD PARAMETERS:

   BINSIZE: Size of the bin to use. The default is BINSIZE=1 if A is a byte
       array, or, for other input types, the default is (MAXV-MINV)/5000.

	HISTOGRAM_ONLY: If set, then return a vector of type LONG containing
       the cumulative distribution histogram, rather than the histogram
       equalized array.  Not valid if FCN is specified.

	MAXV: The maximum value to consider. The default is 255 if A is a
       byte array, otherwise the maximum data value is used.
       Input elements greater than or equal to MAXV are output as 255.

	MINV: The minimum value to consider. The default is 0 if A is a
       byte array, otherwise the minimum data value is used.
       Input elements less than or equal to MINV are output as 0.

   OMAX: Set this keyword to a named variable that, upon exit,
       contains the maximum data value used in constructing the histogram.

   OMIN: Set this keyword to a named variable that, upon exit,
       contains the minimum data value used in constructing the histogram.

   PERCENT:	Set this keyword to a value between 0 and 100 to
       stretch the image histogram. The histogram will be stretched
       linearly between the limits that exclude the PERCENT fraction
       of the lowest values, and the PERCENT fraction of the highest
       values. This is an automatic, semi-robust method of contrast
       enahncement.

   TOP: 	  The maximum value of the scaled result. If TOP is
       not specified, 255 is used. Note that the minimum value of the
       scaled result is always 0.

   FCN:	The desired cumulative probability distribution
   	function in the form of a 256 element vector.  If
   	omitted, a linear ramp, which yields equal probability
   	bins results.  This function is later normalized, so
   	its magnitude doesn't matter, although it should be
   	monotonically increasing.

 OUTPUTS:
	A histogram modified array of type byte is returned, of the
	same dimensions as the input array. If the HISTOGRAM_ONLY
	keyword is set, then the output will be a vector of type LONG.

 CALLED BY:
	idlitvisstreamline__define
 PROCEDURE:
	The HISTOGRAM function is used to obtain the density distribution of
	the input array.  The histogram is integrated to obtain the
	cumulative density-propability function and finally the lookup
	function is used to transform to the output image.

  Note:
	The first element of the histogram is always zeroed to remove
	the background.

 CALLS: ***
	HIST_EQUAL_PCT
 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
   None.

 EXAMPLE:

	Create a sample image using the IDL DIST function and display it by
	entering:

		image = DIST(100)
		TV, image

	Create a histogram-equalized version of the byte array, IMAGE, and
	display the new version.  Use a minumum input value of 10, a maximum
	input value of 200, and limit the top value of the output array to
	220.  Enter:

		new = HIST_EQUAL(image, MINV = 10, MAXV = 200, TOP = 220)
		TV, new

	Perform a linear stretch on the input array between the limits
	determined by excluding 5% of the lowest values, and 5% of the
	highest	values:
		NEW = HIST_EQUAL(IMAGE, PERCENT=5)

  To modify the output histogram to a logarithmic cumulative
  distribution (i.e. more pixels with lower values):
       y = alog(findgen(256)+1)   ;a log shaped curve
       TV, Hist_Equal(A, FCN = y)

  The following example modifies the histogram to a gaussian
  probability (not cumulative) distribution.  This results in most of
  the pixels having an intensity near the midrange:
	x = findgen(256)/255.	   ;Ramp from 0 to 1.
	y=exp(-((x-.5)/.2)^2)      ;Gaussian centered at middle, full
				   ;width at 1/2 max ~ 0.4
		;Form cumulative distribution, transform and display:
       TVSCL, Hist_Equal(A, FCN = TOTAL(y, /CUMULATIVE))

 MODIFICATION HISTORY:

	August, 1982. Written by DMS, RSI.
	Feb, 1988, Revised for Sun, DMS.
	Dec, 1994. DMS. Improved handling offloating/double images with
			large or small ranges.  Default value for MINV is
			computed, rather than set to 0.
	Oct, 1996. DMS. Made the handling of MIN=, and MAX= consistent
			for all data types.
   July 2000, CT, RSI: Completely rewrote.
           Now handles new integer types;
           can use BINSIZE with byte input;
           added OMAX, OMIN;
           HISTOGRAM_ONLY now returns LONG array.
   Aug 2003, CT, RSI: Better error handling. Fix problem with unsigned ints.


HLS $RSI/hls.pro
[Previous] [Next]
 NAME:
	HLS

 PURPOSE:
	Make a color table based on the HLS (Hue, Lightness, Saturation) 
	color system.

 CATEGORY:
	Z4 - Image processing, color table manipulation

 CALLING SEQUENCE:
	HLS, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr]

 INPUTS:
	Litlo:	Starting lightness, from 0 to 100%.

	Lithi:	Ending lightness, from 0 to 100%.

	Satlo:	Starting saturation, from 0 to 100%.

	Sathi:	Ending stauration, from 0 to 100%.

	Hue:	Starting Hue, from 0 to 360 degrees.  Red = 0 degs,
		green = 120, blue = 240.

 	Loops:	The number of loops through the color spiral.  This 
		parameter does not have to be an integer.  A negative value
		causes the loops to traverse the spiral in the opposite 
		direction.

 OUTPUTS:
	No required outputs.

 OPTIONAL OUTPUT PARAMETERS:
	Colr:	A (256,3) integer array containing the R, G, and B values
		that were loaded into the color tables.
		Red = colr(*,0), green = colr(*,1), blue = colr(*,2).

 COMMON BLOCKS:
	COLORS:	Contains the red, green, and blue vectors on exit.

 SIDE EFFECTS:
	The color tables are loaded.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Adapted from program on page 619, Fundamentals of Interactive
	Computer Graphics, Foley and Van Dam.

	Using the input parameters, a spiral through the double-
	ended HLS cone is traced.  Points along the cone
	are converted from HLS to RGB.

 MODIFICATION HISTORY:
	Written, DMS, Jan, 1983.
	Changed common block, dms, 4/1987.


HSV $RSI/hsv.pro
[Previous] [Next]
 NAME:
	HSV

 PURPOSE:
	Make a color table based on the HSV (Hue, Saturation, and Value) 
	color system.

 CATEGORY:
	Z4 - Image processing, color table manipulation

 CALLING SEQUENCE:
	HLS, Vlo, Vhi, Satlo, Sathi, Hue, Loops [, Colr]

 INPUTS:
	Vlo:	Starting value, from 0 to 100%.

	Vhi:	Ending value, from 0 to 100%.

	Satlo:	Starting saturation, from 0 to 100%.

	Sathi:	Ending saturation, from 0 to 100%.

	Hue:	Starting Hue, from 0 to 360 degrees.  Red = 0 degs,
		green = 120, blue = 240.

 	Loops:	The number of loops through the color spiral.  This
		parameter does not have to be an integer.  A negative value
		causes the loops to traverse the spiral in the opposite
		direction.

 OUTPUTS:
	No required outputs.

 OPTIONAL OUTPUT PARAMETERS:
	Colr:	A (256,3) integer array containing the R, G, and B values
		that were loaded into the color tables.
		Red = colr(*, 0), green = colr(*, 1), blue = colr(*, 2).

 COMMON BLOCKS:
	COLORS:	Contains the red, green and blue color vectors on exit.

 SIDE EFFECTS:
	The color tables are loaded.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Adapted from a program on page 616, Fundamentals of Interactive
	Computer Graphics, Foley and Van Dam.

	Using the input parameters, a spiral through the single-ended HSV 
	cone is traced.  Points along the cone are converted from HLS to RGB.

 MODIFICATION HISTORY:
	Written, DMS, Jan, 1983.
	Added common block COLORS, DMS, Dec, 1983 and Apr, 1987.