Skip to content

Commit

Permalink
Merge pull request #9 from dzenanz/rigidTests
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz authored Jan 29, 2024
2 parents 203b5d4 + a6417df commit 3f40a6d
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/itkANTSRegistration.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ ANTSRegistration<TFixedImage, TMovingImage, TParametersValueType>::GenerateData(
}
break;
default:
itkExceptionMacro(<< "Unsupported transform type: " << whichTransform);
itkExceptionMacro(<< "Unsupported transform type: " << this->GetTypeOfTransform());
}

// set the vector-vector parameters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bafkreibhqtvznxbhf72l2hba6emdnmfdvwxjm4lxqxjdsyee4pjpd3aypy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bafkreicui7753dmitb7blhst3dpeagdsxekrjjdykqeh4ovedvz2tsgxe4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bafkreicui7753dmitb7blhst3dpeagdsxekrjjdykqeh4ovedvz2tsgxe4
64 changes: 64 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ itk_add_test(NAME antsRegistrationTest_AffineRotationMasks
DATA{Input/test_mask.nii.gz} # fixedMask
DATA{Input/rotation.test_mask.nii.gz} # movingMask
0.001 # (minimum?) StepLength
Affine
)

itk_add_test(NAME antsRegistrationTest_AffineRotationNoMasks
Expand All @@ -49,6 +50,7 @@ itk_add_test(NAME antsRegistrationTest_AffineRotationNoMasks
none # fixedMask
none # movingMask
0.001 # (minimum?) StepLength
Affine
)

itk_add_test(NAME antsRegistrationTest_AffineScaleMasks
Expand All @@ -68,6 +70,7 @@ itk_add_test(NAME antsRegistrationTest_AffineScaleMasks
DATA{Input/test_mask.nii.gz} # fixedMask
DATA{Input/scale.test_mask.nii.gz} # movingMask
0.001 # (minimum?) StepLength
Affine
)

itk_add_test(NAME antsRegistrationTest_AffineScaleNoMasks
Expand All @@ -87,4 +90,65 @@ itk_add_test(NAME antsRegistrationTest_AffineScaleNoMasks
none # fixedMask
none # movingMask
0.001 # (minimum?) StepLength
Affine
)

itk_add_test(NAME antsRegistrationTest_AffineTranslationNoMasks
COMMAND ANTsWasmTestDriver
--compare
DATA{Baseline/antsRegistrationTest_AffineTranslationNoMasks.result.nii.gz}
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_AffineTranslationNoMasks.result.nii.gz
--compareIntensityTolerance 7
--compareRadiusTolerance 0
--compareNumberOfPixelsTolerance 777
itkANTSRegistrationTest
DATA{Input/test.nii.gz} # fixed image
DATA{Input/translation.test.nii.gz} # moving image
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_AffineTranslationNoMasks.tfm # output transform
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_AffineTranslationNoMasks.result.nii.gz # moving image warped to fixed space
DATA{Input/Initializer_antsRegistrationTest_AffineTranslationMasks.mat} # initial transform
none # fixedMask
none # movingMask
0.001 # (minimum?) StepLength
Affine
)

itk_add_test(NAME antsRegistrationTest_RigidRotationHeadMasks
COMMAND ANTsWasmTestDriver
--compare
DATA{Baseline/antsRegistrationTest_RigidRotationHeadMasks.result.nii.gz}
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationHeadMasks.result.nii.gz
--compareIntensityTolerance 7
--compareRadiusTolerance 1
--compareNumberOfPixelsTolerance 777
itkANTSRegistrationTest
DATA{Input/test.nii.gz} # fixed image
DATA{Input/rotation.test.nii.gz} # moving image
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationHeadMasks.tfm # output transform
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationHeadMasks.result.nii.gz # moving image warped to fixed space
DATA{Input/Initializer_0.05_antsRegistrationTest_RigidRotationHeadMasks.mat} # initial transform
none # fixedMask
none # movingMask
0.001 # (minimum?) StepLength
Rigid
)

itk_add_test(NAME antsRegistrationTest_RigidRotationNoMasks
COMMAND ANTsWasmTestDriver
--compare
DATA{Baseline/antsRegistrationTest_RigidRotationNoMasks.result.nii.gz}
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationNoMasks.result.nii.gz
--compareIntensityTolerance 7
--compareRadiusTolerance 1
--compareNumberOfPixelsTolerance 777
itkANTSRegistrationTest
DATA{Input/test.nii.gz} # fixed image
DATA{Input/rotation.test.nii.gz} # moving image
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationNoMasks.tfm # output transform
${ITK_TEST_OUTPUT_DIR}/antsRegistrationTest_RigidRotationNoMasks.result.nii.gz # moving image warped to fixed space
DATA{Input/Initializer_0.05_antsRegistrationTest_RigidRotationNoMasks.mat} # initial transform
none # fixedMask
none # movingMask
0.001 # (minimum?) StepLength
Rigid
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions test/Input/translation.test.nii.gz.cid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bafkreid4leeonupjqnmqdbpjsyee4dcughyowd2zgktgv57mgx2hj75oae
7 changes: 5 additions & 2 deletions test/itkANTSRegistrationTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,13 @@ doTest(int argc, char * argv[])
double gradientStep = std::stod(argv[8]);
filter->SetGradientStep(gradientStep);
}
if (argc > 9)
{
filter->SetTypeOfTransform(argv[9]);
}

filter->SetFixedImage(fixedImage);
filter->SetMovingImage(movingImage);
filter->SetTypeOfTransform("Affine");
ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update());

// debug
Expand Down Expand Up @@ -143,7 +146,7 @@ itkANTSRegistrationTest(int argc, char * argv[])
std::cerr << " fixedImage movingImage outTransform";
std::cerr << " [outMovingResampledToFixedSpace] [initialTransform]";
std::cerr << " [fixedImageMask] [movingImageMask]";
std::cerr << " [gradientStep]";
std::cerr << " [gradientStep] [typeOfTransform]";
std::cerr << std::endl;
return EXIT_FAILURE;
}
Expand Down

0 comments on commit 3f40a6d

Please sign in to comment.