Available in the LEADTOOLS Imaging toolkit. |
GetFunctionalLookupTable method (Main Control)
Visual
Basic example
Visual
C++ 5.0 example
Syntax short GetFunctionalLookupTable(long nStart, long nEnd, short nFactor, short uFlag);
Overview: Refer to Using Histograms.
Remarks
Updates a range of entries in the HistogramTable property array, based on the specified mathematical function.
The nFactor parameter is used for log and exp functions only.
If uFlag is FLT_EXP the value of nFactor modifies the lookup table values according to the following equations:
where :
nFirstValue = exp(nFactor * nStart/nEnd).
nLastValue = exp(nFactor)
x = the intensity value of the selected point
If uFlag is FLT_LN the value of nFactor modifies the lookup table values according to the following equations:
where:
nFirstValue = ln(1+ (nFactor * nStart/nEnd)).
nLastValue = ln(1 + nFactor)
x = the intensity value of the selected point
In the case of linear function, nFactor has no effect. The method performs a linear interpolation between the two points nStart and nEnd and stores the results in the lookup table. The user determines the two points nStart and nEnd and their new values, nFirstValue and nLastValue. The value nFirstValue should be stored in the lookup table at the nStart position and nLastValue at the nEnd position of the lookup table before calling this method.
As an example, suppose a user wants to select a point, change the intensity value of that point (x), and then perform two linear interpolations:
from 0 to the intensity value x
from intensity value x to the end of the range
To accomplish this, the user would proceed by doing the following:
Select the point and get its intensity value (x)
Change the intensity value of the selected point to some new value (newCol).
Store the new intensity value in the Lookup table by assignment:
RemapTable(x) = newCol
Call GetFunctionalLookupTable with nStart set to 0, nEnd set to x, and uFlag set to FLT_LINEAR.
Call GetFunctionalLookupTable with nStart set to x, nEnd set to 255, and uFlag set to FLT_LINEAR. (For the example, assume the image is 8-bits per pixel.)
This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.
See Also
Elements: GetUserLookUpTable method, RemapIntensity method, RemapTable property, RemapTableSize property