ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches

#include <itkSingleImageCostFunction.h>

Detailed Description

template<typename TImage>
class itk::SingleImageCostFunction< TImage >

This class is a cost function which queries an underlying image for the single value.

The user is expected to provide an image representing the underlying cost function. The user may also provide an image interpolator (if not provided the LinearInterpolateImageFunction is used by default). The gradient is computed using central differences in physical space.

The parameters are the physical location (itkPoint) of the current position. Initialize() must be called before using this cost function.

Author
Dan Mueller, Queensland University of Technology, dan.muel[at]gmail.com

Definition at line 53 of file itkSingleImageCostFunction.h.

+ Inheritance diagram for itk::SingleImageCostFunction< TImage >:
+ Collaboration diagram for itk::SingleImageCostFunction< TImage >:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using ContinuousIndexType = ContinuousIndex<CoordinateType, ImageDimension>
 
using CoordinateType = Superclass::ParametersValueType
 
using DefaultInterpolatorType = LinearInterpolateImageFunction<ImageType, CoordinateType>
 
using DerivativeType = typename Superclass::DerivativeType
 
using GradientImageFunctionType = PhysicalCentralDifferenceImageFunction<ImageType, CoordinateType>
 
using ImageConstPointer = typename ImageType::ConstPointer
 
using ImagePixelType = typename TImage::PixelType
 
using ImageType = TImage
 
using IndexType = Index<ImageDimension>
 
using InterpolatorType = InterpolateImageFunction<ImageType, CoordinateType>
 
using MeasureType = typename Superclass::MeasureType
 
using ParametersType = typename Superclass::ParametersType
 
using Pointer = SmartPointer<Self>
 
using PointType = Point<CoordinateType, ImageDimension>
 
using Self = SingleImageCostFunction
 
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

virtual::itk::LightObject::Pointer CreateAnother () const
 
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override
 
virtual const DerivativeType::ValueType & GetDerivativeThreshold () const
 
virtual const ImageType * GetImage () const
 
virtual const InterpolatorType * GetInterpolator () const
 
virtual const char * GetNameOfClass () const
 
unsigned int GetNumberOfParameters () const override
 
MeasureType GetValue (const ParametersType &parameters) const override
 
virtual void Initialize ()
 
virtual void SetDerivativeThreshold (DerivativeType::ValueType _arg)
 
virtual void SetImage (const ImageType *_arg)
 
virtual void SetInterpolator (InterpolatorType *_arg)
 
void SetMaximize ()
 
void SetMinimize ()
 
- Public Member Functions inherited from itk::SingleValuedCostFunction
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
 
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
 
- 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 = ImageType::ImageDimension
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const override
 
 SingleImageCostFunction ()
 
 ~SingleImageCostFunction () 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

DerivativeType::ValueType m_DerivativeThreshold
 
GradientImageFunctionType::Pointer m_GradientImageFunction
 
ImageConstPointer m_Image
 
InterpolatorType::Pointer m_Interpolator
 
ImagePixelType m_OutsideValue
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ConstPointer = SmartPointer<const Self>

Definition at line 62 of file itkSingleImageCostFunction.h.

◆ ContinuousIndexType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ContinuousIndexType = ContinuousIndex<CoordinateType, ImageDimension>

Definition at line 96 of file itkSingleImageCostFunction.h.

◆ CoordinateType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::CoordinateType = Superclass::ParametersValueType

Type used for representing point components

Definition at line 91 of file itkSingleImageCostFunction.h.

◆ DefaultInterpolatorType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::DefaultInterpolatorType = LinearInterpolateImageFunction<ImageType, CoordinateType>

Definition at line 100 of file itkSingleImageCostFunction.h.

◆ DerivativeType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::DerivativeType = typename Superclass::DerivativeType

DerivativeType type alias. It defines a type used to return the cost function derivative.

Definition at line 76 of file itkSingleImageCostFunction.h.

◆ GradientImageFunctionType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::GradientImageFunctionType = PhysicalCentralDifferenceImageFunction<ImageType, CoordinateType>

Type of the GradientImageFunction class

Definition at line 103 of file itkSingleImageCostFunction.h.

◆ ImageConstPointer

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ImageConstPointer = typename ImageType::ConstPointer

Definition at line 85 of file itkSingleImageCostFunction.h.

◆ ImagePixelType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ImagePixelType = typename TImage::PixelType

Definition at line 84 of file itkSingleImageCostFunction.h.

◆ ImageType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ImageType = TImage

Type of the Image.

Definition at line 83 of file itkSingleImageCostFunction.h.

◆ IndexType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::IndexType = Index<ImageDimension>

Type for locations

Definition at line 94 of file itkSingleImageCostFunction.h.

◆ InterpolatorType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::InterpolatorType = InterpolateImageFunction<ImageType, CoordinateType>

Type of the Interpolator class

Definition at line 99 of file itkSingleImageCostFunction.h.

◆ MeasureType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::MeasureType = typename Superclass::MeasureType

MeasureType type alias. It defines a type used to return the cost function value.

Definition at line 72 of file itkSingleImageCostFunction.h.

◆ ParametersType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::ParametersType = typename Superclass::ParametersType

ParametersType type alias. It defines a position in the optimization search space.

Definition at line 80 of file itkSingleImageCostFunction.h.

◆ Pointer

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::Pointer = SmartPointer<Self>

Definition at line 61 of file itkSingleImageCostFunction.h.

◆ PointType

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::PointType = Point<CoordinateType, ImageDimension>

Definition at line 95 of file itkSingleImageCostFunction.h.

◆ Self

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::Self = SingleImageCostFunction

Standard class type alias.

Definition at line 59 of file itkSingleImageCostFunction.h.

◆ Superclass

template<typename TImage>
using itk::SingleImageCostFunction< TImage >::Superclass = SingleValuedCostFunction

Definition at line 60 of file itkSingleImageCostFunction.h.

Constructor & Destructor Documentation

◆ SingleImageCostFunction()

template<typename TImage>
itk::SingleImageCostFunction< TImage >::SingleImageCostFunction ( )
protected

◆ ~SingleImageCostFunction()

template<typename TImage>
itk::SingleImageCostFunction< TImage >::~SingleImageCostFunction ( )
overrideprotecteddefault

Member Function Documentation

◆ CreateAnother()

template<typename TImage>
virtual::itk::LightObject::Pointer itk::SingleImageCostFunction< TImage >::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.

◆ GetDerivative()

template<typename TImage>
void itk::SingleImageCostFunction< TImage >::GetDerivative ( const ParametersType & parameters,
DerivativeType & derivative ) const
overridevirtual

This method returns the derivative of the cost function corresponding to the specified parameters.

Implements itk::SingleValuedCostFunction.

◆ GetDerivativeThreshold()

template<typename TImage>
virtual const DerivativeType::ValueType & itk::SingleImageCostFunction< TImage >::GetDerivativeThreshold ( ) const
virtual

◆ GetImage()

template<typename TImage>
virtual const ImageType * itk::SingleImageCostFunction< TImage >::GetImage ( ) const
virtual

◆ GetInterpolator()

template<typename TImage>
virtual const InterpolatorType * itk::SingleImageCostFunction< TImage >::GetInterpolator ( ) const
virtual

◆ GetNameOfClass()

template<typename TImage>
virtual const char * itk::SingleImageCostFunction< TImage >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedCostFunction.

◆ GetNumberOfParameters()

template<typename TImage>
unsigned int itk::SingleImageCostFunction< TImage >::GetNumberOfParameters ( ) const
inlineoverridevirtual

Return the number of parameters required by the Transform

Implements itk::CostFunctionTemplate< double >.

Definition at line 123 of file itkSingleImageCostFunction.h.

◆ GetValue()

template<typename TImage>
MeasureType itk::SingleImageCostFunction< TImage >::GetValue ( const ParametersType & parameters) const
overridevirtual

This method returns the value of the cost function corresponding to the specified parameters.

Implements itk::SingleValuedCostFunction.

◆ Initialize()

template<typename TImage>
virtual void itk::SingleImageCostFunction< TImage >::Initialize ( )
virtual

Initialize the cost function

◆ New()

template<typename TImage>
static Pointer itk::SingleImageCostFunction< TImage >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<typename TImage>
void itk::SingleImageCostFunction< TImage >::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 >.

◆ SetDerivativeThreshold()

template<typename TImage>
virtual void itk::SingleImageCostFunction< TImage >::SetDerivativeThreshold ( DerivativeType::ValueType _arg)
virtual

Get/set the DerivativeThreshold.

◆ SetImage()

template<typename TImage>
virtual void itk::SingleImageCostFunction< TImage >::SetImage ( const ImageType * _arg)
virtual

Get/set the Image.

◆ SetInterpolator()

template<typename TImage>
virtual void itk::SingleImageCostFunction< TImage >::SetInterpolator ( InterpolatorType * _arg)
virtual

Get/set the Interpolator.

◆ SetMaximize()

template<typename TImage>
void itk::SingleImageCostFunction< TImage >::SetMaximize ( )
inline

Definition at line 146 of file itkSingleImageCostFunction.h.

◆ SetMinimize()

template<typename TImage>
void itk::SingleImageCostFunction< TImage >::SetMinimize ( )
inline

Definition at line 141 of file itkSingleImageCostFunction.h.

Member Data Documentation

◆ ImageDimension

template<typename TImage>
unsigned int itk::SingleImageCostFunction< TImage >::ImageDimension = ImageType::ImageDimension
staticconstexpr

Constant for the image dimension

Definition at line 88 of file itkSingleImageCostFunction.h.

◆ m_DerivativeThreshold

template<typename TImage>
DerivativeType::ValueType itk::SingleImageCostFunction< TImage >::m_DerivativeThreshold
private

Definition at line 165 of file itkSingleImageCostFunction.h.

◆ m_GradientImageFunction

template<typename TImage>
GradientImageFunctionType::Pointer itk::SingleImageCostFunction< TImage >::m_GradientImageFunction
private

Definition at line 161 of file itkSingleImageCostFunction.h.

◆ m_Image

template<typename TImage>
ImageConstPointer itk::SingleImageCostFunction< TImage >::m_Image
private

Definition at line 159 of file itkSingleImageCostFunction.h.

◆ m_Interpolator

template<typename TImage>
InterpolatorType::Pointer itk::SingleImageCostFunction< TImage >::m_Interpolator
private

Definition at line 160 of file itkSingleImageCostFunction.h.

◆ m_OutsideValue

template<typename TImage>
ImagePixelType itk::SingleImageCostFunction< TImage >::m_OutsideValue
private

Used to define the value outside the image buffer. Important when path points are on the edge of an image

Definition at line 164 of file itkSingleImageCostFunction.h.


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