ITK  5.2.0
Insight Toolkit
itkWindowConvergenceMonitoringFunction.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 itkWindowConvergenceMonitoringFunction_h
19 #define itkWindowConvergenceMonitoringFunction_h
20 
22 
23 namespace itk
24 {
25 namespace Function
26 {
38 template <typename TScalar = double>
39 class ITK_TEMPLATE_EXPORT WindowConvergenceMonitoringFunction : public ConvergenceMonitoringFunction<TScalar, TScalar>
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_MOVE(WindowConvergenceMonitoringFunction);
43 
48 
50  itkNewMacro(Self);
51 
54 
55  using ScalarType = TScalar;
57 
58  using EnergyValueType = typename Superclass::EnergyValueType;
59  using EnergyValueContainerType = typename Superclass::EnergyValueContainerType;
60  using EnergyValueContainerSizeType = typename Superclass::EnergyValueContainerSizeType;
61  using EnergyValueIterator = typename EnergyValueContainerType::iterator;
62  using EnergyValueConstIterator = typename EnergyValueContainerType::const_iterator;
63 
65  void
66  AddEnergyValue(const EnergyValueType) override;
67 
68  /* Clear energy values and set total energy to 0 */
69  void
70  ClearEnergyValues() override;
71 
73  itkSetMacro(WindowSize, EnergyValueContainerSizeType);
74  itkGetConstMacro(WindowSize, EnergyValueContainerSizeType);
76 
78  RealType
79  GetConvergenceValue() const override;
80 
81 protected:
83 
84  ~WindowConvergenceMonitoringFunction() override = default;
85 
86  void
87  PrintSelf(std::ostream & os, Indent indent) const override;
88 
89 private:
91 
93 };
94 } // end namespace Function
95 } // end namespace itk
96 
97 #ifndef ITK_MANUAL_INSTANTIATION
98 # include "itkWindowConvergenceMonitoringFunction.hxx"
99 #endif
100 
101 #endif
itk::Function::WindowConvergenceMonitoringFunction::EnergyValueContainerSizeType
typename Superclass::EnergyValueContainerSizeType EnergyValueContainerSizeType
Definition: itkWindowConvergenceMonitoringFunction.h:60
itk::Function::WindowConvergenceMonitoringFunction::m_TotalEnergy
RealType m_TotalEnergy
Definition: itkWindowConvergenceMonitoringFunction.h:92
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::Function::WindowConvergenceMonitoringFunction::m_WindowSize
EnergyValueContainerSizeType m_WindowSize
Definition: itkWindowConvergenceMonitoringFunction.h:90
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::Function::WindowConvergenceMonitoringFunction::EnergyValueType
typename Superclass::EnergyValueType EnergyValueType
Definition: itkWindowConvergenceMonitoringFunction.h:58
itk::Function::WindowConvergenceMonitoringFunction::EnergyValueConstIterator
typename EnergyValueContainerType::const_iterator EnergyValueConstIterator
Definition: itkWindowConvergenceMonitoringFunction.h:62
itk::Function::WindowConvergenceMonitoringFunction::RealType
typename NumericTraits< ScalarType >::RealType RealType
Definition: itkWindowConvergenceMonitoringFunction.h:56
itk::Function::WindowConvergenceMonitoringFunction::ScalarType
TScalar ScalarType
Definition: itkWindowConvergenceMonitoringFunction.h:55
itk::Function::WindowConvergenceMonitoringFunction::EnergyValueContainerType
typename Superclass::EnergyValueContainerType EnergyValueContainerType
Definition: itkWindowConvergenceMonitoringFunction.h:59
itk::Function::WindowConvergenceMonitoringFunction
Class which monitors convergence during the course of optimization.
Definition: itkWindowConvergenceMonitoringFunction.h:39
itkConvergenceMonitoringFunction.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Function::WindowConvergenceMonitoringFunction::EnergyValueIterator
typename EnergyValueContainerType::iterator EnergyValueIterator
Definition: itkWindowConvergenceMonitoringFunction.h:61
itk::Function::ConvergenceMonitoringFunction
Abstract base class which monitors convergence during the course of optimization.
Definition: itkConvergenceMonitoringFunction.h:43