Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mirtk::ImageGradientFunction Class Referenceabstract

#include <ImageGradientFunction.h>

Inheritance diagram for mirtk::ImageGradientFunction:
Inheritance graph
Collaboration diagram for mirtk::ImageGradientFunction:
Collaboration graph

Public Types

typedef Vector3D< double > GradientType
 Type of interpolated gradient vectors.
 

Public Member Functions

virtual void BoundingBox (double, double, int &, int &, int &, int &) const
 Returns discrete boundaries of local 2D image region needed for interpolation.
 
virtual void BoundingBox (double, double, double, int &, int &, int &, int &, int &, int &) const
 Returns discrete boundaries of local 3D image region needed for interpolation.
 
virtual void BoundingBox (double, double, double, double, int &, int &, int &, int &, int &, int &, int &, int &) const
 Returns discrete boundaries of local 4D image region needed for interpolation.
 
virtual void BoundingInterval (double, int &, int &) const =0
 
void Evaluate (double *, double, double, double=0, int=1) const
 
virtual void EvaluateInside (double *, double, double, double=0, int=1) const
 
virtual void EvaluateOutside (double *, double, double, double=0, int=1) const
 
void EvaluateWithPadding (double *, double, double, double=0, int=1) const
 
virtual void EvaluateWithPaddingInside (double *, double, double, double=0, int=1) const
 
virtual void EvaluateWithPaddingOutside (double *, double, double, double=0, int=1) const
 
enum ExtrapolationMode ExtrapolationMode () const
 Get extrapolation mode used by this interpolator.
 
virtual void Extrapolator (ExtrapolateImageFunction *, bool=false)
 Set extrapolate image function for evaluation outside of image domain.
 
ExtrapolateImageFunctionExtrapolator ()
 
const ExtrapolateImageFunctionExtrapolator () const
 
GradientType Get (double, double, double=0, double=0) const
 
virtual GradientType GetInside (double, double, double=0, double=0) const =0
 
virtual GradientType GetOutside (double, double, double=0, double=0) const =0
 Evaluate generic image gradient at an arbitrary location (in pixels)
 
double GetTOrigin () const
 Get temporal origin of input image.
 
GradientType GetWithPadding (double, double, double=0, double=0) const
 
virtual GradientType GetWithPaddingInside (double, double, double=0, double=0) const =0
 
virtual GradientType GetWithPaddingOutside (double, double, double=0, double=0) const =0
 
virtual void Initialize (bool coeff=false)
 
virtual void Input (const BaseImage *)
 Set input image.
 
const BaseImageInput () const
 Get input image.
 
void Inside (double &, double &, double &, double &) const
 
void Inside (double &, double &, double &, double &, double &, double &) const
 
void Inside (double &, double &, double &, double &, double &, double &, double &, double &) const
 
virtual enum InterpolationMode InterpolationMode () const =0
 Get interpolation mode corresponding to this image gradient function.
 
bool IsForeground (double, double) const
 
bool IsForeground (double, double, double) const
 
bool IsForeground (double, double, double, double) const
 
bool IsInside (double, double) const
 
bool IsInside (double, double, double) const
 
bool IsInside (double, double, double, double) const
 
bool IsOutside (double, double) const
 
bool IsOutside (double, double, double) const
 
bool IsOutside (double, double, double, double) const
 
virtual ExtrapolateImageFunctionNew (enum ExtrapolationMode, const BaseImage *=NULL)
 Construct extrapolator which is compatible with this image gradient function.
 
GradientType operator() (double, double, double=0, double=0) const
 Evaluate image gradient at an arbitrary location (in pixels)
 
void WorldToImage (double &, double &) const
 Convert world coordinates to image location (in pixels)
 
void WorldToImage (double &, double &, double &) const
 Convert world coordinates to image location (in pixels)
 
void WorldToImage (Point &) const
 Convert world coordinates to image location (in pixels)
 
virtual ~ImageGradientFunction ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static ImageGradientFunctionNew (enum InterpolationMode, const BaseImage *=NULL)
 Construct image gradient function with default infinite extension of input image.
 
static ImageGradientFunctionNew (enum InterpolationMode, enum ExtrapolationMode, const BaseImage *=NULL)
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 

Protected Member Functions

 ImageGradientFunction ()
 Default constructor.
 
void ImageGradientToWorld (GradientType &) const
 Orient and scale image gradient by world to image matrix.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Protected Attributes

ExtrapolateImageFunction_InfiniteInput
 
bool _InfiniteInputOwner
 Whether infinite discrete image was instantiated by this image function.
 
BaseImage_Input
 Input image for filter.
 
Matrix _Orientation
 Image orientation matrix.
 
GradientType _VoxelSize
 Image resolution.
 
double _x1
 

Additional Inherited Members

- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Abstract base class of image gradient functions

An image gradient function applies the derivative of the interpolation kernel instead of the interpolation kernel itself to evaluate the image gradient at an arbitrary image location. It interpolates the 1st order image derivatives instead of the image intensity value. Note that it cannot be applied to multi-channel or vector-valued images.

Definition at line 44 of file ImageGradientFunction.h.

Member Function Documentation

§ BoundingInterval()

virtual void mirtk::ImageGradientFunction::BoundingInterval ( double  ,
int &  ,
int &   
) const
pure virtual

§ Evaluate()

void mirtk::ImageGradientFunction::Evaluate ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inline

Evaluate image gradient at an arbitrary location (in pixels)

If the location is inside the domain for which the filter can perform an interpolation without considering a particular boundary condition, the faster EvaluateInside method is called. Otherwise, the EvaluateOutside method which makes use of the extrapolation of the discrete image domain in order to interpolate also at boundary or outside locations is used.

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 767 of file ImageGradientFunction.h.

§ EvaluateInside()

void mirtk::ImageGradientFunction::EvaluateInside ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inlinevirtual

Evaluate image gradient without handling boundary conditions

This version is faster than EvaluateOutside, but is only defined inside the domain for which all image values required for interpolation are defined and thus require no extrapolation of the finite image.

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 747 of file ImageGradientFunction.h.

§ EvaluateOutside()

void mirtk::ImageGradientFunction::EvaluateOutside ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inlinevirtual

Evaluate image gradient at an arbitrary location (in pixels)

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 757 of file ImageGradientFunction.h.

§ EvaluateWithPadding()

void mirtk::ImageGradientFunction::EvaluateWithPadding ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inline

Evaluate image gradient at an arbitrary location (in pixels)

If the location is partially inside the foreground region of the image, only the foreground values are interpolated. Otherwise, the _DefaultValue is returned.

If the location is inside the domain for which the filter can perform an interpolation without considering a particular boundary condition, the faster EvaluateWithPaddingInside method is called. Otherwise, the EvaluateWithPaddingOutside method which makes use of the extrapolation of the discrete image domain in order to interpolate also at boundary or outside locations is used.

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 796 of file ImageGradientFunction.h.

§ EvaluateWithPaddingInside()

void mirtk::ImageGradientFunction::EvaluateWithPaddingInside ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inlinevirtual

Evaluate image gradient at an arbitrary location (in pixels)

If the location is partially inside the foreground region of the image, only the foreground values are interpolated. Otherwise, the _DefaultValue is returned.

This version is faster than EvaluateWithPaddingOutside, but is only defined inside the domain for which all image values required for interpolation are defined and thus require no extrapolation of the finite image.

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 776 of file ImageGradientFunction.h.

§ EvaluateWithPaddingOutside()

void mirtk::ImageGradientFunction::EvaluateWithPaddingOutside ( double *  v,
double  x,
double  y,
double  z = 0,
int  vt = 1 
) const
inlinevirtual

Evaluate image gradient at an arbitrary location (in pixels)

If the location is partially inside the foreground region of the image, only the foreground values are interpolated. Otherwise, the _DefaultValue is returned.

If _WrtWorld is true, the returned gradient vector is in world units and oriented according to the image orientation.

Definition at line 786 of file ImageGradientFunction.h.

§ Extrapolator() [1/2]

ExtrapolateImageFunction * mirtk::ImageGradientFunction::Extrapolator ( )
inline

Get extrapolate image function for evaluation outside of image domain or NULL if extrapolation mode is Extrapolation_None

Definition at line 540 of file ImageGradientFunction.h.

§ Extrapolator() [2/2]

const ExtrapolateImageFunction * mirtk::ImageGradientFunction::Extrapolator ( ) const
inline

Get extrapolate image function for evaluation outside of image domain or NULL if extrapolation mode is Extrapolation_None

Definition at line 546 of file ImageGradientFunction.h.

§ Get()

ImageGradientFunction::GradientType mirtk::ImageGradientFunction::Get ( double  x,
double  y,
double  z = 0,
double  t = 0 
) const
inline

Evaluate image gradient at an arbitrary location (in pixels)

If the location is inside the domain for which the filter can perform an interpolation without considering a particular boundary condition, the faster GetInside method is called. Otherwise, the GetOutside method which makes use of the extrapolation of the discrete image domain in order to interpolate also at boundary or outside locations is used.

Definition at line 723 of file ImageGradientFunction.h.

§ GetInside()

virtual GradientType mirtk::ImageGradientFunction::GetInside ( double  ,
double  ,
double  = 0,
double  = 0 
) const
pure virtual

§ GetWithPadding()

ImageGradientFunction::GradientType mirtk::ImageGradientFunction::GetWithPadding ( double  x,
double  y,
double  z = 0,
double  t = 0 
) const
inline

Evaluate image gradient at an arbitrary location (in pixels)

If the location is partially inside the foreground region of the image, only the foreground values are interpolated. Otherwise, the _DefaultValue is returned.

Definition at line 731 of file ImageGradientFunction.h.

§ GetWithPaddingInside()

virtual GradientType mirtk::ImageGradientFunction::GetWithPaddingInside ( double  ,
double  ,
double  = 0,
double  = 0 
) const
pure virtual

§ GetWithPaddingOutside()

virtual GradientType mirtk::ImageGradientFunction::GetWithPaddingOutside ( double  ,
double  ,
double  = 0,
double  = 0 
) const
pure virtual

§ Initialize()

virtual void mirtk::ImageGradientFunction::Initialize ( bool  coeff = false)
virtual

§ Inside() [1/3]

void mirtk::ImageGradientFunction::Inside ( double &  x1,
double &  y1,
double &  x2,
double &  y2 
) const
inline

Returns the image domain for which this image interpolation function can be used without handling any form of boundary conditions

Definition at line 586 of file ImageGradientFunction.h.

§ Inside() [2/3]

void mirtk::ImageGradientFunction::Inside ( double &  x1,
double &  y1,
double &  z1,
double &  x2,
double &  y2,
double &  z2 
) const
inline

Returns the image domain for which this image interpolation function can be used without handling any form of boundary conditions

Definition at line 594 of file ImageGradientFunction.h.

§ Inside() [3/3]

void mirtk::ImageGradientFunction::Inside ( double &  x1,
double &  y1,
double &  z1,
double &  t1,
double &  x2,
double &  y2,
double &  z2,
double &  t2 
) const
inline

Returns the image domain for which this image interpolation function can be used without handling any form of boundary conditions

Definition at line 602 of file ImageGradientFunction.h.

§ IsForeground() [1/3]

bool mirtk::ImageGradientFunction::IsForeground ( double  x,
double  y 
) const
inline

Check if the location is fully inside the foreground of the image, i.e., including all discrete image locations required for interpolation

Definition at line 694 of file ImageGradientFunction.h.

§ IsForeground() [2/3]

bool mirtk::ImageGradientFunction::IsForeground ( double  x,
double  y,
double  z 
) const
inline

Check if the location is fully inside the foreground of the image, i.e., including all discrete image locations required for interpolation

Definition at line 702 of file ImageGradientFunction.h.

§ IsForeground() [3/3]

bool mirtk::ImageGradientFunction::IsForeground ( double  x,
double  y,
double  z,
double  t 
) const
inline

Check if the location is fully inside the foreground of the image, i.e., including all discrete image locations required for interpolation

Definition at line 710 of file ImageGradientFunction.h.

§ IsInside() [1/3]

bool mirtk::ImageGradientFunction::IsInside ( double  x,
double  y 
) const
inline

Check if the location (in pixels) is inside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 658 of file ImageGradientFunction.h.

§ IsInside() [2/3]

bool mirtk::ImageGradientFunction::IsInside ( double  x,
double  y,
double  z 
) const
inline

Check if the location (in pixels) is inside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 664 of file ImageGradientFunction.h.

§ IsInside() [3/3]

bool mirtk::ImageGradientFunction::IsInside ( double  x,
double  y,
double  z,
double  t 
) const
inline

Check if the location (in pixels) is inside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 670 of file ImageGradientFunction.h.

§ IsOutside() [1/3]

bool mirtk::ImageGradientFunction::IsOutside ( double  x,
double  y 
) const
inline

Check if the location (in pixels) is outside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 676 of file ImageGradientFunction.h.

§ IsOutside() [2/3]

bool mirtk::ImageGradientFunction::IsOutside ( double  x,
double  y,
double  z 
) const
inline

Check if the location (in pixels) is outside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 682 of file ImageGradientFunction.h.

§ IsOutside() [3/3]

bool mirtk::ImageGradientFunction::IsOutside ( double  x,
double  y,
double  z,
double  t 
) const
inline

Check if the location (in pixels) is outside the domain for which this image interpolation can be used without handling any form of boundary condition

Definition at line 688 of file ImageGradientFunction.h.

§ New()

static ImageGradientFunction* mirtk::ImageGradientFunction::New ( enum  InterpolationMode,
enum  ExtrapolationMode,
const BaseImage = NULL 
)
static

Construct image gradient function with specified infinite extension of input image

The caller is required to set the input, initialize, and destroy the image gradient function only, the extrapolator is initialized and destroyed by the image function unless the extrapolator has been replaced using the setter.

Member Data Documentation

§ _InfiniteInput

ExtrapolateImageFunction* mirtk::ImageGradientFunction::_InfiniteInput
protected

Infinite discrete image obtained by extrapolation of finite input image. Unused by default, i.e., NULL which corresponds to extrapolation mode Extrapolation_None. If NULL, the interpolator has to deal with boundary cases itself either by only partially interpolating the available values or returning the _DefaultValue.

Definition at line 89 of file ImageGradientFunction.h.

§ _x1

double mirtk::ImageGradientFunction::_x1
protected

Domain of finite input image for which the image gradient is defined without requiring any extrapolation: [x1, x2]x[y1, y2]x[z1, z2]x[t1, t2]

Definition at line 96 of file ImageGradientFunction.h.


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