ITK  4.2.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 ITK_EXPORT 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 
77  itkGetConstReferenceMacro(CurrentPosition, ParametersType);
78 
80  virtual void StartOptimization() {}
81 
83  virtual const std::string GetStopConditionDescription() const;
84 
85 protected:
86  Optimizer();
87  virtual ~Optimizer() {}
88  void PrintSelf(std::ostream & os, Indent indent) const;
89 
91  virtual void SetCurrentPosition(const ParametersType & param);
92 
94 
95  // Keep m_CurrentPosition as a protected var so that subclasses can
96  // have fast access. This is important when optimizing high-dimensional
97  // spaces, e.g. bspline transforms.
99 private:
100  Optimizer(const Self &); //purposely not implemented
101  void operator=(const Self &); //purposely not implemented
102 
105 };
106 } // end namespace itk
107 
108 #endif
109