[ITK] [ITK-users] External Modules: Passing data to unit tests?

DVigneault davis.vigneault at gmail.com
Mon Jan 25 10:12:02 EST 2016


All--

I'm working on an external module for ITK [1], and am having trouble passing
image data to my unit tests.  I understand from this link [2] that the build
system will detect binary images and store them in a gitignored location,
which is referenced by a hash.  So if I have an image
ITKPhase/test/Input/swi_wrapped.vtk, it will be moved somewhere else in the
source tree, and the image file will be replaced by an md5--which is what
has happened.  However, I don't know how to reference the file in the
ITKPhase/test/CMakeList.txt file when defining the command.  I've tried
this...

itk_add_test(NAME itkDCTPhaseUnwrappingImageFilterTest
  COMMAND ${itk-module}TestDriver itkDCTPhaseUnwrappingImageFilterTest
    $(.ExternalData_MD5_$(cat swi_wrapped.vtk.md5)) "1")

...but, understandably, CMake isn't parsing it the way BASH would, and is
instead breaking the link up into individual tokens:

test 2
    Start 2: itkDCTPhaseUnwrappingImageFilterTest

2: Test command: /local/pemb3433/Developer/ITK/bin/bin/ITKPhaseTestDriver
"itkDCTPhaseUnwrappingImageFilterTest" "DATA{" ".ExternalData_MD5_$(cat
Input//swi_wrapped.vtk.md5)" "}" "1"
2: Test timeout computed to be: 9.99988e+06
2: Usage: itkDCTPhaseUnwrappingImageFilterTest <wrapped_image>
<unwrapped_image>
1/1 Test #2: itkDCTPhaseUnwrappingImageFilterTest ...***Failed    0.04 sec

0% tests passed, 1 tests failed out of 1

What is the correct way to reference images in external module unit tests? 
Apologies if this is explained somewhere on the Wiki and I've missed it, or
if this is more of a CMake question than an ITK question.  Thanks in advance
for your help!

Best,

--Davis

[1] https://github.com/DVigneault/ITKPhase
[2] http://www.itk.org/Wiki/ITK/Git/Develop/Data#ExternalData



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/External-Modules-Passing-data-to-unit-tests-tp7588384.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
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