19 #include <itkSPSAOptimizer.h>
38 OptimizerPointer->SetMaximize(
m_Controls.m_Maximize->isChecked());
39 OptimizerPointer->Seta(
m_Controls.m_aSPSA->text().toFloat());
40 OptimizerPointer->SetA(
m_Controls.m_ASPSA->text().toFloat());
41 OptimizerPointer->SetAlpha(
m_Controls.m_AlphaSPSA->text().toFloat());
42 OptimizerPointer->Setc(
m_Controls.m_cSPSA->text().toFloat());
43 OptimizerPointer->SetGamma(
m_Controls.m_GammaSPSA->text().toFloat());
44 OptimizerPointer->SetTolerance(
m_Controls.m_ToleranceSPSA->text().toFloat());
45 OptimizerPointer->SetStateOfConvergenceDecayRate(
m_Controls.m_StateOfConvergenceDecayRateSPSA->text().toFloat());
46 OptimizerPointer->SetMinimumNumberOfIterations(
m_Controls.m_MinimumNumberOfIterationsSPSA->text().toInt());
47 OptimizerPointer->SetNumberOfPerturbations(
m_Controls.m_NumberOfPerturbationsSPSA->text().toInt());
48 OptimizerPointer->SetMaximumNumberOfIterations(
m_Controls.m_IterationsSPSA->text().toInt());
49 return OptimizerPointer.GetPointer();
54 itk::Array<double> optimizerValues;
55 optimizerValues.SetSize(3);
56 optimizerValues.fill(0);
57 optimizerValues[0] =
m_Controls.m_Maximize->isChecked();
58 optimizerValues[1] =
m_Controls.m_aSPSA->text().toFloat();
59 optimizerValues[2] =
m_Controls.m_ASPSA->text().toFloat();
60 optimizerValues[3] =
m_Controls.m_AlphaSPSA->text().toFloat();
61 optimizerValues[4] =
m_Controls.m_cSPSA->text().toFloat();
62 optimizerValues[5] =
m_Controls.m_GammaSPSA->text().toFloat();
63 optimizerValues[6] =
m_Controls.m_ToleranceSPSA->text().toFloat();
64 optimizerValues[7] =
m_Controls.m_StateOfConvergenceDecayRateSPSA->text().toFloat();
65 optimizerValues[8] =
m_Controls.m_MinimumNumberOfIterationsSPSA->text().toInt();
66 optimizerValues[9] =
m_Controls.m_NumberOfPerturbationsSPSA->text().toInt();
67 optimizerValues[10] =
m_Controls.m_IterationsSPSA->text().toInt();
68 return optimizerValues;
73 m_Controls.m_Maximize->setChecked(optimizerValues[0]);
74 m_Controls.m_aSPSA->setText(QString::number(optimizerValues[1]));
75 m_Controls.m_ASPSA->setText(QString::number(optimizerValues[2]));
76 m_Controls.m_AlphaSPSA->setText(QString::number(optimizerValues[3]));
77 m_Controls.m_cSPSA->setText(QString::number(optimizerValues[4]));
78 m_Controls.m_GammaSPSA->setText(QString::number(optimizerValues[5]));
79 m_Controls.m_ToleranceSPSA->setText(QString::number(optimizerValues[6]));
80 m_Controls.m_StateOfConvergenceDecayRateSPSA->setText(QString::number(optimizerValues[7]));
81 m_Controls.m_MinimumNumberOfIterationsSPSA->setText(QString::number(optimizerValues[8]));
82 m_Controls.m_NumberOfPerturbationsSPSA->setText(QString::number(optimizerValues[9]));
83 m_Controls.m_IterationsSPSA->setText(QString::number(optimizerValues[10]));
99 QValidator *validatorLineEditInput =
new QIntValidator(0, 20000000,
this);
100 m_Controls.m_MinimumNumberOfIterationsSPSA->setValidator(validatorLineEditInput);
101 m_Controls.m_NumberOfPerturbationsSPSA->setValidator(validatorLineEditInput);
102 m_Controls.m_IterationsSPSA->setValidator(validatorLineEditInput);
103 QValidator *validatorLineEditInputFloat =
new QDoubleValidator(0, 20000000, 8,
this);
104 m_Controls.m_aSPSA->setValidator(validatorLineEditInputFloat);
105 m_Controls.m_ASPSA->setValidator(validatorLineEditInputFloat);
106 m_Controls.m_AlphaSPSA->setValidator(validatorLineEditInputFloat);
107 m_Controls.m_cSPSA->setValidator(validatorLineEditInputFloat);
108 m_Controls.m_GammaSPSA->setValidator(validatorLineEditInputFloat);
109 m_Controls.m_ToleranceSPSA->setValidator(validatorLineEditInputFloat);
110 m_Controls.m_StateOfConvergenceDecayRateSPSA->setValidator(validatorLineEditInputFloat);
virtual void SetupUI(QWidget *parent) override
itk::SmartPointer< Self > Pointer
~QmitkSPSAOptimizerView()
virtual void SetNumberOfTransformParameters(int transformParameters) override
virtual void SetOptimizerParameters(itk::Array< double > metricValues) override
virtual QString GetName() override
virtual mitk::OptimizerParameters::OptimizerType GetOptimizerType() override
Ui::QmitkSPSAOptimizerControls m_Controls
Widget for rigid registration.
int m_NumberTransformParameters
virtual itk::Object::Pointer GetOptimizer() override
OptimizerType
Unique integer value for every optimizer.
virtual itk::Array< double > GetOptimizerParameters() override
QmitkSPSAOptimizerView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.