ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
itk::SingleImageCostFunction< TImage > Class Template Reference

#include <itkSingleImageCostFunction.h>

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

Detailed Description

template<class 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 52 of file itkSingleImageCostFunction.h.

Public Types

using ConstPointer = SmartPointer< const Self >
 
using ContinuousIndexType = ContinuousIndex< CoordRepType, ImageDimension >
 
using CoordRepType = Superclass::ParametersValueType
 
using DefaultInterpolatorType = LinearInterpolateImageFunction< ImageType, CoordRepType >
 
using DerivativeType = typename Superclass::DerivativeType
 
using GradientImageFunctionType = PhysicalCentralDifferenceImageFunction< ImageType, CoordRepType >
 
using ImageConstPointer = typename ImageType::ConstPointer
 
using ImagePixelType = typename TImage::PixelType
 
using ImageType = TImage
 
using IndexType = Index< ImageDimension >
 
using InterpolatorType = InterpolateImageFunction< ImageType, CoordRepType >
 
using MeasureType = typename Superclass::MeasureType
 
using ParametersType = typename Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using PointType = Point< CoordRepType, 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< TInternalComputationValueType >
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = OptimizerParameters< TInternalComputationValueType >
 
using ParametersValueType = TInternalComputationValueType
 
using Pointer = SmartPointer< Self >
 
using Self = CostFunctionTemplate
 
using Superclass = Object
 
- 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 char * GetNameOfClass () const
 
unsigned int GetNumberOfParameters (void) const override
 
MeasureType GetValue (const ParametersType &parameters) const override
 
virtual void Initialize (void) throw ( ExceptionObject )
 
void SetMaximize ()
 
void SetMinimize ()
 
virtual void SetInterpolator (InterpolatorType *_arg)
 
virtual const InterpolatorTypeGetInterpolator () const
 
virtual void SetImage (const ImageType *_arg)
 
virtual const ImageTypeGetImage () const
 
- 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 *)
 
unsigned long AddObserver (const EventObject &event, Command *) 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)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexceptoverride
 
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
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
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 flag)
 
- 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
 
- Protected Member Functions inherited from itk::SingleValuedCostFunction
 SingleValuedCostFunction ()=default
 
 ~SingleValuedCostFunction () override
 
- Protected Member Functions inherited from itk::CostFunctionTemplate< TInternalComputationValueType >
 CostFunctionTemplate ()=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 &time)
 
 ~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

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

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

Definition at line 62 of file itkSingleImageCostFunction.h.

Definition at line 96 of file itkSingleImageCostFunction.h.

Type used for representing point components

Definition at line 91 of file itkSingleImageCostFunction.h.

Definition at line 100 of file itkSingleImageCostFunction.h.

template<class 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.

Type of the GradientImageFunction class

Definition at line 103 of file itkSingleImageCostFunction.h.

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

Definition at line 85 of file itkSingleImageCostFunction.h.

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

Definition at line 84 of file itkSingleImageCostFunction.h.

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

Type of the Image.

Definition at line 83 of file itkSingleImageCostFunction.h.

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

Type for locations

Definition at line 94 of file itkSingleImageCostFunction.h.

Type of the Interpolator class

Definition at line 99 of file itkSingleImageCostFunction.h.

template<class 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.

template<class 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.

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

Definition at line 61 of file itkSingleImageCostFunction.h.

template<class TImage >
using itk::SingleImageCostFunction< TImage >::PointType = Point< CoordRepType, ImageDimension >

Definition at line 95 of file itkSingleImageCostFunction.h.

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

Standard class type alias.

Definition at line 59 of file itkSingleImageCostFunction.h.

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

Definition at line 60 of file itkSingleImageCostFunction.h.

Constructor & Destructor Documentation

template<class TImage >
itk::SingleImageCostFunction< TImage >::SingleImageCostFunction ( )
protected
template<class TImage >
itk::SingleImageCostFunction< TImage >::~SingleImageCostFunction ( )
inlineoverrideprotected

Definition at line 145 of file itkSingleImageCostFunction.h.

Member Function Documentation

template<class 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.

template<class 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.

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

Get/set the Image.

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

Get/set the Interpolator.

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

Run-time type information (and related methods).

Reimplemented from itk::SingleValuedCostFunction.

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

Return the number of parameters required by the Transform

Implements itk::CostFunctionTemplate< TInternalComputationValueType >.

Definition at line 119 of file itkSingleImageCostFunction.h.

template<class 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.

template<class TImage >
virtual void itk::SingleImageCostFunction< TImage >::Initialize ( void  )
throw (ExceptionObject
)
virtual

Initialize the cost function

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

Method for creation through the object factory.

template<class 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< TInternalComputationValueType >.

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

Get/set the Image.

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

Get/set the Interpolator.

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

Definition at line 137 of file itkSingleImageCostFunction.h.

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

Definition at line 133 of file itkSingleImageCostFunction.h.

Member Data Documentation

template<class TImage >
constexpr unsigned int itk::SingleImageCostFunction< TImage >::ImageDimension = ImageType::ImageDimension
static

Constant for the image dimension

Definition at line 88 of file itkSingleImageCostFunction.h.

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

Definition at line 151 of file itkSingleImageCostFunction.h.

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

Definition at line 149 of file itkSingleImageCostFunction.h.

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

Definition at line 150 of file itkSingleImageCostFunction.h.

template<class 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 154 of file itkSingleImageCostFunction.h.


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