go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxConjugateGradient.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 elxConjugateGradient_h
19#define elxConjugateGradient_h
20
21#include "elxIncludes.h" // include first to avoid MSVS warning
24
25namespace elastix
26{
27
90template <class TElastix>
91class ITK_TEMPLATE_EXPORT ConjugateGradient
93 , public OptimizerBase<TElastix>
94{
95public:
97
102 using Pointer = itk::SmartPointer<Self>;
103 using ConstPointer = itk::SmartPointer<const Self>;
104
106 itkNewMacro(Self);
107
110
115 elxClassNameMacro("ConjugateGradient");
116
118 using Superclass1::CostFunctionType;
119 using Superclass1::CostFunctionPointer;
121 using Superclass1::ParametersType;
122 using Superclass1::DerivativeType;
124
126 using typename Superclass2::ElastixType;
127 using typename Superclass2::RegistrationType;
129
133 using EventPassThroughType = itk::ReceptorMemberCommand<Self>;
134 using EventPassThroughPointer = typename EventPassThroughType::Pointer;
135
138 void
140
143 void
145
146 void
148
149 void
151
152 void
154
155 void
157
158 itkGetConstMacro(StartLineSearch, bool);
159
160protected:
162 ~ConjugateGradient() override = default;
163
165
167 virtual std::string
169
172 virtual std::string
174
178 bool
179 TestConvergence(bool firstLineSearchDone) override;
180
185 void
186 LineSearch(const ParametersType searchDir, double & step, ParametersType & x, MeasureType & f, DerivativeType & g)
187 override;
188
189private:
191
192 void
193 InvokeIterationEvent(const itk::EventObject & event);
194
201};
202
203} // end namespace elastix
204
205#ifndef ITK_MANUAL_INSTANTIATION
206# include "elxConjugateGradient.hxx"
207#endif
208
209#endif // end #ifndef elxConjugateGradient_h
An optimizer based on the itk::GenericConjugateGradientOptimizer.
typename Superclass2::ITKBaseType ITKBaseType
elxClassNameMacro("ConjugateGradient")
itk::SmartPointer< Self > Pointer
void BeforeEachResolution() override
EventPassThroughPointer m_EventPasser
~ConjugateGradient() override=default
virtual std::string DeterminePhase() const
void AfterEachResolution() override
void StartOptimization() override
itk::ReceptorMemberCommand< Self > EventPassThroughType
bool TestConvergence(bool firstLineSearchDone) override
void AfterEachIteration() override
void BeforeRegistration() override
virtual std::string GetLineSearchStopCondition() const
void AfterRegistration() override
void LineSearch(const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g) override
LineOptimizerPointer m_LineOptimizer
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradient)
typename EventPassThroughType::Pointer EventPassThroughPointer
void InvokeIterationEvent(const itk::EventObject &event)
itk::SmartPointer< const Self > ConstPointer
This class is the elastix base class for all Optimizers.
typename ElastixType::RegistrationBaseType RegistrationType
typename ITKBaseType::ParametersType ParametersType
ITK version of the MoreThuente line search algorithm.


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