ITK  5.2.0
Insight Toolkit
itkMultiGradientOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkMultiGradientOptimizerv4_h
19 #define itkMultiGradientOptimizerv4_h
20 
23 
24 namespace itk
25 {
46 template <typename TInternalComputationValueType>
47 class ITK_TEMPLATE_EXPORT MultiGradientOptimizerv4Template
48  : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_ASSIGN(MultiGradientOptimizerv4Template);
52 
58 
61 
63  itkNewMacro(Self);
64 
66  using LocalOptimizerPointer =
68  using ParametersType = typename Superclass::ParametersType;
71  using OptimizersListType = std::vector<LocalOptimizerPointer>;
72  using OptimizersListSizeType = typename OptimizersListType::size_type;
73 
75  using StopConditionReturnStringType = typename Superclass::StopConditionReturnStringType;
76 
78  using StopConditionDescriptionType = typename Superclass::StopConditionDescriptionType;
79 
81  using InternalComputationValueType = TInternalComputationValueType;
82 
84  using MetricType = typename Superclass::MetricType;
85  using MetricTypePointer = typename MetricType::Pointer;
86 
88  using DerivativeType = typename MetricType::DerivativeType;
89 
92  using MetricValuesListType = std::vector<MeasureType>;
93 
96  GetStopCondition() const override
97  {
98  return this->m_StopCondition;
99  }
100 
102  void
103  StartOptimization(bool doOnlyInitialization = false) override;
104 
107  void
108  StopOptimization() override;
109 
112  void
113  ResumeOptimization() override;
114 
116  const StopConditionReturnStringType
117  GetStopConditionDescription() const override;
118 
120  OptimizersListType &
121  GetOptimizersList();
122 
124  void
125  SetOptimizersList(OptimizersListType & p);
126 
128  const MetricValuesListType &
129  GetMetricValuesList() const;
130 
131 protected:
134  ~MultiGradientOptimizerv4Template() override = default;
136 
137  void
138  PrintSelf(std::ostream & os, Indent indent) const override;
139 
140  /* Common variables for optimization control and reporting */
141  bool m_Stop{ false };
148 };
149 
152 
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 # include "itkMultiGradientOptimizerv4.hxx"
157 #endif
158 
159 #endif
itk::MultiGradientOptimizerv4Template::m_MaximumMetricValue
MeasureType m_MaximumMetricValue
Definition: itkMultiGradientOptimizerv4.h:147
itk::MultiGradientOptimizerv4Template::LocalOptimizerPointer
typename itk::GradientDescentOptimizerv4Template< TInternalComputationValueType >::Pointer LocalOptimizerPointer
Definition: itkMultiGradientOptimizerv4.h:67
itk::MultiGradientOptimizerv4Template::GetStopCondition
const StopConditionObjectToObjectOptimizerEnum & GetStopCondition() const override
Definition: itkMultiGradientOptimizerv4.h:96
itk::GradientDescentOptimizerv4Template
Gradient descent optimizer.
Definition: itkGradientDescentOptimizerv4.h:78
itk::GradientDescentOptimizerBasev4Template::StopConditionDescriptionType
typename Superclass::StopConditionDescriptionType StopConditionDescriptionType
Definition: itkGradientDescentOptimizerBasev4.h:77
itk::MultiGradientOptimizerv4Template::m_MinimumMetricValue
MeasureType m_MinimumMetricValue
Definition: itkMultiGradientOptimizerv4.h:146
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::GradientDescentOptimizerBasev4Template::ParametersType
typename Superclass::ParametersType ParametersType
Definition: itkGradientDescentOptimizerBasev4.h:94
itk::GradientDescentOptimizerBasev4Template::MetricType
typename Superclass::MetricType MetricType
Definition: itkGradientDescentOptimizerBasev4.h:83
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::MultiGradientOptimizerv4Template::m_StopConditionDescription
StopConditionDescriptionType m_StopConditionDescription
Definition: itkMultiGradientOptimizerv4.h:143
itk::ObjectToObjectOptimizerBaseTemplateEnums::StopConditionObjectToObjectOptimizer
StopConditionObjectToObjectOptimizer
Definition: itkObjectToObjectOptimizerBase.h:42
itk::MultiGradientOptimizerv4Template::OptimizersListType
std::vector< LocalOptimizerPointer > OptimizersListType
Definition: itkMultiGradientOptimizerv4.h:71
itkGradientDescentOptimizerv4.h
itk::GradientDescentOptimizerBasev4Template::StopConditionReturnStringType
typename Superclass::StopConditionReturnStringType StopConditionReturnStringType
Definition: itkGradientDescentOptimizerBasev4.h:74
itk::GradientDescentOptimizerBasev4Template::InternalComputationValueType
TInternalComputationValueType InternalComputationValueType
Definition: itkGradientDescentOptimizerBasev4.h:80
itk::GradientDescentOptimizerBasev4Template::MetricTypePointer
typename MetricType::Pointer MetricTypePointer
Definition: itkGradientDescentOptimizerBasev4.h:84
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkObjectToObjectOptimizerBase.h
itk::ObjectToObjectOptimizerBaseTemplate
Abstract base for object-to-object optimizers.
Definition: itkObjectToObjectOptimizerBase.h:113
itk::MultiGradientOptimizerv4Template::OptimizersListSizeType
typename OptimizersListType::size_type OptimizersListSizeType
Definition: itkMultiGradientOptimizerv4.h:72
itk::MultiGradientOptimizerv4Template
Multiple gradient-based optimizers are combined in order to perform a multi-objective optimization.
Definition: itkMultiGradientOptimizerv4.h:47
itk::MultiGradientOptimizerv4Template::m_OptimizersList
OptimizersListType m_OptimizersList
Definition: itkMultiGradientOptimizerv4.h:144
itk::MultiGradientOptimizerv4Template::OptimizerPointer
typename OptimizerType::Pointer OptimizerPointer
Definition: itkMultiGradientOptimizerv4.h:70
itk::GradientDescentOptimizerBasev4Template::DerivativeType
typename Superclass::DerivativeType DerivativeType
Definition: itkGradientDescentOptimizerBasev4.h:87
itk::MultiGradientOptimizerv4Template::m_MetricValuesList
MetricValuesListType m_MetricValuesList
Definition: itkMultiGradientOptimizerv4.h:145
itk::MultiGradientOptimizerv4Template::MetricValuesListType
std::vector< MeasureType > MetricValuesListType
Definition: itkMultiGradientOptimizerv4.h:92
itk::MultiGradientOptimizerv4Template::m_StopCondition
StopConditionObjectToObjectOptimizerEnum m_StopCondition
Definition: itkMultiGradientOptimizerv4.h:142
itk::GradientDescentOptimizerv4Template::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkGradientDescentOptimizerv4.h:105
itk::GradientDescentOptimizerBasev4Template::MeasureType
typename Superclass::MeasureType MeasureType
Definition: itkGradientDescentOptimizerBasev4.h:90