<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>To my knowledge there is no built in mechanism for comparing data objects and the like.  The VTK regression tests rely pretty much exclusively on the rendering tests.  I won't prattle on about the advantages of them, but suffice it to say that once configured
 the rendering tests are easy to set up to test a large fraction of what can be done with VTK.  So I am not aware of anyone bothering to implement anything else.</div>
<div><br>
</div>
<div>-Ken </div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span><Kilgus>, Thomas <<a href="mailto:t.kilgus@Dkfz-Heidelberg.de">t.kilgus@Dkfz-Heidelberg.de</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, January 24, 2013 9:14 AM<br>
<span style="font-weight:bold">To: </span>Kenneth Moreland <<a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a>>, "<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] RE: [vtk-developers] How can I test my PolyData Algorithm? #2<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div 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">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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]-->
<div lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Kenneth,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thank you very much for your answer! I know the regression tests and really like them, however, in this case I would like to test the data itself and not the rendering. One problem I have with rendering
 tests is that they do not run in Linux DartClients. (We use a CMake Script to run the nightlies and it somehow opens an environment without any X-Server so there is no possibility to actually open any render window. I know that it is possible to use Mesa Software
 rendering, but that is huge configuration effort. But this is really off topic …).
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Is there no way to make the test on a lower level? vtkRegressionTestImage would also test the rendering, which slightly overkill here in my opinion. Just out of curiosity: Are most VTK algorithms
 (even they just modify data and do not render anything themselves) tested with vtkRegressionTestImage?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thomas<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">
<a href="mailto: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> Donnerstag, 24. Januar 2013 16:53<br>
<b>To:</b> Kilgus, Thomas; <a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><br>
<b>Subject:</b> Re: [vtk-developers] How can I test my PolyData Algorithm? #2<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">The typical way this type of testing is done within the VTK regression tests is to run your algorithm, render the result, and then test the image to some ground truth image.  There is a utility
 in VTK (vtkRegressionTestImage) that performs this test with the requisite tolerance to compensate for slight variations in hardware (as well as the ability to provide multiple ground truth images for instances where the difference is more than a little but
 still correct).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">There are lots of examples in the VTK source.  A basic one is called Mace.cxx.  Take a look at that example first.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">-Ken<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black"><Kilgus>, Thomas <<a href="mailto:t.kilgus@Dkfz-Heidelberg.de">t.kilgus@Dkfz-Heidelberg.de</a>><br>
<b>Date: </b>Thursday, January 24, 2013 3:32 AM<br>
<b>To: </b>"<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>" <<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>><br>
<b>Subject: </b>[EXTERNAL] [vtk-developers] How can I test my PolyData Algorithm? #2<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black"><o:p> </o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #B5C4DF 4.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-right:0cm" id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE">
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Hi there,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">I didn’t get any answer last time (also on the user’s list) so I try again
</span><span lang="EN-US" style="font-family:Wingdings;color:black">J</span><span lang="EN-US" style="color:black">:</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">I have an algorithm generating a vtkPolyData as output. I would like to write a test, in order to make sure that my algorithm generates the same output every day (even though there might be changes
 to the algorithm or to surrounding classes). What is a nice way to do this?</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">I thought I could save a generated PolyData as “ground truth” and compare it point wise to the generated output. However, my output data contains lots of 3D floating-point points and thus I have to
 perform lots of comparisons between floating-point numbers and this can be difficult for different data or 32Bit/64Bit Systems.
</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">I was wondering if there are any methods/classes already meant general testing purposes? Anything I could reuse for comparing two PolyDatas or anything to make sure my algorithm provides the same result
 for the same data. I tried to look into tests of other VTK classes but couldn’t really find anything. Any suggestions?</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Regards</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black">Thomas</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>