00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef _itkCumulativeGaussianOptimizer_h
00019
#define _itkCumulativeGaussianOptimizer_h
00020
00021
#include "itkMultipleValuedNonLinearOptimizer.h"
00022
#include "itkCumulativeGaussianCostFunction.h"
00023
00024
namespace itk
00025 {
00026
00047 class ITK_EXPORT CumulativeGaussianOptimizer :
00048
public MultipleValuedNonLinearOptimizer
00049 {
00050
00051
public:
00052
00054 typedef CumulativeGaussianOptimizer
Self;
00055 typedef MultipleValuedNonLinearOptimizer Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 typedef CumulativeGaussianCostFunction CostFunctionType;
00061
00063 typedef CostFunctionType::MeasureType
MeasureType;
00064
00066
itkNewMacro(
Self);
00067
00069
itkTypeMacro(CumulativeGaussianOptimizer,
MultipleValuedNonLinearOptimizer);
00070
00072
itkSetMacro(DifferenceTolerance,
double);
00073
itkSetMacro(Verbose,
bool);
00074
itkGetMacro(ComputedMean,
double);
00075
itkGetMacro(ComputedStandardDeviation,
double);
00076
itkGetMacro(UpperAsymptote,
double);
00077
itkGetMacro(LowerAsymptote,
double);
00078
itkGetMacro(FinalSampledArray,
MeasureType*);
00079
itkGetMacro(FitError,
double);
00080
00081
void SetDataArray(
MeasureType * dataArray);
00082
00084
void StartOptimization();
00085
00087
void SetCostFunction(CostFunctionType::Pointer costFunction);
00088
00090
void PrintArray(
MeasureType * array);
00091
00092
protected:
00093 CumulativeGaussianOptimizer();
00094
virtual ~CumulativeGaussianOptimizer();
00095
void PrintSelf(std::ostream &os,
Indent indent)
const;
00096
00097
private:
00098
00100
double m_DifferenceTolerance;
00101
00103
double m_ComputedMean;
00104
00106
double m_ComputedStandardDeviation;
00107
00109
double m_ComputedAmplitude;
00110
00112
double m_ComputedTransitionHeight;
00113
00115
double m_UpperAsymptote;
00116
00118
double m_LowerAsymptote;
00119
00121
double m_OffsetForMean;
00122
00124
bool m_Verbose;
00125
00127
double m_FitError;
00128
00130
MeasureType * m_FinalSampledArray;
00131
00133
MeasureType * m_CumulativeGaussianArray;
00134
00136 CostFunctionType::Pointer m_CostFunction;
00137
00139
MeasureType * ExtendGaussian(
MeasureType * originalArray,
MeasureType * extendedArray,
int startingPointForInsertion);
00140
00142
MeasureType * RecalculateExtendedArrayFromGaussianParameters(
MeasureType * originalArray,
00143
MeasureType * extendedArray,
00144
int startingPointForInsertion);
00145
00147
double FindAverageSumOfSquaredDifferences(
MeasureType * array1,
MeasureType * array2);
00148
00150
void FindParametersOfGaussian(
MeasureType * sampledGaussianArray);
00151
00153
void MeasureGaussianParameters(
MeasureType * array);
00154
00156
void PrintComputedParameterHeader();
00157
00159
void PrintComputedParameters();
00160
00162
double VerticalBestShift(
MeasureType * originalArray,
MeasureType * newArray);
00163 };
00164
00165 }
00166
00167
#endif
00168
00169
00170