<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<title>Rendering scalar data with NaNs</title>
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>What would happen if the following occurs (real problem I worked
on a few weeks ago) – a user wants to model a exhaust plume from a power
plant.  The model does not go down to the ground.  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 – I am not
sure if by ParaView, or his simulation code).  Would all of this data have
color now, or would it stay transparent?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Alan<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
vtk-developers-bounces@vtk.org [mailto:vtk-developers-bounces@vtk.org] <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<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif"'>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><span style='font-size:10.0pt;font-family:Consolas'><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></span><o:p></o:p></p>

</div>

</body>

</html>