[vtkusers] Simple color mapping question
Johnson, Mike (IS)
michael.l.johnson at ngc.com
Fri Mar 12 15:13:35 EST 2010
Thanks. I don't see the .cxx or .h for DiscretizableColorTransferFunction in 5.4.2... Is this class newer than that?
Thanks,
Mike
-----Original Message-----
From: daviddoria at gmail.com [mailto:daviddoria at gmail.com] On Behalf Of David Doria
Sent: Friday, March 12, 2010 2:41 PM
To: Johnson, Mike (IS)
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Simple color mapping question
On Fri, Mar 12, 2010 at 2:29 PM, Johnson, Mike (IS)
<michael.l.johnson at ngc.com> wrote:
> Hi all,
>
> I have requirements to show a simple 2D surface plot where the data point
> values range, let's say, from 0 to 100 (or might be -100 to 200 or
> whatever...) Then let's say I want to color like this:
>
> < 20: Red
>
> 20-40: Magenta
>
> 40-60: Yellow
>
> 60-80: Blue
>
>> 80: Green
>
> Right now I have set up a vtkLookupTable and assigned 20 to red, 40 to
> magenta, 60 to yellow, and 80 to blue. A few things -
>
> 1. By default it appears to map as a "ramp" between the colors; ie, if
> the value is 50, it's "magenta-yellowish." I'd rather just have only the 5
> colors in my map. Is this possible?
>
> 2. Since the colors from my #1 above really specify a "range" instead
> of a "single point value" (ie, I'd like anything from 20-40 to be the same
> color), how do I specify a "less than" (for the "red" values) and a "greater
> than" (for the green values)?
>
> Thanks in advance,
> Mike Johnson
You may want to look at vtkDiscretizableColorTransferFunction:
http://www.vtk.org/Wiki/VTK/Examples/DiscretizableColorTransferFunction
Thanks,
David
More information about the vtkusers
mailing list