[vtkusers] color mapping
Frédéric Speisser
speisser at kappaeng.com
Wed Dec 5 04:18:45 EST 2012
Thank you all,
Finally, I found a way to achieve what I wanted to do in overriding
function /MapScalars/ of /vtkLookupTable/, so i'm now be able to manage
custom color mapping.
Kind regards,
Frédéric
Le 04/12/2012 10:27, Johannes Strecha a écrit :
> Hello,
>
> the vtk reference says that the vtkClipDataSet filter can be
> configured to produce a second output, namely the part that was
> clipped away. A pipeline with two clip-filters (for upper and lower
> bounds) that produce the clipped part as second outputs and three
> mappers with suitably set color transfer functions should produce the
> desired results.
>
> However, I also think that one should be able to achieve this result
> with a more simple setup.
>
> Kind regards,
> Johannes Strecha.
>
>
> On Tue, Dec 4, 2012 at 9:57 AM, Deric Stone <dstone at medis.nl
> <mailto:dstone at medis.nl>> wrote:
>
> Where are you using the lookup table? Can you use
> vtkColorTransferFunction or vtkDiscretizableColorTransferFunction
> instead? There you would be able to specify ranges.
>
> Note that GetColor(…) and MapValue(…) are not declared virtual in
> the vtkLookupTable class so cannot be overridden.
>
> Kind regards,
>
> Deric Stone
>
> *From:*vtkusers-bounces at vtk.org <mailto:vtkusers-bounces at vtk.org>
> [mailto:vtkusers-bounces at vtk.org
> <mailto:vtkusers-bounces at vtk.org>] *On Behalf Of *Frédéric Speisser
> *Sent:* Monday, December 03, 2012 6:20 PM
> *To:* Johannes Strecha
> *Cc:* vtkusers at vtk.org <mailto:vtkusers at vtk.org>
> *Subject:* Re: [vtkusers] color mapping
>
> Thank you Johannes for your answer,
>
> Yes, I know this algorithm, I also use it to filter data.
> But here my aim is not to filter data out-of-range but to keep
> these data visible but set in a custom color.
>
> Kind regards,
> Frédéric
>
> Le 03/12/2012 18:12, Johannes Strecha a écrit :
>
> Hello,
>
> I can't give you a direct answer, but I think what you want
> can be done with the vtkClipDataSet filter (5.8). See the
> reference for details. I assume that adjusting the lookup
> table would work faster, though.
>
> When trying to realize a "filled contour plot" by adjusting
> the lookup table (to a series of steps) I experienced that
> some interpolation was performed nonetheless and I ended up
> with blurred filled contours. Maybe this would also happen in
> your case.
>
> Kind regards,
> Johannes Strecha.
>
> On Mon, Dec 3, 2012 at 5:31 PM, Frédéric Speisser
> <speisser at kappaeng.com <mailto:speisser at kappaeng.com>> wrote:
>
> Hi all,
>
>
> I'm using /vtkLookupTable::SetTableRange/ to remap colors of a
> LUT to a custom range of a given scalar values.
>
> This works great but per default and as explained in API
> documentation :
> /Scalar values less than minimum range value are clamped to
> minimum range value. Scalar values greater than maximum range
> value are clamped to maximum range value.
> /So values out of range are displayed in minimum range value
> color (for those under custom range) and in maximum range
> value color (for those over custom range).
> I would like to display out-of-range values in a custom color,
> so that for example all values under and over custom range are
> displayed in black.
> I began to write a class /MyVtkLookupTable/ which inherits
> from /vtkLookupTable /and i tried to override /GetColor(double
> v, double rgb[3])/ and /MapValue(double v)/ to be able to
> override color displayed but it seems not to work.
> Is it possible to do that by overriding vtk classes ? If yes,
> which method/classes should I override ?
>
> Any clues are wellcome, thank you,
>
>
>
> Frédéric
>
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121205/b8225dee/attachment.htm>
More information about the vtkusers
mailing list