Skip to content

Commit

Permalink
BUG: Fix failing tests for examples
Browse files Browse the repository at this point in the history
Replaced ITKIONRRD with ITKIOPNG and ITKIOMeta, because the examples were trying to build the png and mha images as nrrd, thus throwing an error.

Changed the input path to a new directory: BioCell/examples/Data which contains raw files BrainProtonDensity.png and brainweb1e1a10f20.mha used for example testing. Other remote modules contain the raw version of their data hence the use of it here.
  • Loading branch information
mseng10 committed Apr 3, 2020
1 parent 47a2338 commit a913422
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ find_package(ITK REQUIRED
BioCell
ITKSmoothing
ITKIOImageBase
ITKIONRRD
ITKIOPNG
ITKIOMeta
)
include(${ITK_USE_FILE})

Expand All @@ -19,23 +20,20 @@ target_link_libraries(CellularSegmentation2 ${ITK_LIBRARIES})


enable_testing()
find_path(INPUT_DATA_DIR
NAMES BrainProtonDensitySlice.png
HINTS ${ITK_SOURCE_DIR}/Examples/Data
set(INPUT_DIR ${BioCell_SOURCE_DIR}/examples/Data)
set(TEST_OUTPUT_DIR ${BioCell_BINARY_DIR}/Testing/Temporary)


add_test(NAME CellularSegmentation1Test
COMMAND CellularSegmentation1
${INPUT_DIR}/BrainProtonDensitySlice.png
100 115 200 255 3000
${TEST_OUTPUT_DIR}/CellularSegmentation1Test.vtk
)

add_test(NAME CellularSegmentation2Test
COMMAND CellularSegmentation2
${INPUT_DIR}/brainweb1e1a10f20.mha
81 113 96 220 255 2000
${TEST_OUTPUT_DIR}/CellularSegmentation2Test.vtk
)
set(TEST_OUTPUT_DIR ${BioCell_Examples_BINARY_DIR}/Testing/Temporary)

if(INPUT_DATA_DIR)
add_test(NAME CellularSegmentation1Test
COMMAND CellularSegmentation1
${INPUT_DATA_DIR}/BrainProtonDensitySlice.png
100 115 200 255 3000
${TEST_OUTPUT_DIR}/CellularSegmentation1Test.vtk
)
add_test(NAME CellularSegmentation2Test
COMMAND CellularSegmentation2
${INPUT_DATA_DIR}/BrainWeb/brainweb1e1a10f20.mha}
81 113 96 220 255 2000
${TEST_OUTPUT_DIR}/CellularSegmentation2Test.vtk
)
endif()
Binary file added examples/Data/BrainProtonDensitySlice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/Data/brainweb1e1a10f20.mha
Binary file not shown.

0 comments on commit a913422

Please sign in to comment.