[vtkusers] vtkLookupTable does not handle NaN values with Log10 scale
Elvis Stansvik
elvis.stansvik at orexplore.com
Thu Sep 22 15:20:56 EDT 2016
2016-09-21 11:25 GMT+02:00 Miorelli, Federico <Federico.Miorelli at cgg.com>:
> 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.
Sorry to hijack the thread, but since it's related and I've been
meaning to ask: How is vtkPiecewiseFunction supposed to handle NaN
values? It does not have a NanColor setting like vtkLookupTable and
vtkColorTransferFunction has. I guess if I specify a
vtkPiecewiseFunction as scalar opacity transfer function during volume
rendering, I better ensure I have no NaN values (i.e. filter them
out)?
Elvis
>
>
>
> 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.
>
>
> _______________________________________________
> Powered by 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list