ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkCumulativeGaussianOptimizer.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 __itkCumulativeGaussianOptimizer_h
19 #define __itkCumulativeGaussianOptimizer_h
20 
23 
24 namespace itk
25 {
47 class ITK_EXPORT CumulativeGaussianOptimizer:
49 {
50 public:
51 
57 
61 
64 
66  itkNewMacro(Self);
67 
70 
72  itkSetMacro(DifferenceTolerance, double);
73  itkSetMacro(Verbose, bool);
74  itkGetMacro(ComputedMean, double);
75  itkGetMacro(ComputedStandardDeviation, double);
76  itkGetMacro(UpperAsymptote, double);
77  itkGetMacro(LowerAsymptote, double);
78  itkGetMacro(FinalSampledArray, MeasureType *);
79  itkGetMacro(FitError, double);
81 
82  void SetDataArray(MeasureType *dataArray);
83 
85  void StartOptimization();
86 
88  void PrintArray(MeasureType *array);
89 
91  const std::string GetStopConditionDescription() const;
92 
93 protected:
95  virtual ~CumulativeGaussianOptimizer();
96  void PrintSelf(std::ostream & os, Indent indent) const;
97 
98 private:
99 
102 
105 
108 
111 
115 
118 
121 
124 
126  bool m_Verbose;
127 
129  double m_FitError;
130 
134 
137 
139  MeasureType * ExtendGaussian(MeasureType *originalArray, MeasureType *extendedArray, int startingPointForInsertion);
140 
142  MeasureType * RecalculateExtendedArrayFromGaussianParameters(MeasureType *originalArray,
143  MeasureType *extendedArray,
144  int startingPointForInsertion);
145 
148  double FindAverageSumOfSquaredDifferences(MeasureType *array1, MeasureType *array2);
149 
151  void FindParametersOfGaussian(MeasureType *sampledGaussianArray);
152 
154  void MeasureGaussianParameters(MeasureType *array);
155 
157  void PrintComputedParameterHeader();
158 
160  void PrintComputedParameters();
161 
163  double VerticalBestShift(MeasureType *originalArray, MeasureType *newArray);
164 
166  std::ostringstream m_StopConditionDescription;
167 };
168 } // end namespace itk
169 
170 #endif
171