diff --git a/include/itkANTSRegistration.hxx b/include/itkANTSRegistration.hxx index ed88cd7..00caa4e 100644 --- a/include/itkANTSRegistration.hxx +++ b/include/itkANTSRegistration.hxx @@ -488,6 +488,13 @@ ANTSRegistration::GenerateData( { SingleStageRegistration(xfrmMethod, initialTransform, fixedImage, movingImage, true); } + else if (whichTransform == "quickrigid") + { + auto originalIterations = m_AffineIterations; + m_AffineIterations = { 20, 20, 0, 0 }; + SingleStageRegistration(RegistrationHelperType::XfrmMethod::Rigid, initialTransform, fixedImage, movingImage, true); + m_AffineIterations = originalIterations; + } else if (whichTransform == "trsaa") { auto originalGradientStep = m_GradientStep; @@ -537,6 +544,21 @@ ANTSRegistration::GenerateData( SingleStageRegistration( RegistrationHelperType::XfrmMethod::SyN, intermediateTransform, fixedImage, movingImage, true); } + else if (whichTransform == "syncc") + { + std::string originalMetric = m_AffineMetric; + m_AffineMetric = "CC"; + SingleStageRegistration( + RegistrationHelperType::XfrmMethod::Affine, initialTransform, fixedImage, movingImage, m_MaskAllStages); + m_AffineMetric = originalMetric; + this->UpdateProgress(0.15); + originalMetric = m_SynMetric; + m_SynMetric = "CC"; + typename OutputTransformType::Pointer intermediateTransform = m_Helper->GetModifiableCompositeTransform(); + SingleStageRegistration( + RegistrationHelperType::XfrmMethod::SyN, intermediateTransform, fixedImage, movingImage, true); + m_SynMetric = originalMetric; + } else if (whichTransform.substr(0, 3) == "tv[") // TV[n] { unsigned tsl = whichTransform.size(); // transform string length diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5bee6d3..2e96848 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -498,6 +498,38 @@ itk_add_test(NAME antsRegistrationTest_SyNScaleNoMasks_2stage 1 # maskAllStages ) +itk_add_test(NAME antsRegistration_SyNCC + COMMAND ANTsWasmTestDriver + --compare + DATA{Baseline/antsRegistrationTest_SyNScaleNoMasks_Float.result.nii.gz} + ${ITK_TEST_OUTPUT_DIR}/antsRegistration_SyNCC.result.nii.gz + --compareIntensityTolerance 9 + --compareRadiusTolerance 1 + --compareNumberOfPixelsTolerance 1000 + itkANTSRegistrationTest + DATA{Input/test.nii.gz} # fixed image + DATA{Input/scale.test.nii.gz} # moving image + ${ITK_TEST_OUTPUT_DIR}/antsRegistration_SyNCC.tfm # output transform + ${ITK_TEST_OUTPUT_DIR}/antsRegistration_SyNCC.result.nii.gz # moving image warped to fixed space + DATA{Input/Initializer_0.05_antsRegistrationTest_AffineScaleMasks_Float.mat} # initial transform + none # fixedMask + none # movingMask + 0.25 # GradientStep + SyNCC + Irrelevant # affineMetric + 0.20 # samplingRate + 4 # ccRadius + 25x20x5 # affineIterations + 3x2x1 # shrinkFactors + 2x1x0 # smoothingSigmas + 0 # randomSeed (0 means do not set) + Irrelevant # synMetric + 100x70x20 # synIterations + --float + 0 # collapseTransforms + 1 # maskAllStages + ) + itk_add_test(NAME antsRegistration_SyNRA COMMAND ANTsWasmTestDriver --compare