19 #include <itkKullbackLeiblerCompareHistogramImageToImageMetric.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_NumberOfHistogramBinsKullbackLeiblerCompareHistogram->text().toInt();
57 typename itk::KullbackLeiblerCompareHistogramImageToImageMetric<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_NumberOfHistogramBinsKullbackLeiblerCompareHistogram->text().toInt();
80 m_Controls.m_ComputeGradient->setChecked(metricValues[0]);
81 m_Controls.m_NumberOfHistogramBinsKullbackLeiblerCompareHistogram->setText(QString::number(metricValues[1]));
86 return "KullbackLeiblerCompareHistogram";
92 QValidator *validatorLineEditInput =
new QIntValidator(0, 20000000,
this);
93 m_Controls.m_NumberOfHistogramBinsKullbackLeiblerCompareHistogram->setValidator(validatorLineEditInput);
~QmitkKullbackLeiblerCompareHistogramMetricView()
itk::SmartPointer< Self > Pointer
virtual itk::Object::Pointer GetMetric() override
virtual QString GetName() override
virtual void SetMetricParameters(itk::Array< double > metricValues) override
QmitkKullbackLeiblerCompareHistogramMetricView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
virtual itk::Array< double > GetMetricParameters() override
mitk::Image::Pointer m_MovingImage
virtual bool Maximize() override
#define AccessByItk(mitkImage, itkImageTypeFunction)
Access a MITK image by an ITK image.
MetricType
Unique integer value for every metric.
itk::Object::Pointer m_MetricObject
virtual void SetupUI(QWidget *parent) override
Ui::QmitkKullbackLeiblerCompareHistogramMetricControls m_Controls
Widget for rigid registration.
virtual mitk::MetricParameters::MetricType GetMetricType() override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.