Skip to content

Commit 40d2cb0

Browse files
richardbeareromangrothausmann
authored andcommitted
tests of modified interpolator and regularstep gradient descent
1 parent 3b5346b commit 40d2cb0

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

examples/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ include(${ITK_USE_FILE})
1616

1717
add_executable(MinimalPathExamples example.cxx)
1818
target_link_libraries(MinimalPathExamples ${ITK_LIBRARIES})
19+
20+
add_executable(interptest interpolator.cxx)
21+
target_link_libraries(interptest ${ITK_LIBRARIES})

test/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ add_test(
216216
0.25
217217
0.5
218218
)
219+
220+
add_test(
221+
NAME MinimalPathExtraction_Real_DSA_01_01_RegularStepGradientDescentShort
222+
COMMAND MinimalPathExtractionTestDriver
223+
--compare ${TESTING_OUTPUT_PATH}/Real-DSA-01-01-RegularStepGradientDescent.png ${BASELINE_DIR}/Real-DSA-01-01-RegularStepGradientDescent.png
224+
Test_SpeedToPath_RegularStepGradientDescent_2D
225+
${TESTING_OUTPUT_PATH}/Real-DSA-01-01-RegularStepGradientDescent.png
226+
${DATA_DIR}/Real-DSA-01-Speed-01.mhd
227+
${DATA_DIR}/Real-DSA-01_short.path
228+
3.0
229+
4000
230+
0.25
231+
0.5
232+
)
219233
#Real-DSA-01-02
220234
add_test(
221235
NAME MinimalPathExtraction_Real_DSA_01_02_NeighborhoodIterate
@@ -426,6 +440,20 @@ add_test(
426440
0.01
427441
)
428442

443+
add_test(
444+
NAME MinimalPathExtraction_Synthetic_01_B_RegularStepGradientDescent_sp
445+
COMMAND MinimalPathExtractionTestDriver
446+
--compare ${TESTING_OUTPUT_PATH}/Synthetic-01-B-GradientDescent-sp.png ${BASELINE_DIR}/Synthetic-01-B-GradientDescent-sp.png
447+
Test_SpeedToPath_RegularStepGradientDescent_2D
448+
${TESTING_OUTPUT_PATH}/Synthetic-01-B-GradientDescent-sp.png
449+
${DATA_DIR}/Synthetic-01-sp-Speed.mhd
450+
${DATA_DIR}/Synthetic-01-B-sp.path
451+
0.01
452+
3000
453+
0.005
454+
0.001
455+
)
456+
429457
add_test(
430458
NAME MinimalPathExtraction_Synthetic_01_C_GradientDescent_sp
431459
COMMAND MinimalPathExtractionTestDriver

test/MinimalPathTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ Test_SpeedToPath_RegularStepGradientDescent_ND(int argc, char * argv[])
406406
minspacing = spacing[dim];
407407

408408
// Create Interpolator
409-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
409+
using InterpolatorType = itk::LinearInterpolateSelectedNeighborsImageFunction<ImageType, CoordRepType, ValidNeighbor<typename PathFilterType::InputImagePixelType>>;
410410
typename InterpolatorType::Pointer interp = InterpolatorType::New();
411411

412412
// Create Cost Function

0 commit comments

Comments
 (0)