ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkExhaustiveOptimizer.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 __itkExhaustiveOptimizer_h
19 #define __itkExhaustiveOptimizer_h
20 
21 #include "itkIntTypes.h"
23 
24 namespace itk
25 {
82 class ITK_EXPORT ExhaustiveOptimizer:
84 {
85 public:
91 
94  itkNewMacro(Self);
95 
98 
99  virtual void StartOptimization(void);
100 
101  void StartWalking(void);
102 
103  void ResumeWalking(void);
104 
105  void StopWalking(void);
106 
107  itkSetMacro(StepLength, double);
108  itkSetMacro(NumberOfSteps, StepsType);
109  itkGetConstReferenceMacro(StepLength, double);
110  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
111  itkGetConstReferenceMacro(CurrentValue, MeasureType);
112  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
113  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
114  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
115  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
116  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
117  itkGetConstReferenceMacro(MaximumNumberOfIterations, SizeValueType);
118 
120  const std::string GetStopConditionDescription() const;
121 
122 protected:
124  virtual ~ExhaustiveOptimizer() {}
125  void PrintSelf(std::ostream & os, Indent indent) const;
126 
128  void AdvanceOneStep(void);
129 
130  void IncrementIndex(ParametersType & param);
131 
132 protected:
133  MeasureType m_CurrentValue;
134 
136 
138 
139  bool m_Stop;
140 
141  unsigned int m_CurrentParameter;
142 
143  double m_StepLength;
144 
145  ParametersType m_CurrentIndex;
146 
148 
149  MeasureType m_MaximumMetricValue;
150 
151  MeasureType m_MinimumMetricValue;
152 
154 
156 
157 private:
158  //purposely not implemented
159  ExhaustiveOptimizer(const Self &);
160  void operator=(const Self &);
161 
162  std::ostringstream m_StopConditionDescription;
163 };
164 } // end namespace itk
165 
166 #endif
167