ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkOnePlusOneEvolutionaryOptimizerv4.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 itkOnePlusOneEvolutionaryOptimizerv4_h
19 #define itkOnePlusOneEvolutionaryOptimizerv4_h
20 
23 #include <string>
24 
25 namespace itk
26 {
68 template<typename TInternalComputationValueType>
69 class ITK_TEMPLATE_EXPORT OnePlusOneEvolutionaryOptimizerv4:
70  public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
71 {
72 public:
78 
80  itkNewMacro(Self);
81 
84 
88 
91 
94 
96  typedef typename Superclass::ParametersType ParametersType;
97 
99  typedef typename Superclass::ScalesType ScalesType;
100 
102  itkSetMacro(MaximumIteration, unsigned int);
103  itkGetConstReferenceMacro(MaximumIteration, unsigned int);
105 
107  itkSetMacro(GrowthFactor, double);
108  itkGetConstReferenceMacro(GrowthFactor, double);
110 
112  itkSetMacro(ShrinkFactor, double);
113  itkGetConstReferenceMacro(ShrinkFactor, double);
115 
117  itkSetMacro(InitialRadius, double);
118  itkGetConstReferenceMacro(InitialRadius, double);
120 
123  itkSetMacro(Epsilon, double);
124  itkGetConstReferenceMacro(Epsilon, double);
126 
128  itkGetConstReferenceMacro(FrobeniusNorm, double);
129 
130  void SetNormalVariateGenerator(NormalVariateGeneratorType *generator);
131 
138  void Initialize(double initialRadius, double grow = -1, double shrink = -1);
139 
141  itkGetConstReferenceMacro(CurrentCost, MeasureType);
142  virtual const MeasureType & GetValue() const ITK_OVERRIDE;
144 
146  itkGetConstReferenceMacro(Initialized, bool);
147 
151  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
152 
156  void StopOptimization()
157  { m_Stop = true; }
158 
159  itkGetConstReferenceMacro(CatchGetValueException, bool);
160  itkSetMacro(CatchGetValueException, bool);
161 
162  itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
163  itkSetMacro(MetricWorstPossibleValue, double);
164 
165  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
166 
167 protected:
169  OnePlusOneEvolutionaryOptimizerv4(const OnePlusOneEvolutionaryOptimizerv4 &);
170  virtual ~OnePlusOneEvolutionaryOptimizerv4() ITK_OVERRIDE;
171  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
172 
173 private:
174 
177 
179  unsigned int m_MaximumIteration;
180 
181  bool m_CatchGetValueException;
182  double m_MetricWorstPossibleValue;
183 
186  double m_Epsilon;
187 
189  double m_InitialRadius;
190 
192  double m_GrowthFactor;
193 
195  double m_ShrinkFactor;
196 
198  bool m_Initialized;
199 
201  MeasureType m_CurrentCost;
202 
207  bool m_Stop;
208 
210  std::ostringstream m_StopConditionDescription;
211 
214  double m_FrobeniusNorm;
215 }; // end of class
216 } // end of namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkOnePlusOneEvolutionaryOptimizerv4.hxx"
220 #endif
221 
222 #endif
Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType
Light weight base class for most itk classes.
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
Defines common interfaces for random variate generators.
This class is a base for a CostFunction that returns a single value.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base for object-to-object optimizers.