Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes


top cgReverseIndices


result = cgReverseIndices(ri, index [, COUNT=Long])

Provides a simple way to obtain the data indices from a Histogram REVERSE_INDICES vector. Returns a -1 if no indices are available. Check the COUNT keyword for the number of indices returned.


ri in required type=integer

The REVERSE_INDICES vector that is returned from the HISTOGRAM command.

index in required type=integer

The zero-based index into the REVERSE_INDICES vector from which to obtain the indices. For example, an index value of 4 will return the indices in the 5th bin (zero based counting) of the histogram.


COUNT out optional type=Long

The number of indices returned by the function.

:Return Value: indices: The indices that were put into the indexth bin of the histogram. A -1 is returned if no indices are in that particular bin.


Used with the HISTOGRAM command:

IDL> image = cgDemoData(7) IDL> h = Histogram(image, REVERSE_INDICES=ri) IDL> indices = cgReverseIndices(ri, 4, COUNT=cnt) IDL> Help, indices, cnt, h[4] INDICES LONG = Array[948] CNT LONG = 948 <Expression> LONG = 948 IDL> image[indices] = 0

Author information



David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: Coyote's Guide to IDL Programming:


Copyright (c) 2011, Fanning Software Consulting, Inc.


Written by David W. Fanning at suggestion of Ben Tupper. 7 January 2011.

File attributes

Modification date: Fri Mar 27 11:07:38 2015
Lines: 119
Docformat: rst rst