File tree Expand file tree Collapse file tree 5 files changed +42
-7
lines changed
Expand file tree Collapse file tree 5 files changed +42
-7
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ jobs:
108108 endif()
109109 set(dashboard_cache "
110110 ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-b
111+ Module_MorphologicalContourInterpolation_BUILD_EXAMPLES:BOOL=ON
111112 BUILD_TESTING:BOOL=ON
112113 ")
113114 string(TIMESTAMP build_date "%Y-%m-%d")
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.10.2)
2+
3+ if (CMAKE_CXX_STANDARD EQUAL "98" )
4+ message (FATAL_ERROR "CMAKE_CXX_STANDARD:STRING=98 is not supported in ITK version 5 and greater." )
5+ endif ()
6+
7+ if (NOT CMAKE_CXX_STANDARD)
8+ set (CMAKE_CXX_STANDARD 11) # Supported values are ``11``, ``14``, and ``17``.
9+ endif ()
10+ if (NOT CMAKE_CXX_STANDARD_REQUIRED)
11+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
12+ endif ()
13+ if (NOT CMAKE_CXX_EXTENSIONS)
14+ set (CMAKE_CXX_EXTENSIONS OFF )
15+ endif ()
16+
217project (MorphologicalContourInterpolation)
318
419if (NOT ITK_SOURCE_DIR)
520 find_package (ITK 4.9 REQUIRED)
621 list (APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR} )
722 include (ITKModuleExternal)
823else ()
24+ set (ITK_DIR ${CMAKE_BINARY_DIR} )
925 itk_module_impl()
1026endif ()
1127
Original file line number Diff line number Diff line change @@ -2,22 +2,30 @@ cmake_minimum_required(VERSION 3.10.2)
22
33project (MorphologicalContourInterpolation_Examples CXX)
44
5- find_package (ITK REQUIRED
6- COMPONENTS
7- MorphologicalContourInterpolation
8- ITKSmoothing
9- ITKIOImageBase
10- ITKIONRRD
11- )
5+ if ( NOT ITK_SOURCE_DIR)
6+ find_package (ITK 5.2 REQUIRED COMPONENTS MorphologicalContourInterpolation ITKSmoothing ITKImageIO ITKTestKernel)
7+ else ()
8+ # when being built as part of ITK, ITKImageIO and ITKTransformIO
9+ # lists of modules are not yet ready, causing a configure error
10+ find_package (ITK REQUIRED COMPONENTS MorphologicalContourInterpolation ITKSmoothing ITKIOImageBase ITKIONRRD ITKTestKernel)
11+ endif ( )
1212include (${ITK_USE_FILE} )
1313
1414add_executable (mciExample mciExample.cxx)
1515target_link_libraries (mciExample ${ITK_LIBRARIES} )
1616
1717
18+ # add some regression tests
1819enable_testing ()
1920
2021add_test (NAME mciExample_SevenLabels_3
2122 COMMAND mciExample ${CMAKE_CURRENT_SOURCE_DIR} /SevenLabels.nrrd
2223 ${CMAKE_CURRENT_BINARY_DIR} /SevenLabels_interpolated.nrrd
2324 3)
25+
26+ if (ITK_WRAP_PYTHON)
27+ add_test (NAME mciExample_ManyToMany
28+ COMMAND python ${CMAKE_CURRENT_LIST_DIR} /mciExample.py
29+ ${CMAKE_CURRENT_SOURCE_DIR} /ManyToMany.nrrd
30+ ${CMAKE_CURRENT_BINARY_DIR} /ManyToMany_interpolated.nrrd)
31+ endif ()
Original file line number Diff line number Diff line change 1+ import itk
2+ import sys
3+
4+ if len (sys .argv ) < 3 :
5+ print ( "Usage: %s <input> <output>" % (sys .argv [0 ]) )
6+ sys .exit (1 )
7+
8+ image = itk .imread (sys .argv [1 ], itk .UC )
9+ filled = itk .morphological_contour_interpolator (image )
10+ itk .imwrite (filled , sys .argv [2 ], compression = True )
You can’t perform that action at this time.
0 commit comments