19 #include <itkCorrelationCoefficientHistogramImageToImageMetric.h>
48 template <
class TPixelType,
unsigned int VImageDimension>
50 itk::Image<TPixelType, VImageDimension> * )
52 typedef typename itk::Image<TPixelType, VImageDimension> FixedImageType;
53 typedef typename itk::Image<TPixelType, VImageDimension> MovingImageType;
56 unsigned int nBins =
m_Controls.m_NumberOfHistogramBinsCorrelationCoefficientHistogram->text().toInt();
57 typename itk::CorrelationCoefficientHistogramImageToImageMetric<FixedImageType,
58 MovingImageType>::HistogramType::SizeType
60 histogramSize[0] = nBins;
61 histogramSize[1] = nBins;
62 MetricPointer->SetHistogramSize(histogramSize);
63 MetricPointer->SetComputeGradient(
m_Controls.m_ComputeGradient->isChecked());
65 return MetricPointer.GetPointer();
70 itk::Array<double> metricValues;
71 metricValues.SetSize(2);
73 metricValues[0] =
m_Controls.m_ComputeGradient->isChecked();
74 metricValues[1] =
m_Controls.m_NumberOfHistogramBinsCorrelationCoefficientHistogram->text().toInt();
80 m_Controls.m_ComputeGradient->setChecked(metricValues[0]);
81 m_Controls.m_NumberOfHistogramBinsCorrelationCoefficientHistogram->setText(QString::number(metricValues[1]));
86 return "CorrelationCoefficientHistogram";
92 QValidator *validatorLineEditInput =
new QIntValidator(0, 20000000,
this);
93 m_Controls.m_NumberOfHistogramBinsCorrelationCoefficientHistogram->setValidator(validatorLineEditInput);
virtual void SetupUI(QWidget *parent) override
itk::SmartPointer< Self > Pointer
virtual itk::Array< double > GetMetricParameters() override
virtual bool Maximize() override
itk::Object::Pointer m_MetricObject
virtual itk::Object::Pointer GetMetric() override
Ui::QmitkCorrelationCoefficientHistogramMetricControls m_Controls
virtual void SetMetricParameters(itk::Array< double > metricValues) override
mitk::Image::Pointer m_MovingImage
QmitkCorrelationCoefficientHistogramMetricView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
#define AccessByItk(mitkImage, itkImageTypeFunction)
Access a MITK image by an ITK image.
virtual mitk::MetricParameters::MetricType GetMetricType() override
MetricType
Unique integer value for every metric.
virtual QString GetName() override
Widget for rigid registration.
~QmitkCorrelationCoefficientHistogramMetricView()
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.