[Insight-developers] NIfTI, DiffusionTensor3D Pixels, SymmetricSecondRankTensor

kent williams norman-k-williams at uiowa.edu
Fri Mar 13 10:06:20 EDT 2009


I'll break it down for you.

Tests for IO are in Insight/Testing/Code/IO.  In this particular case tests
for NIfTI IO are in Insight/Testing/Code/IO/itkNiftiImageIOTest.cxx.

You can add tests in a new file, or you can just tack new tests on the end
of itkNiftiImageIOTest.cxx.  If you add a new file it needs to be added to
the IOTest_SRCS variable near the top of CMakeLists.txt

There are 3 things you have to do to add a test

1. Write the test itself. Tests are functions that take two arguments (int
ac, char *av[]) -- in other words, just like the 'main' in a C or C++
program.  I've adopted a convention at the top of my tests of passing in a
writable test directory path as a first argument, and then changing to that
directory before reading and writing files.

2. edit Insight/Testing/Code/IO/itkIOTests.cxx, and add another instance to
the list of macros in RegisterTests(), with the name of your test -- i.e.
the name of the C++ function you added in step 1.

3. Edit Insight/Testing/Code/IO/CMakeLists.txt, and use ADD_TEST to add your
test. ADD_TEST's argumenents are

ADD_TEST(<test name> <program to run> <list of arguments for that program>)

When you add a test, a couple of CMakeLists.txt variables are important to
get your test situated:

${ITK_TEST_OUTPUT_DIR} -- this is a directory in which you can write files
in the course of your tests.

${ITK_DATA_ROOT} -- the directory where any checked-in test input files
live.  This is going to be Insight/Testing/Data/Input, which is where you
should check in any test files.

If you do check in any test files, try and make them as small as possible.
The ITK distribution is already a pretty hefty download for a FOSS library.




On 3/13/09 8:35 AM, "Luke Bloy" <lbloy at seas.upenn.edu> wrote:

> I'll have to familiarize  myself with the itk testing structure, but it
> shouldn't be a problem. I also won't have any time to look at it until
> next week.
> 
> -Luke
> 
> Hans Johnson wrote:
>> Luke,
>> 
>> Could you write the test that that needs to pass?
>> 
>> Hans
>> 
>>   



Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.




More information about the Insight-developers mailing list