[vtkusers] vtkLookupTable does not handle NaN values with Log10 scale

Miorelli, Federico Federico.Miorelli at CGG.COM
Wed Sep 21 05:25:15 EDT 2016


Dear All,

It seems like vtkLookupTable does not handle correclty NaN values when the Log10 scale is used.
In this case, all the NaNs in the input are not mapped to NanColor but to the minimum range color.

Unless there is a reason for this, I believe the bug is in vtkLookupTable::vtkApplyLogScale().

Here is a patch that might fix it (VTK 6.3.0)


--- old/vtkLookupTable.cxx    Wed Jul 13 15:11:08 2016
+++ new/vtkLookupTable.cxx    Wed Sep 21 10:54:24 2016
@@ -358,6 +358,11 @@
inline double vtkApplyLogScale(double v, const double range[2],
                                const double logRange[2])
{
+   if (vtkMath::IsNan(v))
+     {
+     return v;
+     }
+
   // is the range set for negative numbers?
   if (range[0] < 0)
     {


Regards,
Federico



______ ______ ______
Federico Miorelli

Senior R&D Geophysicist
Subsurface Imaging - General Geophysics Italy

This email and any accompanying attachments are confidential. If you received this email by mistake, please delete
it from your system. Any review, disclosure, copying, distribution, or use of the email by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160921/e258fffd/attachment.html>


More information about the vtkusers mailing list