ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkOnePlusOneEvolutionaryOptimizer.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 __itkOnePlusOneEvolutionaryOptimizer_h
19 #define __itkOnePlusOneEvolutionaryOptimizer_h
20 
23 #include <string>
24 
25 namespace itk
26 {
72 {
73 public:
79 
81  itkNewMacro(Self);
82 
85 
89 
92 
94  itkSetMacro(Maximize, bool);
95  itkBooleanMacro(Maximize);
96  itkGetConstReferenceMacro(Maximize, bool);
98 
99  bool GetMinimize() const
100  { return !m_Maximize; }
101  void SetMinimize(bool v)
102  { this->SetMaximize(!v); }
103  void MinimizeOn(void)
104  { SetMaximize(false); }
105  void MinimizeOff(void)
106  { SetMaximize(true); }
107 
109  itkSetMacro(MaximumIteration, unsigned int);
110  itkGetConstReferenceMacro(MaximumIteration, unsigned int);
112 
114  itkSetMacro(GrowthFactor, double);
115  itkGetConstReferenceMacro(GrowthFactor, double);
117 
119  itkSetMacro(ShrinkFactor, double);
120  itkGetConstReferenceMacro(ShrinkFactor, double);
122 
124  itkSetMacro(InitialRadius, double);
125  itkGetConstReferenceMacro(InitialRadius, double);
127 
130  itkSetMacro(Epsilon, double);
131  itkGetConstReferenceMacro(Epsilon, double);
133 
135  itkGetConstReferenceMacro(FrobeniusNorm, double);
136 
137  void SetNormalVariateGenerator(NormalVariateGeneratorType *generator);
138 
145  void Initialize(double initialRadius, double grow = -1, double shrink = -1);
146 
148  itkGetConstReferenceMacro(CurrentCost, MeasureType);
149  MeasureType GetValue() const { return this->GetCurrentCost(); }
151 
153  itkGetConstReferenceMacro(CurrentIteration, unsigned int);
154 
156  itkGetConstReferenceMacro(Initialized, bool);
157 
161  void StartOptimization();
162 
166  void StopOptimization()
167  { m_Stop = true; }
168 
169  itkGetConstReferenceMacro(CatchGetValueException, bool);
170  itkSetMacro(CatchGetValueException, bool);
171 
172  itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
173  itkSetMacro(MetricWorstPossibleValue, double);
174 
175  const std::string GetStopConditionDescription() const;
176 
177 protected:
181  void PrintSelf(std::ostream & os, Indent indent) const;
182 
183 private:
184 
187 
189  unsigned int m_MaximumIteration;
190 
192  unsigned int m_CurrentIteration;
193 
196 
199 
202  double m_Epsilon;
203 
206 
209 
212 
215 
218 
223  bool m_Stop;
224 
226  std::ostringstream m_StopConditionDescription;
227 
231 }; // end of class
232 } // end of namespace itk
233 
234 #endif
235