ITK  4.3.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  itkGetMacro(DifferenceTolerance, double);
74  itkSetMacro(Verbose, bool);
75  itkGetMacro(Verbose, bool);
76  itkGetMacro(ComputedMean, double);
77  itkGetMacro(ComputedStandardDeviation, double);
78  itkGetMacro(UpperAsymptote, double);
79  itkGetMacro(LowerAsymptote, double);
80  itkGetMacro(FinalSampledArray, MeasureType *);
81  itkGetMacro(FitError, double);
83 
84  void SetDataArray(MeasureType *dataArray);
85 
87  void StartOptimization();
88 
90  void PrintArray(MeasureType *array);
91 
93  const std::string GetStopConditionDescription() const;
94 
95 protected:
97  virtual ~CumulativeGaussianOptimizer();
98  void PrintSelf(std::ostream & os, Indent indent) const;
99 
100 private:
101 
104 
107 
110 
113 
117 
120 
123 
126 
128  bool m_Verbose;
129 
131  double m_FitError;
132 
136 
139 
141  MeasureType * ExtendGaussian(MeasureType *originalArray, MeasureType *extendedArray, int startingPointForInsertion);
142 
144  MeasureType * RecalculateExtendedArrayFromGaussianParameters(MeasureType *originalArray,
145  MeasureType *extendedArray,
146  int startingPointForInsertion);
147 
150  double FindAverageSumOfSquaredDifferences(MeasureType *array1, MeasureType *array2);
151 
153  void FindParametersOfGaussian(MeasureType *sampledGaussianArray);
154 
156  void MeasureGaussianParameters(MeasureType *array);
157 
159  void PrintComputedParameterHeader();
160 
162  void PrintComputedParameters();
163 
165  double VerticalBestShift(MeasureType *originalArray, MeasureType *newArray);
166 
168  std::ostringstream m_StopConditionDescription;
169 };
170 } // end namespace itk
171 
172 #endif
173