go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxConjugateGradientFRPR.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#ifndef elxConjugateGradientFRPR_h
19#define elxConjugateGradientFRPR_h
20
21#include "elxIncludes.h" // include first to avoid MSVS warning
22#include "itkFRPROptimizer.h"
23
24namespace elastix
25{
26
73template <class TElastix>
74class ITK_TEMPLATE_EXPORT ConjugateGradientFRPR
75 : public itk::FRPROptimizer
76 , public OptimizerBase<TElastix>
77{
78public:
80
83 using Superclass1 = itk::FRPROptimizer;
85 using Pointer = itk::SmartPointer<Self>;
86 using ConstPointer = itk::SmartPointer<const Self>;
87
89 itkNewMacro(Self);
90
92 itkTypeMacro(ConjugateGradientFRPR, itk::FRPROptimizer);
93
95 elxClassNameMacro("ConjugateGradientFRPR");
96
98 using Superclass1::CostFunctionType;
99 using Superclass1::CostFunctionPointer;
100 // using Superclass1::StopConditionType; not implemented in this itkOptimizer
101 using typename Superclass1::ParametersType;
102 // not declared in Superclass, although it should be.
103 using DerivativeType = SingleValuedNonLinearOptimizer::DerivativeType;
104
106 using typename Superclass2::ElastixType;
107 using typename Superclass2::RegistrationType;
109
112 void
114
115 void
117
118 void
120
121 void
123
124 void
126
128 void
129 SetInitialPosition(const ParametersType & param) override;
130
133 itkGetConstMacro(LineOptimizing, bool);
134 itkGetConstMacro(LineBracketing, bool);
135
137 itkGetConstReferenceMacro(CurrentDerivativeMagnitude, double);
138
140 itkGetConstReferenceMacro(CurrentStepLength, double);
141
143 itkGetConstReferenceMacro(CurrentSearchDirectionMagnitude, double);
144
145protected:
147 ~ConjugateGradientFRPR() override = default;
148
151
154
157
160 itkSetMacro(LineOptimizing, bool);
161 itkSetMacro(LineBracketing, bool);
162
170 void
171 GetValueAndDerivative(ParametersType & p, double * val, ParametersType * xi) override;
172
183 void
184 LineBracket(double * ax, double * bx, double * cx, double * fa, double * fb, double * fc, ParametersType & tempCoord)
185 override;
186
196 void
198 double bx,
199 double cx,
200 double fa,
201 double fb,
202 double fc,
203 double * extX,
204 double * extVal,
205 ParametersType & tempCoord) override;
206
211 void
212 LineOptimize(ParametersType * p, ParametersType & xi, double * val, ParametersType & tempCoord) override;
213
214private:
216
219
220 const char *
222
223 // Private using-declarations, to avoid accidentally calling the wrong overload of those member functions, and to
224 // avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4) or clang (macos-12).
225 using itk::PowellOptimizer::LineBracket;
226 using itk::PowellOptimizer::BracketedLineOptimize;
227 using itk::FRPROptimizer::LineOptimize;
228};
229
230} // end namespace elastix
231
232#ifndef ITK_MANUAL_INSTANTIATION
233# include "elxConjugateGradientFRPR.hxx"
234#endif
235
236#endif // end #ifndef elxConjugateGradientFRPR_h
The ConjugateGradientFRPR class.
void GetValueAndDerivative(ParametersType &p, double *val, ParametersType *xi) override
void BeforeRegistration() override
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientFRPR)
void AfterEachResolution() override
void LineBracket(double *ax, double *bx, double *cx, double *fa, double *fb, double *fc, ParametersType &tempCoord) override
void AfterEachIteration() override
void LineOptimize(ParametersType *p, ParametersType &xi, double *val, ParametersType &tempCoord) override
typename Superclass2::ITKBaseType ITKBaseType
const char * DeterminePhase() const
elxClassNameMacro("ConjugateGradientFRPR")
void BracketedLineOptimize(double ax, double bx, double cx, double fa, double fb, double fc, double *extX, double *extVal, ParametersType &tempCoord) override
void BeforeEachResolution() override
~ConjugateGradientFRPR() override=default
void AfterRegistration() override
void SetInitialPosition(const ParametersType &param) override
SingleValuedNonLinearOptimizer::DerivativeType DerivativeType
itk::SmartPointer< const Self > ConstPointer
This class is the elastix base class for all Optimizers.
typename ElastixType::RegistrationBaseType RegistrationType
typename ITKBaseType::ParametersType ParametersType


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo