[ITK] [ITK-users] testing

Johannes Weber johannesweber at gmx.at
Sat Apr 25 13:06:50 EDT 2015


Hi!

Thank you! At the moment every test is an executable. Maybe later when 
the tests are getting more and more than I will try to use the test manager.

At the moment I have a problem with the itkTestingComparisonImageFilter. 
The image which is the output of my algorithm is exact the same as the 
image that I use as valid input for this filter which I get from another 
software. But the output of the Comparison filter is max difference 
-3.40282e+38, the min difference +3.40282e+38, total and mean difference 
are 0, and the interesting part is that the number of pixels with 
difference is 0 (what I would expect). But why this min and max values?

In another test I am doing the same where the two images which I compare 
are also the exact same and I get as max difference something in the 
range of 1e-7 and the number of pixels with difference is bigger than 0, 
but this is ok and seems to be the inaccuracy which to expect when using 
float.

Kind regards,
Johannes

Am 20.04.2015 um 22:10 schrieb Matt McCormick:
> Hi Johannes,
>
> A best practice is to also compare generated images against a
> baseline.  ITK builds an executable called itkTestDriver that capable
> of reading medical image formats and performing comparisons on images
> [1].  This can be useful when building code not in an ITK Module. If
> you are writing an ITK Module, then the CreateTestDriver CMake macro
> can be used to build a test driver executable that also has this image
> comparison functionality built in [2][3].  Finally, ITK comes with
> some macros that can be useful for quickly writing tests [4].
>
> Hope this helps,
> Matt
>
> [1] http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Core/TestKernel/src/itkTestDriver.cxx;h=162cff2d2ca615958f7a3dbfdf535fe0b26b9d2a;hb=HEAD
>
> [2] http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Core/TestKernel/CreateTestDriver.cmake;h=02ffeb172588c87d81b48e990c219f1c16ce3a21;hb=HEAD
>
> [3] http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Filtering/Colormap/test/CMakeLists.txt;h=f53220656495ec72b31b73d72ce4d7ad55797902;hb=HEAD#l7
>
> [4] http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Core/TestKernel/include/itkTestingMacros.h;h=ef778fdb96ae417397b79ba6f02d4235caa7c379;hb=HEAD
>
>
> On Mon, Apr 20, 2015 at 6:10 AM,  <JohannesWeber at gmx.at> wrote:
>> Hello!
>>
>> After writing a new filter testing is needed, and I am new to this... so
>> when I am right, CTest is about "managing" the tests and running them and so
>> stuff. But the first prolem that I have is how to implement them? I found
>> this site: http://www.itk.org/Wiki/ITK/Release_4/UnitTesting
>> but I can not find this itkTestHarness. If I am right, the testing framework
>> can be anyone (GTest, ...). But for simple image comparing do I need one? I
>> also found the ComparisonImageFilter... so if I have a valid output and I
>> compare it with my output from my filter, than I can just say return 0 if
>> everything is right and something else if not.
>> So all in all... maybe some hints for a general testing guide for newbies
>> and for testing within itk?
>> and besides: i am working with visual studio 2012 express...
>>
>> thanks a lot!!
>>
>> greetings, Johannes
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>>

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list