Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/External/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

# No examples in this category yet; this file exists because
# src/CMakeLists.txt calls add_subdirectory(External).
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,58 @@ cmake_minimum_required(VERSION 3.22.1)

set(input_image ${CMAKE_CURRENT_BINARY_DIR}/BrainProtonDensitySlice.png)
set(output_image Output.png)
set(test_options 5 0.125 3.0)
set(
test_options
5
0.125
3.0
)

project(ComputeCurvatureAnisotropicDiffusion)

find_package(ITK REQUIRED)
itk_generate_factory_registration()

add_executable(${PROJECT_NAME} Code.cxx)
target_link_libraries(${PROJECT_NAME}
target_link_libraries(
${PROJECT_NAME}
PRIVATE
ITK::ITKImageIO
ITK::ITKAnisotropicSmoothingModule
ITK::ITKImageIntensityModule
)

install(TARGETS ${PROJECT_NAME}
install(
TARGETS
${PROJECT_NAME}
DESTINATION bin/ITKSphinxExamples/Filtering/AnisotropicSmoothing
COMPONENT Runtime
)
)

install(FILES Code.cxx CMakeLists.txt Code.py
DESTINATION share/ITKSphinxExamples/Code/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion
install(
FILES
Code.cxx
CMakeLists.txt
Code.py
DESTINATION
share/ITKSphinxExamples/Code/Filtering/AnisotropicSmoothing/ComputeCurvatureAnisotropicDiffusion
COMPONENT Code
)

enable_testing()
add_test(NAME ComputeCurvatureAnisotropicDiffusionTest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}
${input_image}
${output_image}
${test_options}
add_test(
NAME ComputeCurvatureAnisotropicDiffusionTest
COMMAND
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME} ${input_image}
${output_image} ${test_options}
)

if(ITK_WRAP_PYTHON)
string(REPLACE . "Python." output_image "${output_image}")
add_test(NAME ComputeCurvatureAnisotropicDiffusionTestPython
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py
${input_image}
${output_image}
${test_options}
)
add_test(
NAME ComputeCurvatureAnisotropicDiffusionTestPython
COMMAND
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Code.py ${input_image}
${output_image} ${test_options}
)
endif()
3 changes: 2 additions & 1 deletion src/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

# No examples in this category yet; this file exists because
# src/CMakeLists.txt calls add_subdirectory(GPU).
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,17 @@
seedPosition[0] = args.seed_x
seedPosition[1] = args.seed_y

node = itk.LevelSetNode[InputPixelType, Dimension]()
NodeType = itk.LevelSetNode[InputPixelType, Dimension]

node = NodeType()
node.SetValue(seedValue)
node.SetIndex(seedPosition)

seeds = itk.VectorContainer[itk.UI, itk.LevelSetNode[InputPixelType, Dimension]].New()
try:
NodeContainer = itk.VectorContainer[itk.IT, NodeType] # ITK >= 6.0
except TypeError:
NodeContainer = itk.VectorContainer[itk.UI, NodeType] # ITK <= 5.4
seeds = NodeContainer.New()
seeds.Initialize()
seeds.InsertElement(0, node)

Expand Down
Loading