Skip to content

Commit 4b38a9b

Browse files
richardbearethewtex
authored andcommitted
tests of modified interpolator and regularstep gradient descent
1 parent 5875e83 commit 4b38a9b

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ int Test_SpeedToPath_GradientDescent_ND(int argc, char* argv[])
289289
pathFilter->Update( );
290290
time.Stop( );
291291
std::cout << std::setprecision(3) << "Path computed in: " << time.GetMean() << " seconds" << std::endl;
292-
293292
// Allocate output image
294293
typename OutputImageType::Pointer output = OutputImageType::New();
295294
output->SetRegions( speed->GetLargestPossibleRegion() );
@@ -399,7 +398,8 @@ int Test_SpeedToPath_RegularStepGradientDescent_ND(int argc, char* argv[])
399398
if (spacing[dim] < minspacing) minspacing = spacing[dim];
400399

401400
// Create Interpolator
402-
using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
401+
using InterpolatorType = itk::LinearInterpolateSelectedNeighborsImageFunction<ImageType, CoordRepType, ValidNeighbor<typename PathFilterType::InputImagePixelType> >;
402+
//using InterpolatorType = itk::LinearInterpolateImageFunction<ImageType, CoordRepType>;
403403
typename InterpolatorType::Pointer interp = InterpolatorType::New();
404404

405405
// Create Cost Function

0 commit comments

Comments
 (0)