ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkOptimizer_h
19 #define __itkOptimizer_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
23 #include "itkArray.h"
24 #include "itkOptimizerParameters.h"
25 
26 namespace itk
27 {
37 class Optimizer:public Object
38 {
39 public:
41  typedef Optimizer Self;
42  typedef Object Superclass;
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(Optimizer, Object);
51 
55 
63 
65  virtual void SetInitialPosition(const ParametersType & param);
66 
68  itkGetConstReferenceMacro(InitialPosition, ParametersType);
69 
71  void SetScales(const ScalesType & scales);
72 
74  itkGetConstReferenceMacro(Scales, ScalesType);
75  itkGetConstReferenceMacro(InverseScales, ScalesType);
77 
79  itkGetConstReferenceMacro(CurrentPosition, ParametersType);
80 
82  virtual void StartOptimization() {}
83 
85  virtual const std::string GetStopConditionDescription() const;
86 
87 protected:
88  Optimizer();
89  virtual ~Optimizer() {}
90  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
91 
93  virtual void SetCurrentPosition(const ParametersType & param);
94 
96 
97  // Keep m_CurrentPosition as a protected var so that subclasses can
98  // have fast access. This is important when optimizing high-dimensional
99  // spaces, e.g. bspline transforms.
101 
102 private:
103  Optimizer(const Self &); //purposely not implemented
104  void operator=(const Self &); //purposely not implemented
105 
109 };
110 } // end namespace itk
111 
112 #endif
Light weight base class for most itk classes.
SmartPointer< Self > Pointer
Definition: itkOptimizer.h:43
virtual void SetCurrentPosition(const ParametersType &param)
virtual const std::string GetStopConditionDescription() const
ScalesType m_InverseScales
Definition: itkOptimizer.h:108
ScalesType m_Scales
Definition: itkOptimizer.h:107
Generic representation for an optimization method.
Definition: itkOptimizer.h:37
void operator=(const Self &)
ParametersType m_InitialPosition
Definition: itkOptimizer.h:106
SmartPointer< const Self > ConstPointer
Definition: itkOptimizer.h:44
ParametersType m_CurrentPosition
Definition: itkOptimizer.h:100
bool m_ScalesInitialized
Definition: itkOptimizer.h:95
Object Superclass
Definition: itkOptimizer.h:42
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual ~Optimizer()
Definition: itkOptimizer.h:89
Optimizer Self
Definition: itkOptimizer.h:41
virtual void SetInitialPosition(const ParametersType &param)
void SetScales(const ScalesType &scales)
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Base class for most ITK classes.
Definition: itkObject.h:57
virtual void StartOptimization()
Definition: itkOptimizer.h:82
OptimizerParameters< double > ParametersType
Definition: itkOptimizer.h:50
Array< double > ScalesType
Definition: itkOptimizer.h:62