ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel > Class Template Reference

#include <itkShapePriorMAPCostFunction.h>

Detailed Description

template<typename TFeatureImage, typename TOutputPixel>
class itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >

Represents the maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetImageFilter to estimate the shape parameters.

This class follows the shape and pose parameters estimation developed in [1]. Note that this class returns the negative log of the MAP function. Using the negative function make this cost function compatible with generic optimizers which seeks the minimum of a cost function.

This class has two template parameters, the feature image type representing the edge potential map and the pixel type used to represent the output level set in the ShapePriorSegmentationLevelSetImageFilter.

See also
ShapePriorSegmentationLevelSetImageFilter

For algorithmic details see [63].

Examples
Examples/Segmentation/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx.

Definition at line 47 of file itkShapePriorMAPCostFunction.h.

+ Inheritance diagram for itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >:
+ Collaboration diagram for itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >:

Public Types

using ArrayType = Array<double>
 
using ConstPointer = SmartPointer<const Self>
 
using FeatureImagePointer
 
using FeatureImageType
 
using NodeContainerType
 
using NodeType
 
using PixelType
 
using Pointer = SmartPointer<Self>
 
using Self = ShapePriorMAPCostFunction
 
using ShapeFunctionType
 
using Superclass = ShapePriorMAPCostFunctionBase<TFeatureImage, TOutputPixel>
 
- Public Types inherited from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
using ConstPointer = SmartPointer<const Self>
 
using DerivativeType
 
using FeatureImagePointer = typename FeatureImageType::ConstPointer
 
using FeatureImageType = TFeatureImage
 
using MeasureType
 
using NodeContainerPointer = typename NodeContainerType::ConstPointer
 
using NodeContainerType = VectorContainer<unsigned int, NodeType>
 
using NodeType = LevelSetNode<PixelType, Self::ImageDimension>
 
using ParametersType
 
using PixelType = TOutputPixel
 
using Pointer = SmartPointer<Self>
 
using Self = ShapePriorMAPCostFunctionBase
 
using ShapeFunctionPointer = typename ShapeFunctionType::Pointer
 
using ShapeFunctionType = ShapeSignedDistanceFunction<double, Self::ImageDimension>
 
using Superclass = SingleValuedCostFunction
 
- Public Types inherited from itk::SingleValuedCostFunction
using ConstPointer = SmartPointer<const Self>
 
using DerivativeType = Array<ParametersValueType>
 
using MeasureType = double
 
using ParametersType = Superclass::ParametersType
 
using ParametersValueType = Superclass::ParametersValueType
 
using Pointer = SmartPointer<Self>
 
using Self = SingleValuedCostFunction
 
using Superclass = CostFunction
 
- Public Types inherited from itk::CostFunctionTemplate< double >
using ConstPointer
 
using ParametersType
 
using ParametersValueType
 
using Pointer
 
using Self
 
using Superclass
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer<const Self>
 
using Pointer = SmartPointer<Self>
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer<const Self>
 
using Pointer = SmartPointer<Self>
 
using Self = LightObject
 

Public Member Functions

MeasureType ComputeLogGradientTerm (const ParametersType &parameters) const override
 
MeasureType ComputeLogInsideTerm (const ParametersType &parameters) const override
 
MeasureType ComputeLogPosePriorTerm (const ParametersType &parameters) const override
 
MeasureType ComputeLogShapePriorTerm (const ParametersType &parameters) const override
 
virtual::itk::LightObject::Pointer CreateAnother () const
 
const char * GetNameOfClass () const override
 
void Initialize () override
 
virtual void SetShapeParameterMeans (ArrayType _arg)
 
virtual ArrayType GetShapeParameterMeans () const
 
virtual void SetShapeParameterStandardDeviations (ArrayType _arg)
 
virtual ArrayType GetShapeParameterStandardDeviations () const
 
- Public Member Functions inherited from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
void GetDerivative (const ParametersType &, DerivativeType &) const override
 
const char * GetNameOfClass () const override
 
unsigned int GetNumberOfParameters () const override
 
MeasureType GetValue (const ParametersType &parameters) const override
 
virtual void SetShapeFunction (ShapeFunctionType *_arg)
 
virtual ShapeFunctionTypeGetModifiableShapeFunction ()
 
virtual const ShapeFunctionTypeGetShapeFunction () const
 
virtual void SetActiveRegion (const NodeContainerType *_arg)
 
virtual const NodeContainerTypeGetActiveRegion () const
 
virtual void SetFeatureImage (const FeatureImageType *_arg)
 
virtual const FeatureImageTypeGetFeatureImage () const
 
- Public Member Functions inherited from itk::SingleValuedCostFunction
const char * GetNameOfClass () const override
 
virtual void GetValueAndDerivative (const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
 
- Public Member Functions inherited from itk::Object
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
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () 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
 
- Public Member Functions inherited from itk::LightObject
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 Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension
 
- Static Public Attributes inherited from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const override
 
 ShapePriorMAPCostFunction ()
 
 ~ShapePriorMAPCostFunction () override=default
 
- Protected Member Functions inherited from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ShapePriorMAPCostFunctionBase ()
 
 ~ShapePriorMAPCostFunctionBase () override=default
 
- Protected Member Functions inherited from itk::SingleValuedCostFunction
 SingleValuedCostFunction ()=default
 
 ~SingleValuedCostFunction () override
 
- Protected Member Functions inherited from itk::CostFunctionTemplate< double >
 CostFunctionTemplate ()=default
 
 CostFunctionTemplate ()=default
 
 ~CostFunctionTemplate () override=default
 
 ~CostFunctionTemplate () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
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 Attributes

GaussianKernelFunction< double >::Pointer m_GaussianFunction {}
 
ArrayType m_ShapeParameterMeans {}
 
ArrayType m_ShapeParameterStandardDeviations {}
 
WeightsType m_Weights {}
 
using WeightsType = FixedArray<double, 4>
 
virtual void SetWeights (WeightsType _arg)
 
virtual const WeightsTypeGetWeights () const
 

Additional Inherited Members

- Protected Attributes inherited from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
NodeContainerPointer m_ActiveRegion {}
 
FeatureImagePointer m_FeatureImage {}
 
ShapeFunctionPointer m_ShapeFunction {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ArrayType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ArrayType = Array<double>

Type of the array for storing shape parameter mean and standard deviation. FIXME: should be templated.

Definition at line 93 of file itkShapePriorMAPCostFunction.h.

◆ ConstPointer

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ConstPointer = SmartPointer<const Self>

Definition at line 56 of file itkShapePriorMAPCostFunction.h.

◆ FeatureImagePointer

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::FeatureImagePointer

Definition at line 72 of file itkShapePriorMAPCostFunctionBase.h.

◆ FeatureImageType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::FeatureImageType

Type of the feature image representing the edge potential map.

Definition at line 71 of file itkShapePriorMAPCostFunctionBase.h.

◆ NodeContainerType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::NodeContainerType

Type of container used to store the level set nodes.

Definition at line 84 of file itkShapePriorMAPCostFunctionBase.h.

◆ NodeType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::NodeType

Type of node used to represent the active region around the zero set.

Definition at line 81 of file itkShapePriorMAPCostFunctionBase.h.

◆ PixelType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::PixelType

Type of pixel used to represent the level set.

Definition at line 78 of file itkShapePriorMAPCostFunctionBase.h.

◆ Pointer

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::Pointer = SmartPointer<Self>

Definition at line 55 of file itkShapePriorMAPCostFunction.h.

◆ Self

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::Self = ShapePriorMAPCostFunction

Standard class type aliases.

Definition at line 53 of file itkShapePriorMAPCostFunction.h.

◆ ShapeFunctionType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >::ShapeFunctionType

Type of the shape signed distance function.

Definition at line 88 of file itkShapePriorMAPCostFunctionBase.h.

◆ Superclass

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::Superclass = ShapePriorMAPCostFunctionBase<TFeatureImage, TOutputPixel>

Definition at line 54 of file itkShapePriorMAPCostFunction.h.

◆ WeightsType

template<typename TFeatureImage, typename TOutputPixel>
using itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::WeightsType = FixedArray<double, 4>

Set/Get the weights for each term. Default is a vector of all ones. The weights are applied to terms in the following order: LogInsideTerm, LogGradientTerm, LogShapePriorTerm and LogPosePriorTerm.

Definition at line 109 of file itkShapePriorMAPCostFunction.h.

Constructor & Destructor Documentation

◆ ShapePriorMAPCostFunction()

template<typename TFeatureImage, typename TOutputPixel>
itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ShapePriorMAPCostFunction ( )
protected

Referenced by GetNameOfClass().

◆ ~ShapePriorMAPCostFunction()

template<typename TFeatureImage, typename TOutputPixel>
itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::~ShapePriorMAPCostFunction ( )
overrideprotecteddefault

Member Function Documentation

◆ ComputeLogGradientTerm()

template<typename TFeatureImage, typename TOutputPixel>
MeasureType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ComputeLogGradientTerm ( const ParametersType & parameters) const
overridevirtual

Compute the gradient term component of the MAP cost function. In particular, this method assume that ( 1 - FeatureImage ) approximates a Gaussian (zero mean, unit variance) along the normal of the evolving contour. The gradient term is then given by a Laplacian of the goodness of fit of the Gaussian.

Implements itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >.

◆ ComputeLogInsideTerm()

template<typename TFeatureImage, typename TOutputPixel>
MeasureType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ComputeLogInsideTerm ( const ParametersType & parameters) const
overridevirtual

Compute the inside term component of the MAP cost function. In particular, the method sums the number of pixels inside the current contour (defined by nodes of the active region that are less than zero) which are outside the shape specified by the input parameters.

Implements itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >.

◆ ComputeLogPosePriorTerm()

template<typename TFeatureImage, typename TOutputPixel>
MeasureType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ComputeLogPosePriorTerm ( const ParametersType & parameters) const
overridevirtual

Compute the pose prior component of the MAP cost function. In particular, this method assumes that the pose parameters are uniformly distributed and returns a constant of zero.

Implements itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >.

◆ ComputeLogShapePriorTerm()

template<typename TFeatureImage, typename TOutputPixel>
MeasureType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ComputeLogShapePriorTerm ( const ParametersType & parameters) const
overridevirtual

Compute the shape prior component of the MAP cost function. In particular, the method assumes that the shape parameters comes from independent Gaussian distributions defined by the ShapeParameterMeans and ShapeParameterVariances array.

Implements itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >.

◆ CreateAnother()

template<typename TFeatureImage, typename TOutputPixel>
virtual::itk::LightObject::Pointer itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::CreateAnother ( ) const
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::Object.

◆ GetNameOfClass()

template<typename TFeatureImage, typename TOutputPixel>
const char * itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::GetNameOfClass ( ) const
overridevirtual

◆ GetShapeParameterMeans()

template<typename TFeatureImage, typename TOutputPixel>
virtual ArrayType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::GetShapeParameterMeans ( ) const
virtual

Set/Get the array of shape parameters mean.

◆ GetShapeParameterStandardDeviations()

template<typename TFeatureImage, typename TOutputPixel>
virtual ArrayType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::GetShapeParameterStandardDeviations ( ) const
virtual

Set/Get the array of shape parameters standard deviation.

◆ GetWeights()

template<typename TFeatureImage, typename TOutputPixel>
virtual const WeightsType & itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::GetWeights ( ) const
virtual

Set/Get the weights for each term. Default is a vector of all ones. The weights are applied to terms in the following order: LogInsideTerm, LogGradientTerm, LogShapePriorTerm and LogPosePriorTerm.

◆ Initialize()

template<typename TFeatureImage, typename TOutputPixel>
void itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::Initialize ( )
overridevirtual

Initialize the cost function by making sure that all the components are present.

Reimplemented from itk::ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >.

◆ New()

template<typename TFeatureImage, typename TOutputPixel>
static Pointer itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<typename TFeatureImage, typename TOutputPixel>
void itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::PrintSelf ( std::ostream & os,
Indent indent ) const
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::CostFunctionTemplate< double >.

◆ SetShapeParameterMeans()

template<typename TFeatureImage, typename TOutputPixel>
virtual void itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::SetShapeParameterMeans ( ArrayType _arg)
virtual

Set/Get the array of shape parameters mean.

◆ SetShapeParameterStandardDeviations()

template<typename TFeatureImage, typename TOutputPixel>
virtual void itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::SetShapeParameterStandardDeviations ( ArrayType _arg)
virtual

Set/Get the array of shape parameters standard deviation.

◆ SetWeights()

template<typename TFeatureImage, typename TOutputPixel>
virtual void itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::SetWeights ( WeightsType _arg)
virtual

Set/Get the weights for each term. Default is a vector of all ones. The weights are applied to terms in the following order: LogInsideTerm, LogGradientTerm, LogShapePriorTerm and LogPosePriorTerm.

Member Data Documentation

◆ ImageDimension

template<typename TFeatureImage, typename TOutputPixel>
unsigned int itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::ImageDimension = TFeatureImage::ImageDimension
staticconstexpr

Dimension constant.

Definition at line 76 of file itkShapePriorMAPCostFunction.h.

◆ m_GaussianFunction

template<typename TFeatureImage, typename TOutputPixel>
GaussianKernelFunction<double>::Pointer itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::m_GaussianFunction {}
private

Definition at line 160 of file itkShapePriorMAPCostFunction.h.

◆ m_ShapeParameterMeans

template<typename TFeatureImage, typename TOutputPixel>
ArrayType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::m_ShapeParameterMeans {}
private

Definition at line 156 of file itkShapePriorMAPCostFunction.h.

◆ m_ShapeParameterStandardDeviations

template<typename TFeatureImage, typename TOutputPixel>
ArrayType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::m_ShapeParameterStandardDeviations {}
private

Definition at line 157 of file itkShapePriorMAPCostFunction.h.

◆ m_Weights

template<typename TFeatureImage, typename TOutputPixel>
WeightsType itk::ShapePriorMAPCostFunction< TFeatureImage, TOutputPixel >::m_Weights {}
private

Definition at line 158 of file itkShapePriorMAPCostFunction.h.


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