ITK  6.0.0
Insight Toolkit
itkCumulativeGaussianOptimizer.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  * https://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 itkCumulativeGaussianOptimizer_h
19 #define itkCumulativeGaussianOptimizer_h
20 
23 #include "ITKOptimizersExport.h"
24 
25 namespace itk
26 {
49 {
50 public:
56 
60 
63 
65  itkNewMacro(Self);
66 
68  itkOverrideGetNameOfClassMacro(CumulativeGaussianOptimizer);
69 
71  itkSetMacro(DifferenceTolerance, double);
72  itkGetMacro(DifferenceTolerance, double);
73  itkSetMacro(Verbose, bool);
74  itkGetMacro(Verbose, bool);
75  itkBooleanMacro(Verbose);
76  itkGetMacro(ComputedMean, double);
77  itkGetMacro(ComputedStandardDeviation, double);
78  itkGetMacro(UpperAsymptote, double);
79  itkGetMacro(LowerAsymptote, double);
80  itkGetMacro(FinalSampledArray, MeasureType *);
81  itkGetMacro(FitError, double);
84  void
85  SetDataArray(MeasureType * cumGaussianArray);
86 
88  void
89  StartOptimization() override;
90 
92  void
93  PrintArray(MeasureType * array);
94 
96  std::string
97  GetStopConditionDescription() const override;
98 
99 protected:
101  ~CumulativeGaussianOptimizer() override;
102  void
103  PrintSelf(std::ostream & os, Indent indent) const override;
104 
105 private:
107  double m_DifferenceTolerance{};
108 
110  double m_ComputedMean{};
111 
113  double m_ComputedStandardDeviation{};
114 
116  double m_ComputedAmplitude{};
117 
120  double m_ComputedTransitionHeight{};
121 
123  double m_UpperAsymptote{};
124 
126  double m_LowerAsymptote{};
127 
129  double m_OffsetForMean{};
130 
132  bool m_Verbose{};
133 
135  double m_FitError{};
136 
139  MeasureType * m_FinalSampledArray{};
140 
142  MeasureType * m_CumulativeGaussianArray{};
143 
145  MeasureType *
146  ExtendGaussian(MeasureType * originalArray, MeasureType * extendedArray, int startingPointForInsertion);
147 
149  MeasureType *
150  RecalculateExtendedArrayFromGaussianParameters(MeasureType * originalArray,
151  MeasureType * extendedArray,
152  int startingPointForInsertion) const;
153 
156  double
157  FindAverageSumOfSquaredDifferences(MeasureType * array1, MeasureType * array2);
158 
160  void
161  FindParametersOfGaussian(MeasureType * sampledGaussianArray);
162 
164  void
165  MeasureGaussianParameters(MeasureType * array);
166 
168  void
169  PrintComputedParameterHeader();
170 
172  void
173  PrintComputedParameters() const;
174 
176  double
177  VerticalBestShift(MeasureType * originalArray, MeasureType * newArray);
178 
180  std::ostringstream m_StopConditionDescription{};
181 };
182 } // end namespace itk
183 
184 #endif
itk::MultipleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a multiple valued function.
Definition: itkMultipleValuedNonLinearOptimizer.h:34
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::CumulativeGaussianOptimizer
This is an optimizer specific to estimating the parameters of Cumulative Gaussian sampled data.
Definition: itkCumulativeGaussianOptimizer.h:48
itk::CumulativeGaussianCostFunction
Cost function for the Cumulative Gaussian Optimizer.
Definition: itkCumulativeGaussianCostFunction.h:51
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Array< double >
itkCumulativeGaussianCostFunction.h
itkMultipleValuedNonLinearOptimizer.h