#include <itkCumulativeGaussianOptimizer.h>
This is an optimizer specific to estimating the parameters of Cumulative Gaussian sampled data.
This optimizer will only work if the data array is sampled from a Cumulative Gaussian curve. It's more of a curve fitter than an optimizer, with the advantage of being fast and specific. It works by taking the derivative of the Cumulative Gaussian sample then repeatedly extending the tails of the Gaussian and recalculating the Gaussian parameters until the change in iterations is within tolerance or very small. The Gaussian is then integrated to reproduce the Cumulative Gaussian and the asymptotes are estimated by using least squares fit to estimate the constant from integration.
Definition at line 48 of file itkCumulativeGaussianOptimizer.h.
Public Member Functions | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
const char * | GetNameOfClass () const override |
std::string | GetStopConditionDescription () const override |
void | PrintArray (MeasureType *array) |
void | SetDataArray (MeasureType *cumGaussianArray) |
void | StartOptimization () override |
virtual void | SetDifferenceTolerance (double _arg) |
virtual double | GetDifferenceTolerance () |
virtual void | SetVerbose (bool _arg) |
virtual bool | GetVerbose () |
virtual void | VerboseOn () |
virtual void | VerboseOff () |
virtual double | GetComputedMean () |
virtual double | GetComputedStandardDeviation () |
virtual double | GetUpperAsymptote () |
virtual double | GetLowerAsymptote () |
virtual MeasureType * | GetFinalSampledArray () |
virtual double | GetFitError () |
![]() | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
const char * | GetNameOfClass () const override |
virtual void | SetCostFunction (CostFunctionType *costFunction) |
![]() | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
const char * | GetNameOfClass () const override |
![]() | |
virtual::itk::LightObject::Pointer | CreateAnother () const |
virtual const ParametersType & | GetCurrentPosition () const |
virtual const ParametersType & | GetInitialPosition () const |
const char * | GetNameOfClass () const override |
virtual void | SetInitialPosition (const ParametersType ¶m) |
void | SetScales (const ScalesType &scales) |
virtual const ScalesType & | GetScales () const |
virtual const ScalesType & | GetInverseScales () const |
![]() | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
![]() | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static Pointer | New () |
![]() | |
static Pointer | New () |
![]() | |
static Pointer | New () |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
CumulativeGaussianOptimizer () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~CumulativeGaussianOptimizer () override | |
![]() | |
MultipleValuedNonLinearOptimizer () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~MultipleValuedNonLinearOptimizer () override=default | |
![]() | |
NonLinearOptimizer ()=default | |
~NonLinearOptimizer () override | |
![]() | |
Optimizer () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetCurrentPosition (const ParametersType ¶m) |
~Optimizer () override=default | |
![]() | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~Object () override | |
![]() | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Member Functions | |
MeasureType * | ExtendGaussian (MeasureType *originalArray, MeasureType *extendedArray, int startingPointForInsertion) |
double | FindAverageSumOfSquaredDifferences (MeasureType *array1, MeasureType *array2) |
void | FindParametersOfGaussian (MeasureType *sampledGaussianArray) |
void | MeasureGaussianParameters (MeasureType *array) |
void | PrintComputedParameterHeader () |
void | PrintComputedParameters () const |
MeasureType * | RecalculateExtendedArrayFromGaussianParameters (MeasureType *originalArray, MeasureType *extendedArray, int startingPointForInsertion) const |
double | VerticalBestShift (MeasureType *originalArray, MeasureType *newArray) |
Private Attributes | |
double | m_ComputedAmplitude {} |
double | m_ComputedMean {} |
double | m_ComputedStandardDeviation {} |
double | m_ComputedTransitionHeight {} |
MeasureType * | m_CumulativeGaussianArray {} |
double | m_DifferenceTolerance {} |
MeasureType * | m_FinalSampledArray {} |
double | m_FitError {} |
double | m_LowerAsymptote {} |
double | m_OffsetForMean {} |
std::ostringstream | m_StopConditionDescription {} |
double | m_UpperAsymptote {} |
bool | m_Verbose {} |
Additional Inherited Members | |
![]() | |
CostFunctionPointer | m_CostFunction {} |
![]() | |
ParametersType | m_CurrentPosition {} |
bool | m_ScalesInitialized { false } |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
using itk::CumulativeGaussianOptimizer::ConstPointer = SmartPointer<const Self> |
Definition at line 55 of file itkCumulativeGaussianOptimizer.h.
Cost function type alias. NOTE: This optimizer is specific to fitting a Cumulative Gaussian.
Definition at line 59 of file itkCumulativeGaussianOptimizer.h.
Data array type alias.
Definition at line 62 of file itkCumulativeGaussianOptimizer.h.
Definition at line 54 of file itkCumulativeGaussianOptimizer.h.
Standard type alias.
Definition at line 52 of file itkCumulativeGaussianOptimizer.h.
Definition at line 53 of file itkCumulativeGaussianOptimizer.h.
|
protected |
Referenced by GetNameOfClass().
|
overrideprotected |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
|
private |
Extend the tails of the Gaussian.
|
private |
Calculates the squared difference error between each Gaussian iteration loop.
|
private |
Given an array sampled from a Gaussian, compute the final parameters.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
overridevirtual |
Reimplemented from itk::LightObject.
References CumulativeGaussianOptimizer().
|
overridevirtual |
Report the reason for stopping.
Reimplemented from itk::Optimizer.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
private |
Measure the parameters of a Gaussian sampled array.
|
static |
Method for creation through the object factory.
void itk::CumulativeGaussianOptimizer::PrintArray | ( | MeasureType * | array | ) |
Print an array.
|
private |
Print the header for output table.
|
private |
Print the computed parameters.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::LightObject.
|
private |
Recalculate the parameters of the extended Gaussian array.
void itk::CumulativeGaussianOptimizer::SetDataArray | ( | MeasureType * | cumGaussianArray | ) |
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
overridevirtual |
Start the optimizer.
Reimplemented from itk::Optimizer.
|
virtual |
Set and get macros.
|
virtual |
Set and get macros.
|
private |
Find the constant of the integrated sample.
|
private |
The final amplitude of the Gaussian.
Definition at line 116 of file itkCumulativeGaussianOptimizer.h.
|
private |
The final mean of the Cumulative Gaussian.
Definition at line 110 of file itkCumulativeGaussianOptimizer.h.
|
private |
The final standard deviation of the Cumulative Gaussian.
Definition at line 113 of file itkCumulativeGaussianOptimizer.h.
|
private |
The transition height (distance between upper and lower asymptotes) of the Cumulative Gaussian.
Definition at line 120 of file itkCumulativeGaussianOptimizer.h.
|
private |
Original data array.
Definition at line 142 of file itkCumulativeGaussianOptimizer.h.
|
private |
When to stop the iteration for the Gaussian extension loop.
Definition at line 107 of file itkCumulativeGaussianOptimizer.h.
|
private |
Array of values computed from the final parameters of the Cumulative Gaussian.
Definition at line 139 of file itkCumulativeGaussianOptimizer.h.
|
private |
Least squares fit error as a measure of goodness.
Definition at line 135 of file itkCumulativeGaussianOptimizer.h.
|
private |
The final lower asymptote of the Cumulative Gaussian.
Definition at line 126 of file itkCumulativeGaussianOptimizer.h.
|
private |
Offset for the mean calculation.
Definition at line 129 of file itkCumulativeGaussianOptimizer.h.
|
private |
Describe the stop condition
Definition at line 180 of file itkCumulativeGaussianOptimizer.h.
|
private |
The final upper asymptote of the Cumulative Gaussian.
Definition at line 123 of file itkCumulativeGaussianOptimizer.h.
|
private |
Flag to print iteration results.
Definition at line 132 of file itkCumulativeGaussianOptimizer.h.