Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkQuaternionRigidTransformGradientDescentOptimizerView.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 <itkQuaternionRigidTransformGradientDescentOptimizer.h>
20 
22  QWidget *parent, Qt::WindowFlags f)
23  : QmitkRigidRegistrationOptimizerGUIBase(parent, f), m_NumberTransformParameters(16)
24 {
25 }
26 
28 {
29 }
30 
32 {
34 }
35 
37 {
40  OptimizerPointer->SetMaximize(m_Controls.m_Maximize->isChecked());
41  OptimizerPointer->SetLearningRate(m_Controls.m_LearningRateQuaternionRigidTransformGradientDescent->text().toFloat());
42  OptimizerPointer->SetNumberOfIterations(
43  m_Controls.m_IterationsQuaternionRigidTransformGradientDescent->text().toInt());
44  return OptimizerPointer.GetPointer();
45 }
46 
48 {
49  itk::Array<double> optimizerValues;
50  optimizerValues.SetSize(3);
51  optimizerValues.fill(0);
52  optimizerValues[0] = m_Controls.m_Maximize->isChecked();
53  optimizerValues[1] = m_Controls.m_LearningRateQuaternionRigidTransformGradientDescent->text().toFloat();
54  optimizerValues[2] = m_Controls.m_IterationsQuaternionRigidTransformGradientDescent->text().toInt();
55  return optimizerValues;
56 }
57 
59  itk::Array<double> optimizerValues)
60 {
61  m_Controls.m_Maximize->setChecked(optimizerValues[0]);
62  m_Controls.m_LearningRateQuaternionRigidTransformGradientDescent->setText(QString::number(optimizerValues[1]));
63  m_Controls.m_IterationsQuaternionRigidTransformGradientDescent->setText(QString::number(optimizerValues[2]));
64 }
65 
67 {
68  m_NumberTransformParameters = transformParameters;
69 }
70 
72 {
73  return "QuaternionRigidTransformGradientDescent";
74 }
75 
77 {
78  m_Controls.setupUi(parent);
79  QValidator *validatorLineEditInput = new QIntValidator(0, 20000000, this);
80  m_Controls.m_IterationsQuaternionRigidTransformGradientDescent->setValidator(validatorLineEditInput);
81  QValidator *validatorLineEditInputFloat = new QDoubleValidator(0, 20000000, 8, this);
82  m_Controls.m_LearningRateQuaternionRigidTransformGradientDescent->setValidator(validatorLineEditInputFloat);
83 }
itk::SmartPointer< Self > Pointer
QmitkQuaternionRigidTransformGradientDescentOptimizerView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
Ui::QmitkQuaternionRigidTransformGradientDescentOptimizerControls m_Controls
OptimizerType
Unique integer value for every optimizer.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.