Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
src
Components
Optimizers
FullSearch
itkFullSearchOptimizer.h
Go to the documentation of this file.
1
/*======================================================================
2
3
This file is part of the elastix software.
4
5
Copyright (c) University Medical Center Utrecht. All rights reserved.
6
See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7
details.
8
9
This software is distributed WITHOUT ANY WARRANTY; without even
10
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11
PURPOSE. See the above copyright notices for more information.
12
13
======================================================================*/
14
15
#ifndef __itkFullSearchOptimizer_h
16
#define __itkFullSearchOptimizer_h
17
18
#include "itkSingleValuedNonLinearOptimizer.h"
19
#include "itkMapContainer.h"
20
#include "itkImage.h"
21
#include "itkArray.h"
22
#include "itkFixedArray.h"
23
24
25
namespace
itk
26
{
27
43
class
FullSearchOptimizer
:
public
SingleValuedNonLinearOptimizer
44
{
45
public
:
47
typedef
FullSearchOptimizer
Self
;
48
typedef
SingleValuedNonLinearOptimizer
Superclass
;
49
typedef
SmartPointer<Self>
Pointer
;
50
typedef
SmartPointer<const Self>
ConstPointer
;
51
53
itkNewMacro(
Self
);
54
56
itkTypeMacro(
FullSearchOptimizer
,
SingleValuedNonLinearOptimizer
);
57
59
typedef
enum
{
60
FullRangeSearched
,
61
MetricError
62
}
StopConditionType
;
63
64
/* Typedefs inherited from superclass */
65
typedef
Superclass::ParametersType
ParametersType
;
66
typedef
Superclass::CostFunctionType
CostFunctionType
;
67
typedef
Superclass::CostFunctionPointer
CostFunctionPointer
;
68
typedef
Superclass::MeasureType
MeasureType
;
69
70
typedef
ParametersType::ValueType
ParameterValueType
;
// = double
71
typedef
ParameterValueType
RangeValueType
;
72
typedef
FixedArray<RangeValueType, 3>
RangeType
;
73
typedef
MapContainer<unsigned int, RangeType>
SearchSpaceType
;
74
typedef
SearchSpaceType::Pointer
SearchSpacePointer
;
75
typedef
SearchSpaceType::ConstIterator
SearchSpaceIteratorType
;
76
79
typedef
Array<ParameterValueType>
SearchSpacePointType
;
80
83
typedef
Array<long>
SearchSpaceIndexType
;
84
86
typedef
Array<unsigned long>
SearchSpaceSizeType
;
87
88
92
itkGetConstMacro( Maximize,
bool
);
93
itkSetMacro( Maximize,
bool
);
94
itkBooleanMacro( Maximize );
95
bool
GetMinimize
( )
const
96
{
return
!
m_Maximize
; }
97
void
SetMinimize
(
bool
v)
98
{ this->
SetMaximize
(!v); }
99
void
MinimizeOn
()
100
{ this->
MaximizeOff
(); }
101
void
MinimizeOff
()
102
{ this->
MaximizeOn
(); }
103
118
virtual
void
UpdateCurrentPosition
(
void
);
119
123
virtual
void
StartOptimization
(
void
);
124
128
virtual
void
ResumeOptimization
(
void
);
129
133
virtual
void
StopOptimization
(
void
);
134
145
itkSetObjectMacro( SearchSpace,
SearchSpaceType
);
146
itkGetObjectMacro( SearchSpace,
SearchSpaceType
);
147
149
virtual
void
AddSearchDimension
(
unsigned
int
param_nr,
150
RangeValueType
minimum,
RangeValueType
maximum,
RangeValueType
step );
151
virtual
void
RemoveSearchDimension
(
unsigned
int
param_nr );
152
154
virtual
unsigned
long
GetNumberOfIterations
(
void
);
155
157
virtual
unsigned
int
GetNumberOfSearchSpaceDimensions
(
void
);
158
160
virtual
const
SearchSpaceSizeType
&
GetSearchSpaceSize
(
void
);
161
163
virtual
ParametersType
PointToPosition
(
const
SearchSpacePointType
& point);
164
virtual
ParametersType
IndexToPosition
(
const
SearchSpaceIndexType
& index);
165
167
virtual
SearchSpacePointType
IndexToPoint
(
const
SearchSpaceIndexType
& index);
168
170
itkGetConstMacro( CurrentIteration,
unsigned
long
);
171
173
itkGetConstReferenceMacro( CurrentPointInSearchSpace,
SearchSpacePointType
);
174
itkGetConstReferenceMacro( CurrentIndexInSearchSpace,
SearchSpaceIndexType
);
175
177
itkGetConstReferenceMacro( BestPointInSearchSpace,
SearchSpacePointType
);
178
itkGetConstReferenceMacro( BestIndexInSearchSpace,
SearchSpaceIndexType
);
179
181
itkGetConstMacro( Value,
double
);
182
184
itkGetConstMacro( BestValue,
double
);
185
187
itkGetConstMacro( StopCondition,
StopConditionType
);
188
189
190
protected
:
191
FullSearchOptimizer
();
192
virtual
~FullSearchOptimizer
() {};
193
194
//void PrintSelf(std::ostream& os, Indent indent) const;
195
196
bool
m_Maximize
;
197
bool
m_Stop
;
198
double
m_Value
;
199
double
m_BestValue
;
200
StopConditionType
m_StopCondition
;
201
202
SearchSpacePointer
m_SearchSpace
;
203
SearchSpacePointType
m_CurrentPointInSearchSpace
;
204
SearchSpaceIndexType
m_CurrentIndexInSearchSpace
;
205
SearchSpacePointType
m_BestPointInSearchSpace
;
206
SearchSpaceIndexType
m_BestIndexInSearchSpace
;
207
SearchSpaceSizeType
m_SearchSpaceSize
;
208
unsigned
int
m_NumberOfSearchSpaceDimensions
;
209
210
unsigned
long
m_LastSearchSpaceChanges
;
211
virtual
void
ProcessSearchSpaceChanges
(
void
);
212
213
private
:
214
FullSearchOptimizer
(
const
Self
&);
//purposely not implemented
215
void
operator=
(
const
Self
&);
//purposely not implemented
216
217
unsigned
long
m_CurrentIteration
;
218
219
};
// end class
220
221
}
// end namespace itk
222
223
224
#endif
225
Generated on 27-06-2013 for elastix by
1.8.3.1