CGREVERSEINDICES
Description
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.
Categories
Utilities
Params
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.
Keywords
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.
Examples
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
FANNING SOFTWARE CONSULTING::
David W. Fanning
1645 Sheely Drive
Fort Collins, CO 80526 USA
Phone: 970-221-0438
E-mail: david@idlcoyote.com
Coyote's Guide to IDL Programming: http://www.idlcoyote.com
History
Written by David W. Fanning at suggestion of Ben Tupper. 7 January 2011.
Copyright
Copyright (c) 2011, Fanning Software Consulting, Inc.