From 6c0488e4d9daf1a35f675f3971ce79c69e371cab Mon Sep 17 00:00:00 2001 From: Nick Tustison Date: Tue, 9 Apr 2024 07:33:07 -0700 Subject: [PATCH] ENH: Add Mattes. --- ants/lib/LOCAL_antsImageToImageMetric.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ants/lib/LOCAL_antsImageToImageMetric.h b/ants/lib/LOCAL_antsImageToImageMetric.h index a42a5910..4e981789 100644 --- a/ants/lib/LOCAL_antsImageToImageMetric.h +++ b/ants/lib/LOCAL_antsImageToImageMetric.h @@ -290,6 +290,17 @@ ANTsImageToImageMetric new_ants_metric( std::string precision, unsig MetricBasePointerType basePointer = dynamic_cast( metricPointer.GetPointer() ); return wrap_metric< MetricType >( basePointer ); } + else if ( metrictype == "MattesMutualInformation" ) + { + typedef itk::Image ImageType; + typedef itk::MattesMutualInformationImageToImageMetricv4 SpecificMetricType; + typename SpecificMetricType::Pointer metricPointer = SpecificMetricType::New(); + typedef itk::ImageToImageMetricv4,itk::Image> MetricBaseType; + typedef typename MetricBaseType::Pointer MetricBasePointerType; + + MetricBasePointerType basePointer = dynamic_cast( metricPointer.GetPointer() ); + return wrap_metric< MetricType >( basePointer ); + } // should never reach this typedef itk::Image ImageType; typedef itk::MeanSquaresImageToImageMetricv4,itk::Image> SpecificMetricType;