ITK  4.6.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 {
84 {
85 public:
91 
94  itkNewMacro(Self);
95 
98 
99  virtual void StartOptimization(void) ITK_OVERRIDE;
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  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
121 
122 protected:
124  virtual ~ExhaustiveOptimizer() {}
125  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
126 
128  void AdvanceOneStep(void);
129 
130  void IncrementIndex(ParametersType & param);
131 
132 protected:
134 
136 
138 
139  bool m_Stop;
140 
141  unsigned int m_CurrentParameter;
142 
143  double m_StepLength;
144 
146 
148 
150 
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
Light weight base class for most itk classes.
virtual void StartOptimization(void) ITK_OVERRIDE
This class is a base for the Optimization methods that optimize a single valued function.
void IncrementIndex(ParametersType &param)
Array< SizeValueType > StepsType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
void operator=(const Self &)
virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE
Optimizer that fully samples a grid on the parametric space.
std::ostringstream m_StopConditionDescription
SmartPointer< Self > Pointer
SmartPointer< const Self > ConstPointer
SingleValuedNonLinearOptimizer Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ParametersType m_MaximumMetricValuePosition
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
ParametersType m_MinimumMetricValuePosition