ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkWindowConvergenceMonitoringFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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
40 : public ConvergenceMonitoringFunction<TScalar, TScalar>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_ASSIGN(WindowConvergenceMonitoringFunction);
44 
49 
51  itkNewMacro( Self );
52 
55 
56  using ScalarType = TScalar;
58 
59  using EnergyValueType = typename Superclass::EnergyValueType;
60  using EnergyValueContainerType = typename Superclass::EnergyValueContainerType;
61  using EnergyValueContainerSizeType = typename Superclass::EnergyValueContainerSizeType;
62  using EnergyValueIterator = typename EnergyValueContainerType::iterator;
63  using EnergyValueConstIterator = typename EnergyValueContainerType::const_iterator;
64 
66  void AddEnergyValue( const EnergyValueType ) override;
67 
68  /* Clear energy values and set total energy to 0 */
69  void ClearEnergyValues() override;
70 
72  itkSetMacro( WindowSize, EnergyValueContainerSizeType );
73  itkGetConstMacro( WindowSize, EnergyValueContainerSizeType );
75 
77  RealType GetConvergenceValue() const override;
78 
79 protected:
81 
82  ~WindowConvergenceMonitoringFunction() override = default;
83 
84  void PrintSelf( std::ostream & os, Indent indent ) const override;
85 
86 private:
88 
90 
91 };
92 } // end namespace Function
93 } // end namespace itk
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "itkWindowConvergenceMonitoringFunction.hxx"
97 #endif
98 
99 #endif
Light weight base class for most itk classes.
Define numeric traits for std::vector.
typename Superclass::EnergyValueContainerType EnergyValueContainerType
Abstract base class which monitors convergence during the course of optimization. ...
Class which monitors convergence during the course of optimization.
typename EnergyValueContainerType::const_iterator EnergyValueConstIterator
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::EnergyValueContainerSizeType EnergyValueContainerSizeType