ITK  4.6.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 {
81 template<typename TInternalComputationValueType>
83  public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
84 {
85 public:
91 
93  itkNewMacro(Self);
94 
97 
100 
103 
106 
109 
110  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
111 
113  void StartWalking(void);
114 
116  void ResumeWalking(void);
117 
119  void StopWalking(void);
120 
121  itkSetMacro(StepLength, double);
122  itkSetMacro(NumberOfSteps, StepsType);
123  itkGetConstReferenceMacro(StepLength, double);
124  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
125  itkGetConstReferenceMacro(CurrentValue, MeasureType);
126  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
127  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
128  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
129  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
130  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
131 
133  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
134 
136  void SetInitialPosition(const ParametersType & param);
137 
139  ParametersType & GetInitialPosition(void)
140  {
141  return m_InitialPosition;
142  }
143 
144 protected:
147  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
148 
150  void AdvanceOneStep(void);
151 
152  void IncrementIndex(ParametersType & param);
153 
154 protected:
158  bool m_Stop;
159  unsigned int m_CurrentParameter;
160  double m_StepLength;
166 
167 private:
168  //purposely not implemented
169  ExhaustiveOptimizerv4(const Self &);
170  void operator=(const Self &);
171 
172  std::ostringstream m_StopConditionDescription;
173 };
174 } // end namespace itk
175 
176 #ifndef ITK_MANUAL_INSTANTIATION
177 #include "itkExhaustiveOptimizerv4.hxx"
178 #endif
179 
180 #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
void operator=(const Self &)
virtual void StartOptimization(bool doOnlyInitialization=false) ITK_OVERRIDE
void SetInitialPosition(const ParametersType &param)
SmartPointer< const Self > ConstPointer
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
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Abstract base for object-to-object optimizers.
virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE
void IncrementIndex(ParametersType &param)