Skip to content

Commit

Permalink
Merge pull request #603 from ANTsX/AddMattes
Browse files Browse the repository at this point in the history
ENH:  Add Mattes.
  • Loading branch information
ntustison committed Apr 9, 2024
2 parents 6b218c8 + 6c0488e commit f79e9f3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ants/lib/LOCAL_antsImageToImageMetric.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ ANTsImageToImageMetric<MetricType> new_ants_metric( std::string precision, unsig
MetricBasePointerType basePointer = dynamic_cast<MetricBaseType *>( metricPointer.GetPointer() );
return wrap_metric< MetricType >( basePointer );
}
else if ( metrictype == "MattesMutualInformation" )
{
typedef itk::Image<float, Dimension> ImageType;
typedef itk::MattesMutualInformationImageToImageMetricv4<ImageType,ImageType> SpecificMetricType;
typename SpecificMetricType::Pointer metricPointer = SpecificMetricType::New();
typedef itk::ImageToImageMetricv4<itk::Image<float, Dimension>,itk::Image<float,Dimension>> MetricBaseType;
typedef typename MetricBaseType::Pointer MetricBasePointerType;

MetricBasePointerType basePointer = dynamic_cast<MetricBaseType *>( metricPointer.GetPointer() );
return wrap_metric< MetricType >( basePointer );
}
// should never reach this
typedef itk::Image<float, Dimension> ImageType;
typedef itk::MeanSquaresImageToImageMetricv4<itk::Image<float, Dimension>,itk::Image<float,Dimension>> SpecificMetricType;
Expand Down

0 comments on commit f79e9f3

Please sign in to comment.