[vtk-developers] Rendering scalar data with NaNs
David Thompson
dcthomp at sandia.gov
Mon Aug 23 19:45:29 EDT 2010
> I’ve recently run into an issue with rendering fields with NaN
> values in it.... I propose making the changes in the attached
> patches (created with git-format-patch). First, a NanColor was
> added to vtkLookupTable (as a 4-tuple RGBA) and added to
> vtkColorTransferFunction (as a 3-tuple RGB) so that these respective
> lookup tables would return a specific color for NaN. Next,
> vtkScalarsToColorsPainter was modified to use a 2D texture map that
> uses the second dimensions to distinguish between real and NaN
> values. I also added a test for rendering these NaN values along
> with the other non-finite –INF and INF values.
>
> Does anyone object to these changes, or do they seem reasonable to
> put into VTK?
Hi Ken,
For cell data, the patch seems really useful. For point data I'm less
sure. For example, the attached images show first your test and second
what happens when 2 neighboring cells both have NaNs. Without the
texture map, color interpolation looks bad (bars 1, 3). With the
texture map, the valid values between NaNs appear as a single pixel
(bars 2, 4). Perhaps a filter with a feature similar to vertex
splitting in vtkPolyDataNormals is in order? It could modify polydata
as required to insert extra vertices along edges with a single NaN, so
that the rendered output would only display NaN in about half of each
cell.
Also, I've long wanted a way to specify a multidimensional texture map
with hue mapped to one axis and saturation to another. Will this
change prevent it? If so, would you mind moving the NanColor handling
in the mapper to a subclass?
Thanks,
David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NanRender1.png
Type: image/png
Size: 1390 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100823/209e04f7/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NanRender2.png
Type: image/png
Size: 1231 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100823/209e04f7/attachment-0003.png>
More information about the vtk-developers
mailing list