[ITK-users] testing

Matt McCormick matt.mccormick at kitware.com
Mon Apr 20 16:10:19 EDT 2015


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
>


More information about the Insight-users mailing list