Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkKappaStatisticMetricView.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 #include "mitkImageAccessByItk.h"
19 #include <itkKappaStatisticImageToImageMetric.h>
20 
23 {
24 }
25 
27 {
28 }
29 
31 {
33 }
34 
36 {
37  if (m_MovingImage.IsNotNull())
38  {
39  AccessByItk(m_MovingImage, GetMetric2);
40  return m_MetricObject;
41  }
42  return nullptr;
43 }
44 
45 template <class TPixelType, unsigned int VImageDimension>
46 itk::Object::Pointer QmitkKappaStatisticMetricView::GetMetric2(itk::Image<TPixelType, VImageDimension> * /*itkImage1*/)
47 {
48  typedef typename itk::Image<TPixelType, VImageDimension> FixedImageType;
49  typedef typename itk::Image<TPixelType, VImageDimension> MovingImageType;
52  MetricPointer->SetComputeGradient(m_Controls.m_ComputeGradient->isChecked());
53  m_MetricObject = MetricPointer.GetPointer();
54  return MetricPointer.GetPointer();
55 }
56 
58 {
59  itk::Array<double> metricValues;
60  metricValues.SetSize(1);
61  metricValues.fill(0);
62  metricValues[0] = m_Controls.m_ComputeGradient->isChecked();
63  return metricValues;
64 }
65 
66 void QmitkKappaStatisticMetricView::SetMetricParameters(itk::Array<double> metricValues)
67 {
68  m_Controls.m_ComputeGradient->setChecked(metricValues[0]);
69 }
70 
72 {
73  return "KappaStatistic";
74 }
75 
77 {
78  m_Controls.setupUi(parent);
79 }
80 
82 {
83  return true;
84 }
itk::SmartPointer< Self > Pointer
QmitkKappaStatisticMetricView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
virtual void SetMetricParameters(itk::Array< double > metricValues) override
virtual itk::Array< double > GetMetricParameters() override
virtual itk::Object::Pointer GetMetric() override
#define AccessByItk(mitkImage, itkImageTypeFunction)
Access a MITK image by an ITK image.
virtual mitk::MetricParameters::MetricType GetMetricType() override
Ui::QmitkKappaStatisticMetricControls m_Controls
MetricType
Unique integer value for every metric.
virtual void SetupUI(QWidget *parent) override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.