<HTML>
<HEAD>
<TITLE>Re: Rendering scalar data with NaNs</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Alan,<BR>
<BR>
As I recall, in your case you were using the ParaView plot over line filter, which internally uses a probe filter with a line source, and then running the results through an integration filter. &nbsp;These changes do not touch any of those classes and should therefore have no effect. &nbsp;These changes only effect the classes that convert scalars to colors for rendering.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 8/23/10 4:36 PM, &quot;Scott, W Alan&quot; &lt;<a href="wascott@sandia.gov">wascott@sandia.gov</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><FONT COLOR="#1F497D">What would happen if the following occurs (real problem I worked on a few weeks ago) &#8211; a user wants to model a exhaust plume from a power plant. &nbsp;The model does not go down to the ground. &nbsp;The user then wanted to plot with line from OUTSIDE of this space , through this space, and out the other side (which ended up partially filled with nans &#8211; I am not sure if by ParaView, or his simulation code). &nbsp;Would all of this data have color now, or would it stay transparent?<BR>
&nbsp;<BR>
Alan<BR>
&nbsp;<BR>
</FONT><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Tahoma, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:10pt'><B>From:</B> <a href="vtk-developers-bounces@vtk.org">vtk-developers-bounces@vtk.org</a> [<a href="mailto:vtk-developers-bounces@vtk.org">mailto:vtk-developers-bounces@vtk.org</a>] <B>On Behalf Of </B>Moreland, Kenneth<BR>
<B>Sent:</B> Monday, August 23, 2010 4:30 PM<BR>
<B>To:</B> VTK Developers<BR>
<B>Subject:</B> [vtk-developers] Rendering scalar data with NaNs<BR>
</SPAN></FONT></FONT><FONT FACE="Times New Roman"><SPAN STYLE='font-size:12pt'> <BR>
</SPAN></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I&#8217;ve recently run into an issue with rendering fields with NaN values in it. &nbsp;In this case, the data comes from a simulation that intentionally writes out NaN values, which have a significant meaning. &nbsp;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). &nbsp;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. &nbsp;Next, vtkScalarsToColorsPainter was modified to use a 2D texture map that uses the second dimensions to distinguish between real and NaN values. &nbsp;I also added a test for rendering these NaN values along with the other non-finite &#8211;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>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<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></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<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>