[vtk-developers] How can I test my PolyData Algorithm? #2

Kilgus, Thomas t.kilgus at Dkfz-Heidelberg.de
Fri Jan 25 04:45:16 EST 2013


Hi David,

thank you for your answer. For some unknown reason my spam filter took your mail and I didn't see that. 

That sounds very much like my first plan, however, I would like to reuse a complete solution and I already know that the rendering tests are very powerful. If all algorithms in VTK use this way to verify their results, I would prefer to make this process running completely. But in case I can't make it, I will come back to you! 

Regards,
Thomas

-----Original Message-----
From: David E DeMarle [mailto:dave.demarle at kitware.com] 
Sent: Donnerstag, 24. Januar 2013 18:35
To: Moreland, Kenneth
Cc: Kilgus, Thomas; vtk-developers at vtk.org
Subject: Re: [vtk-developers] How can I test my PolyData Algorithm? #2

Long ago in XdmfTestVTKIO.cxx I went the direct comparison route. The test reads/generates some vtk data, writes it to an xdmf file, reads that xdmf file back and then compares the generated and read data. But for my purposes it was enough to verify that the top level data structures were similar. Image comparison tests exist elsewhere that augment that.

If no-one else has a full solution Thomas you could pick up where I left off and go deeper.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, Jan 24, 2013 at 11:32 AM, Moreland, Kenneth <kmorel at sandia.gov> wrote:
> 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.
>
> -Ken
>
> From: <Kilgus>, Thomas <t.kilgus at Dkfz-Heidelberg.de>
> Date: Thursday, January 24, 2013 9:14 AM
> To: Kenneth Moreland <kmorel at sandia.gov>, "vtk-developers at vtk.org"
> <vtk-developers at vtk.org>
> Subject: [EXTERNAL] RE: [vtk-developers] How can I test my PolyData 
> Algorithm? #2
>
> Hi Kenneth,
>
>
>
> 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 ...).
>
>
>
> 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?
>
>
>
> Regards,
>
> Thomas
>
>
>
> From: vtk-developers-bounces at vtk.org 
> [mailto:vtk-developers-bounces at vtk.org]
> On Behalf Of Moreland, Kenneth
> Sent: Donnerstag, 24. Januar 2013 16:53
> To: Kilgus, Thomas; vtk-developers at vtk.org
> Subject: Re: [vtk-developers] How can I test my PolyData Algorithm? #2
>
>
>
> 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).
>
>
>
> There are lots of examples in the VTK source.  A basic one is called 
> Mace.cxx.  Take a look at that example first.
>
>
>
> -Ken
>
>
>
> From: <Kilgus>, Thomas <t.kilgus at Dkfz-Heidelberg.de>
> Date: Thursday, January 24, 2013 3:32 AM
> To: "vtk-developers at vtk.org" <vtk-developers at vtk.org>
> Subject: [EXTERNAL] [vtk-developers] How can I test my PolyData Algorithm?
> #2
>
>
>
> Hi there,
>
>
>
> I didn't get any answer last time (also on the user's list) so I try 
> again
> J:
>
>
>
>
>
> 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?
>
>
>
> 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.
>
>
>
> 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?
>
>
>
> Regards
>
> Thomas
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list