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

David Gobbi david.gobbi at gmail.com
Thu Sep 22 14:54:53 EDT 2016


Hi Federico,

Thanks for the note.  I've pushed a patch for this, so that it can be fixed
in VTK 7.1.
http://gitlab.kitware.com/vtk/vtk/merge_requests/1998

 - David

On Wed, Sep 21, 2016 at 3:25 AM, Miorelli, Federico <
Federico.Miorelli at cgg.com> wrote:

> 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/20160922/77287816/attachment.html>


More information about the vtkusers mailing list