go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkFullSearchOptimizer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
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
19#ifndef itkFullSearchOptimizer_h
20#define itkFullSearchOptimizer_h
21
22#include "itkSingleValuedNonLinearOptimizer.h"
23#include "itkMapContainer.h"
24#include "itkImage.h"
25#include "itkArray.h"
26#include "itkFixedArray.h"
27
28namespace itk
29{
30
47{
48public:
50
54 using Pointer = SmartPointer<Self>;
55 using ConstPointer = SmartPointer<const Self>;
56
58 itkNewMacro(Self);
59
62
65 {
68 };
69
70 /* Typedefs inherited from superclass */
71 using Superclass::ParametersType;
72 using Superclass::CostFunctionType;
73 using Superclass::CostFunctionPointer;
74 using Superclass::MeasureType;
75
76 using ParameterValueType = ParametersType::ValueType; // = double
78 using RangeType = FixedArray<RangeValueType, 3>;
79 using SearchSpaceType = MapContainer<unsigned int, RangeType>;
80 using SearchSpacePointer = SearchSpaceType::Pointer;
81 using SearchSpaceIteratorType = SearchSpaceType::ConstIterator;
82
85 using SearchSpacePointType = Array<ParameterValueType>;
86
89 using SearchSpaceIndexType = Array<IndexValueType>;
90
92 using SearchSpaceSizeType = Array<SizeValueType>;
93
97 itkGetConstMacro(Maximize, bool);
98 itkSetMacro(Maximize, bool);
99 itkBooleanMacro(Maximize);
100 bool
102 {
103 return !m_Maximize;
104 }
105 void
107 {
108 this->SetMaximize(!v);
109 }
110 void
112 {
113 this->MaximizeOff();
114 }
115 void
117 {
118 this->MaximizeOn();
119 }
120
135 virtual void
137
141 void
143
147 virtual void
149
153 virtual void
155
166 itkSetObjectMacro(SearchSpace, SearchSpaceType);
168
170 virtual void
171 AddSearchDimension(unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step);
172
173 virtual void
174 RemoveSearchDimension(unsigned int param_nr);
175
177 virtual unsigned long
179
181 virtual unsigned int
183
185 virtual const SearchSpaceSizeType &
187
189 virtual ParametersType
191
192 virtual ParametersType
194
198
200 itkGetConstMacro(CurrentIteration, unsigned long);
201
203 itkGetConstReferenceMacro(CurrentPointInSearchSpace, SearchSpacePointType);
204 itkGetConstReferenceMacro(CurrentIndexInSearchSpace, SearchSpaceIndexType);
205
207 itkGetConstReferenceMacro(BestPointInSearchSpace, SearchSpacePointType);
208 itkGetConstReferenceMacro(BestIndexInSearchSpace, SearchSpaceIndexType);
209
211 itkGetConstMacro(Value, double);
212
214 itkGetConstMacro(BestValue, double);
215
217 itkGetConstMacro(StopCondition, StopConditionType);
218
219protected:
221 ~FullSearchOptimizer() override = default;
222
223 // void PrintSelf(std::ostream& os, Indent indent) const;
224
225 bool m_Maximize{ false };
226 bool m_Stop{ false };
227 double m_Value{ 0.0 };
228 double m_BestValue{ 0.0 };
230
238
239 unsigned long m_LastSearchSpaceChanges{ 0 };
240 virtual void
242
243private:
244 unsigned long m_CurrentIteration{ 0 };
245};
246
247} // end namespace itk
248
249#endif
An optimizer based on full search.
Array< ParameterValueType > SearchSpacePointType
virtual unsigned int GetNumberOfSearchSpaceDimensions()
ITK_DISALLOW_COPY_AND_MOVE(FullSearchOptimizer)
virtual void RemoveSearchDimension(unsigned int param_nr)
ParametersType::ValueType ParameterValueType
virtual ParametersType PointToPosition(const SearchSpacePointType &point)
Array< SizeValueType > SearchSpaceSizeType
SearchSpaceSizeType m_SearchSpaceSize
virtual unsigned long GetNumberOfIterations()
virtual void StopOptimization()
virtual void MaximizeOff()
SearchSpaceIndexType m_CurrentIndexInSearchSpace
SearchSpaceType::Pointer SearchSpacePointer
itkGetModifiableObjectMacro(SearchSpace, SearchSpaceType)
SearchSpaceIndexType m_BestIndexInSearchSpace
virtual void SetMaximize(bool _arg)
~FullSearchOptimizer() override=default
SearchSpacePointType m_CurrentPointInSearchSpace
SearchSpacePointType m_BestPointInSearchSpace
virtual ParametersType IndexToPosition(const SearchSpaceIndexType &index)
virtual const SearchSpaceSizeType & GetSearchSpaceSize()
void StartOptimization() override
SmartPointer< const Self > ConstPointer
SearchSpaceType::ConstIterator SearchSpaceIteratorType
virtual void UpdateCurrentPosition()
MapContainer< unsigned int, RangeType > SearchSpaceType
ParameterValueType RangeValueType
Array< IndexValueType > SearchSpaceIndexType
virtual void ProcessSearchSpaceChanges()
virtual void AddSearchDimension(unsigned int param_nr, RangeValueType minimum, RangeValueType maximum, RangeValueType step)
virtual void MaximizeOn()
virtual SearchSpacePointType IndexToPoint(const SearchSpaceIndexType &index)
virtual void ResumeOptimization()
FixedArray< RangeValueType, 3 > RangeType


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo