<HTML>
<HEAD>
<TITLE>Rendering scalar data with NaNs</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I’ve recently run into an issue with rendering fields with NaN values in it. In this case, the data comes from a simulation that intentionally writes out NaN values, which have a significant meaning. The problem is that the current VTK rendering classes have no control over what color the NaN values map to, and I have noticed that different hardware maps them differently.<BR>
<BR>
Thus, 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.<BR>
<BR>
Does anyone object to these changes, or do they seem reasonable to put into VTK?<BR>
<BR>
-Ken<BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>