ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkExhaustiveOptimizerv4.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 itkExhaustiveOptimizerv4_h
19 #define itkExhaustiveOptimizerv4_h
20 
21 #include "itkIntTypes.h"
23 
24 namespace itk
25 {
77 template<typename TInternalComputationValueType>
79  public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
80 {
81 public:
87 
89  itkNewMacro(Self);
90 
93 
96 
99 
102 
105 
106  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
107 
109  void StartWalking();
110 
112  void ResumeWalking();
113 
115  void StopWalking();
116 
117  itkSetMacro(StepLength, double);
118  itkSetMacro(NumberOfSteps, StepsType);
119  itkGetConstReferenceMacro(StepLength, double);
120  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
121  itkGetConstReferenceMacro(CurrentValue, MeasureType);
122  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
123  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
124  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
125  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
126  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
127 
129  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
130 
132  void SetInitialPosition(const ParametersType & param);
133 
135  ParametersType & GetInitialPosition(void)
136  {
137  return m_InitialPosition;
138  }
139 
140 protected:
143  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
144 
146  void AdvanceOneStep();
147 
148  void IncrementIndex(ParametersType & param);
149 
150 protected:
154  bool m_Stop;
155  double m_StepLength;
161 
162 private:
163  ExhaustiveOptimizerv4(const Self &) ITK_DELETE_FUNCTION;
164  void operator=(const Self &) ITK_DELETE_FUNCTION;
165 
166  std::ostringstream m_StopConditionDescription;
167 };
168 } // end namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "itkExhaustiveOptimizerv4.hxx"
172 #endif
173 
174 #endif
OptimizerParameters< TInternalComputationValueType > ScalesType
Light weight base class for most itk classes.
OptimizerParameters< TInternalComputationValueType > ParametersType
std::ostringstream m_StopConditionDescription
Superclass::ParametersType ParametersType
Superclass::MeasureType MeasureType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void SetInitialPosition(const ParametersType &param)
SmartPointer< const Self > ConstPointer
virtual const std::string GetStopConditionDescription() const override
virtual void StartOptimization(bool doOnlyInitialization=false) override
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
ParametersType & GetInitialPosition(void)
Array< SizeValueType > StepsType
Optimizer that fully samples a grid on the parametric space.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base for object-to-object optimizers.
void IncrementIndex(ParametersType &param)