19 #include <itkMeanSquaresHistogramImageToImageMetric.h>
47 template <
class TPixelType,
unsigned int VImageDimension>
49 itk::Image<TPixelType, VImageDimension> * )
51 typedef typename itk::Image<TPixelType, VImageDimension> FixedImageType;
52 typedef typename itk::Image<TPixelType, VImageDimension> MovingImageType;
55 unsigned int nBins =
m_Controls.m_NumberOfHistogramBinsMeanSquaresHistogram->text().toInt();
56 typename itk::MeanSquaresHistogramImageToImageMetric<FixedImageType, MovingImageType>::HistogramType::SizeType
58 histogramSize[0] = nBins;
59 histogramSize[1] = nBins;
60 MetricPointer->SetHistogramSize(histogramSize);
61 MetricPointer->SetComputeGradient(
m_Controls.m_ComputeGradient->isChecked());
63 return MetricPointer.GetPointer();
68 itk::Array<double> metricValues;
69 metricValues.SetSize(2);
71 metricValues[0] =
m_Controls.m_ComputeGradient->isChecked();
72 metricValues[1] =
m_Controls.m_NumberOfHistogramBinsMeanSquaresHistogram->text().toInt();
78 m_Controls.m_ComputeGradient->setChecked(metricValues[0]);
79 m_Controls.m_NumberOfHistogramBinsMeanSquaresHistogram->setText(QString::number(metricValues[1]));
84 return "MeanSquaresHistogram";
90 QValidator *validatorLineEditInput =
new QIntValidator(0, 20000000,
this);
91 m_Controls.m_NumberOfHistogramBinsMeanSquaresHistogram->setValidator(validatorLineEditInput);
itk::SmartPointer< Self > Pointer
virtual mitk::MetricParameters::MetricType GetMetricType() override
virtual itk::Array< double > GetMetricParameters() override
Ui::QmitkMeanSquaresHistogramMetricControls m_Controls
~QmitkMeanSquaresHistogramMetricView()
virtual itk::Object::Pointer GetMetric() override
virtual void SetMetricParameters(itk::Array< double > metricValues) override
mitk::Image::Pointer m_MovingImage
#define AccessByItk(mitkImage, itkImageTypeFunction)
Access a MITK image by an ITK image.
MetricType
Unique integer value for every metric.
virtual bool Maximize() override
itk::Object::Pointer m_MetricObject
virtual void SetupUI(QWidget *parent) override
Widget for rigid registration.
QmitkMeanSquaresHistogramMetricView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
virtual QString GetName() override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.