Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkConjugateGradientOptimizerView.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 <itkConjugateGradientOptimizer.h>
20 
22  : QmitkRigidRegistrationOptimizerGUIBase(parent, f), m_NumberTransformParameters(16)
23 {
24 }
25 
27 {
29 }
30 
32 {
33 }
34 
36 {
38  OptimizerPointer->SetMaximize(m_Controls.m_Maximize->isChecked());
39  /*typedef itk::ConjugateGradientOptimizer::InternalOptimizerType vnlOptimizerType;
40  vnlOptimizerType * vnlOptimizer = OptimizerPointer->GetOptimizer();
41  vnlOptimizer->set_f_tolerance( 1e-3 );
42  vnlOptimizer->set_g_tolerance( 1e-4 );
43  vnlOptimizer->set_x_tolerance( 1e-8 );
44  vnlOptimizer->set_epsilon_function( 1e-10 );
45  vnlOptimizer->set_max_function_evals( m_Iterations );
46  vnlOptimizer->set_check_derivatives( 3 );*/
47 
48  return OptimizerPointer.GetPointer();
49 }
50 
52 {
53  itk::Array<double> optimizerValues;
54  optimizerValues.SetSize(1);
55  optimizerValues.fill(0);
56  optimizerValues[0] = m_Controls.m_Maximize->isChecked();
57  return optimizerValues;
58 }
59 
60 void QmitkConjugateGradientOptimizerView::SetOptimizerParameters(itk::Array<double> optimizerValues)
61 {
62  m_Controls.m_Maximize->setChecked(optimizerValues[0]);
63 }
64 
66 {
67  m_NumberTransformParameters = transformParameters;
68 }
69 
71 {
72  return "ConjugateGradient";
73 }
74 
76 {
77  m_Controls.setupUi(parent);
78 }
itk::SmartPointer< Self > Pointer
virtual void SetOptimizerParameters(itk::Array< double > metricValues) override
virtual void SetNumberOfTransformParameters(int transformParameters) override
QmitkConjugateGradientOptimizerView(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
virtual mitk::OptimizerParameters::OptimizerType GetOptimizerType() override
virtual void SetupUI(QWidget *parent) override
virtual itk::Array< double > GetOptimizerParameters() override
virtual itk::Object::Pointer GetOptimizer() override
Ui::QmitkConjugateGradientOptimizerControls 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.