File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ itk_module(Cuberille
2727 ITKQuadEdgeMeshFiltering
2828 ITKThresholding
2929 ITKIOImageBase
30+ ITKIOMeta
31+ ITKIONRRD
32+ ITKIOMeshBase
33+ ITKIOVTK
3034 DESCRIPTION
3135 "${DOCUMENTATION} "
3236 EXCLUDE_FROM_DEFAULT
Original file line number Diff line number Diff line change @@ -316,6 +316,19 @@ add_test(
316316 100 # Maximum number of steps
317317)
318318
319+ add_test (
320+ NAME tibial_cartilage_cropped
321+ COMMAND CuberilleTestDriver CuberilleTest01
322+ ${DATA_DIR} /tibial_cartilage_cropped.nrrd
323+ ${ITK_TEST_OUTPUT_DIR} /tibial_cartilage_cropped.vtk
324+ 0.5 # Iso-surface value
325+ 20036 # Expected number of points
326+ 40048 # Expected number of cells
327+ 1 # Generate triangle faces
328+ 1 # Project vertices to iso-surface
329+ 0.05 # Surface distance threshold
330+ )
331+
319332#add_test(
320333# Cuberille_Engine_01
321334# CuberilleTest01
Original file line number Diff line number Diff line change 1+ itk_python_expression_add_test (
2+ NAME itkCuberilleImageToMeshFilterPythonTest
3+ EXPRESSION "filter = itk.CuberilleImageToMeshFilter.New()"
4+ )
5+
6+ set (test_input_dir ${CMAKE_CURRENT_SOURCE_DIR} /../../test/Input)
7+ # cmake_path(CONVERT ${test_input_dir} TO_CMAKE_PATH_LIST test_input_dir NORMALIZE) # CMake 3.20+
8+
9+ list (FIND ITK_WRAP_IMAGE_DIMS 3 wrap_3_index)
10+ if (wrap_3_index GREATER -1)
11+ itk_python_add_test (NAME tibial_cartilage_cropped_test_python
12+ TEST_DRIVER_ARGS
13+ COMMAND cuberille_test.py
14+ DATA{${test_input_dir}/tibial_cartilage_cropped.nrrd}
15+ ${ITK_TEST_OUTPUT_DIR} /tibial_cartilage_cropped.vtk
16+ )
17+ endif ()
18+
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ import itk
4+
5+ image = itk .imread (sys .argv [1 ])
6+ mesh = itk .cuberille_image_to_mesh_filter (
7+ image ,
8+ generate_triangle_faces = True ,
9+ iso_surface_value = 0.5 ,
10+ project_vertices_to_iso_surface = True ,
11+ project_vertex_surface_distance_threshold = 0.05 ,
12+ )
13+ itk .meshwrite (mesh , sys .argv [2 ])
You can’t perform that action at this time.
0 commit comments