Skip to content

Commit

Permalink
BUG: Missing associated test data
Browse files Browse the repository at this point in the history
When running tests requiring the file 'mri3D.mhd',
this file was added as a file with no associated data file.
However, mri3D.mhd does not contain data, but is merely
a header file. The image data is contained in:
DicomSeries/Image%04d.dcm 75 77 1
The data file and its associated files are in different
directories, respectively ${ITK_DATA_ROOT}/Input/ and
${ITK_DATA_ROOT}/Input/DicomSeries/
Since DATA{} does not allow to specify an associated
file that is in a different directory, we call ExternalData_Expand_Arguments
manually to download the required files.

The tests using mri3D.mhd currently seem to be working but
they only pass because other tests download the
data files before these specific tests are run.
If ITK is built with only a few
modules ON, such as ITKIOMeta and ITKMetaIO,
the tests requiring mri3D.mhd will fail.

Change-Id: I86576d30bd1b50bb4bc438a2ab88842a4c6e8d1b
  • Loading branch information
fbudin69500 committed Sep 26, 2016
1 parent 2f78b42 commit 2f5c6d9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Examples/Filtering/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,20 @@ itk_add_test(NAME ResampleImageFilter7Test COMMAND ${ITK_TEST_DRIVER}
${TEMP}/ResampleImageFilter7PixelCentered.png
33
)

# The data contained in ${ITK_DATA_ROOT}/Input/DicomSeries/
# is required by mri3D.mhd:
# ElementDataFile = DicomSeries/Image%04d.dcm 75 77 1
# The data file and its associated files are in different
# directories, respectively ${ITK_DATA_ROOT}/Input/ and
# ${ITK_DATA_ROOT}/Input/DicomSeries/
# Since DATA{} does not allow to specify an associated
# file that is in a different directory, we call ExternalData_Expand_Arguments
# manually to download the required files.
ExternalData_Expand_Arguments(ITKData
ExpandedData
DATA{${ITK_DATA_ROOT}/Input/DicomSeries/,REGEX:Image[0-9]+.dcm}
)
itk_add_test(NAME ResampleVolumesToBeIsotropicTest COMMAND ${ITK_TEST_DRIVER}
--compare DATA{${BASELINE}/ResampleVolumesToBeIsotropic.mha}
${TEMP}/ResampleVolumesToBeIsotropic.mha
Expand Down
13 changes: 13 additions & 0 deletions Modules/Filtering/FFT/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ itk_add_test(NAME itkComplexToComplexFFTImageFilter2DFloatTest
DATA{${ITK_DATA_ROOT}/Input/cthead1.png}
${ITK_TEST_OUTPUT_DIR}/itkComplexToComplexFFTImageFilter2DFloatTest.mha
float)
# The data contained in ${ITK_DATA_ROOT}/Input/DicomSeries/
# is required by mri3D.mhd:
# ElementDataFile = DicomSeries/Image%04d.dcm 75 77 1
# The data file and its associated files are in different
# directories, respectively ${ITK_DATA_ROOT}/Input/ and
# ${ITK_DATA_ROOT}/Input/DicomSeries/
# Since DATA{} does not allow to specify an associated
# file that is in a different directory, we call ExternalData_Expand_Arguments
# manually to download the required files.
ExternalData_Expand_Arguments(ITKData
ExpandedData
DATA{${ITK_DATA_ROOT}/Input/DicomSeries/,REGEX:Image[0-9]+.dcm}
)
itk_add_test(NAME itkComplexToComplexFFTImageFilter3DFloatTest
COMMAND ITKFFTTestDriver
--compare
Expand Down
15 changes: 15 additions & 0 deletions Modules/IO/Meta/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,21 @@ itk_add_test(NAME itkMetaImageStreamingWriterIOTest
--compare DATA{${ITK_DATA_ROOT}/Baseline/IO/HeadMRVolume.mhd,HeadMRVolume.raw}
${ITK_TEST_OUTPUT_DIR}/MetaImageStreamingWriterIOTest.mha
itkMetaImageStreamingWriterIOTest DATA{${ITK_DATA_ROOT}/Input/HeadMRVolume.mhd,HeadMRVolume.raw} ${ITK_TEST_OUTPUT_DIR}/MetaImageStreamingWriterIOTest.mha)

# The data contained in ${ITK_DATA_ROOT}/Input/DicomSeries/
# is required by mri3D.mhd:
# ElementDataFile = DicomSeries/Image%04d.dcm 75 77 1
# The data file and its associated files are in different
# directories, respectively ${ITK_DATA_ROOT}/Input/ and
# ${ITK_DATA_ROOT}/Input/DicomSeries/
# Since DATA{} does not allow to specify an associated
# file that is in a different directory, we call ExternalData_Expand_Arguments
# manually to download the required files.
ExternalData_Expand_Arguments(ITKData
ExpandedData
DATA{${ITK_DATA_ROOT}/Input/DicomSeries/,REGEX:Image[0-9]+.dcm}
)

itk_add_test(NAME itkMetaImageStreamingWriterIOTest2
COMMAND ITKIOMetaTestDriver
--compare DATA{${ITK_DATA_ROOT}/Input/mri3D.mhd}
Expand Down

0 comments on commit 2f5c6d9

Please sign in to comment.