Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitk::ModelFitFunctorBase Class Referenceabstract

#include <mitkModelFitFunctorBase.h>

Inheritance diagram for mitk::ModelFitFunctorBase:
Collaboration diagram for mitk::ModelFitFunctorBase:

Public Types

typedef ModelFitFunctorBase Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef ScalarType ParameterImagePixelType
 
typedef std::vector< ParameterImagePixelTypeInputPixelArrayType
 
typedef std::vector< ParameterImagePixelTypeOutputPixelArrayType
 
typedef ModelBase::ParameterNamesType ParameterNamesType
 

Public Member Functions

virtual const char * GetClassName () const
 
OutputPixelArrayType Compute (const InputPixelArrayType &value, const ModelBase *model, const ModelBase::ParametersType &initialParameters) const
 
unsigned int GetNumberOfOutputs (const ModelBase *model) const
 
ParameterNamesType GetEvaluationParameterNames () const
 
void ResetEvaluationParameters ()
 
void RegisterEvaluationParameter (const std::string &parameterName, SVModelFitCostFunction *evaluationCostFunction)
 
const SVModelFitCostFunctionGetEvaluationParameterCostFunction (const std::string &parameterName) const
 
virtual ParameterNamesType GetCriterionNames () const =0
 
ParameterNamesType GetDebugParameterNames () const
 
virtual void DebugParameterMapsOn ()
 
virtual void DebugParameterMapsOff ()
 
virtual void SetDebugParameterMaps (bool _arg)
 
virtual bool GetDebugParameterMaps () const
 

Protected Types

typedef ModelBase::ParametersType ParametersType
 
typedef ModelFitCostFunctionInterface::SignalType SignalType
 
typedef std::map< std::string, ParameterImagePixelTypeDebugParameterMapType
 

Protected Member Functions

 ModelFitFunctorBase ()
 
 ~ModelFitFunctorBase () override
 
virtual OutputPixelArrayType GetCriteria (const ModelBase *model, const ParametersType &parameters, const SignalType &sample) const =0
 
OutputPixelArrayType GetDerivedParameters (const ModelBase *model, const ParametersType &parameters) const
 
OutputPixelArrayType GetEvaluationParameters (const ModelBase *model, const ParametersType &parameters, const SignalType &sample) const
 
virtual ParametersType DoModelFit (const SignalType &value, const ModelBase *model, const ModelBase::ParametersType &initialParameters, DebugParameterMapType &debugParameters) const =0
 
virtual ParameterNamesType DefineDebugParameterNames () const =0
 

Detailed Description

Definition at line 28 of file mitkModelFitFunctorBase.h.

Member Typedef Documentation

◆ ConstPointer

◆ DebugParameterMapType

Definition at line 108 of file mitkModelFitFunctorBase.h.

◆ InputPixelArrayType

◆ OutputPixelArrayType

◆ ParameterImagePixelType

◆ ParameterNamesType

◆ ParametersType

◆ Pointer

◆ Self

◆ SignalType

◆ Superclass

Definition at line 32 of file mitkModelFitFunctorBase.h.

Constructor & Destructor Documentation

◆ ModelFitFunctorBase()

mitk::ModelFitFunctorBase::ModelFitFunctorBase ( )
protected

Definition at line 190 of file mitkModelFitFunctorBase.cpp.

References ~ModelFitFunctorBase().

Referenced by GetDebugParameterNames().

◆ ~ModelFitFunctorBase()

mitk::ModelFitFunctorBase::~ModelFitFunctorBase ( )
overrideprotected

Definition at line 194 of file mitkModelFitFunctorBase.cpp.

Referenced by ModelFitFunctorBase().

Member Function Documentation

◆ Compute()

mitk::ModelFitFunctorBase::OutputPixelArrayType mitk::ModelFitFunctorBase::Compute ( const InputPixelArrayType value,
const ModelBase model,
const ModelBase::ParametersType initialParameters 
) const

Returns the values determined by fitting the passed model. The values in the returned vector are ordered in the following sequence:

  • model parameters (see also GetParameterNames())
  • derived model parameters (see also GetDerivedParameterNames())
  • criterion(s) (see also GetCriterionNames())
  • evaluation parameters (see also GetEvaluationParameterNames())
    Parameters
    valueSignal the model should be fitted onto
    modelPointer to the preconfigured/ready to use model instance for the fitting against the signal curve
    initialParametersparameters of the model that should be used as starting point of the fitting process.
    Precondition
    model must point to a valid instance.
    Size of initialParameters must be equal to model->GetNumberOfParameters().

Definition at line 17 of file mitkModelFitFunctorBase.cpp.

References DoModelFit(), GetCriteria(), GetCriterionNames(), GetDebugParameterNames(), GetDerivedParameters(), GetEvaluationParameters(), mitk::ModelTraitsInterface::GetNumberOfParameters(), and offset.

◆ DebugParameterMapsOff()

virtual void mitk::ModelFitFunctorBase::DebugParameterMapsOff ( )
virtual

◆ DebugParameterMapsOn()

virtual void mitk::ModelFitFunctorBase::DebugParameterMapsOn ( )
virtual

◆ DefineDebugParameterNames()

virtual ParameterNamesType mitk::ModelFitFunctorBase::DefineDebugParameterNames ( ) const
protectedpure virtual

Returns names of the depug parameters generated by the functor. Will be called by GetDebugParameterNames, if debug is activated.

Implemented in mitk::LevenbergMarquardtModelFitFunctor, and mitk::DummyModelFitFunctor.

Referenced by GetDebugParameterNames().

◆ DoModelFit()

virtual ParametersType mitk::ModelFitFunctorBase::DoModelFit ( const SignalType value,
const ModelBase model,
const ModelBase::ParametersType initialParameters,
DebugParameterMapType debugParameters 
) const
protectedpure virtual

Internal Method called by Compute(). It does the real fit and returns the found parameters. Additionally it must return its debug parameter via debugParameters.

Postcondition
If m_DebugParameterMaps is true, it must return all debug parameters defined by GetDebugParameterNames() via debugParameters.
Parameters
valueSignal the Model should be fitted against
modelPointer to the model that should be fitted
initialParametersInitial modal parameters for the fit
[out]debugParametersMap containing all debug parameters for the done fit (must only valid if m_DebugParameterMap is true)

Implemented in mitk::LevenbergMarquardtModelFitFunctor, and mitk::DummyModelFitFunctor.

Referenced by Compute().

◆ GetClassName()

virtual const char* mitk::ModelFitFunctorBase::GetClassName ( ) const
virtual

◆ GetCriteria()

virtual OutputPixelArrayType mitk::ModelFitFunctorBase::GetCriteria ( const ModelBase model,
const ParametersType parameters,
const SignalType sample 
) const
protectedpure virtual

Internal Method called by Compute to get the final criterion values thar dove the fit. must be implemented be concrete functor classes.

Implemented in mitk::LevenbergMarquardtModelFitFunctor, and mitk::DummyModelFitFunctor.

Referenced by Compute().

◆ GetCriterionNames()

virtual ParameterNamesType mitk::ModelFitFunctorBase::GetCriterionNames ( ) const
pure virtual

Returns names of the criterion used to fit the model.

Implemented in mitk::LevenbergMarquardtModelFitFunctor, and mitk::DummyModelFitFunctor.

Referenced by Compute(), and GetNumberOfOutputs().

◆ GetDebugParameterMaps()

virtual bool mitk::ModelFitFunctorBase::GetDebugParameterMaps ( ) const
virtual

◆ GetDebugParameterNames()

mitk::ModelFitFunctorBase::ParameterNamesType mitk::ModelFitFunctorBase::GetDebugParameterNames ( ) const

Returns names of the depug parameters generated by the functor. Is empty, if debug is deactivated.

Definition at line 177 of file mitkModelFitFunctorBase.cpp.

References DefineDebugParameterNames(), and ModelFitFunctorBase().

Referenced by Compute(), and GetNumberOfOutputs().

◆ GetDerivedParameters()

mitk::ModelFitFunctorBase::OutputPixelArrayType mitk::ModelFitFunctorBase::GetDerivedParameters ( const ModelBase model,
const ParametersType parameters 
) const
protected

Internal Method called by Compute(). Gets all derived parameters of the models with the final found parameters of the fit.

Definition at line 197 of file mitkModelFitFunctorBase.cpp.

References mitk::ModelBase::GetDerivedParameters().

Referenced by Compute().

◆ GetEvaluationParameterCostFunction()

const mitk::SVModelFitCostFunction * mitk::ModelFitFunctorBase::GetEvaluationParameterCostFunction ( const std::string &  parameterName) const

Definition at line 157 of file mitkModelFitFunctorBase.cpp.

◆ GetEvaluationParameterNames()

mitk::ModelFitFunctorBase::ParameterNamesType mitk::ModelFitFunctorBase::GetEvaluationParameterNames ( ) const

Returns names of all evaluation parameters defined by the user

Definition at line 139 of file mitkModelFitFunctorBase.cpp.

◆ GetEvaluationParameters()

mitk::ModelFitFunctorBase::OutputPixelArrayType mitk::ModelFitFunctorBase::GetEvaluationParameters ( const ModelBase model,
const ParametersType parameters,
const SignalType sample 
) const
protected

Internal Method called by Compute(). Gets the evaluation parameters for all cost functions enlisted by the user, based on the model with the final found parameters of the fit and the input signal.

Definition at line 215 of file mitkModelFitFunctorBase.cpp.

References mitk::SVModelFitCostFunction::GetValue(), mitk::SVModelFitCostFunction::SetModel(), and mitk::SVModelFitCostFunction::SetSample().

Referenced by Compute().

◆ GetNumberOfOutputs()

unsigned int mitk::ModelFitFunctorBase::GetNumberOfOutputs ( const ModelBase model) const

Returns the number of outputs the fit functor will return if compute is called. The number depends in parts on the passed model.

Exceptions
Exceptionwill be thrown if no valid model is passed.

Definition at line 104 of file mitkModelFitFunctorBase.cpp.

References GetCriterionNames(), GetDebugParameterNames(), mitk::ModelBase::GetNumberOfDerivedParameters(), and mitk::ModelTraitsInterface::GetNumberOfParameters().

◆ RegisterEvaluationParameter()

void mitk::ModelFitFunctorBase::RegisterEvaluationParameter ( const std::string &  parameterName,
SVModelFitCostFunction evaluationCostFunction 
)

Definition at line 126 of file mitkModelFitFunctorBase.cpp.

◆ ResetEvaluationParameters()

void mitk::ModelFitFunctorBase::ResetEvaluationParameters ( )

Definition at line 116 of file mitkModelFitFunctorBase.cpp.

◆ SetDebugParameterMaps()

virtual void mitk::ModelFitFunctorBase::SetDebugParameterMaps ( bool  _arg)
virtual

The documentation for this class was generated from the following files: