#include <ImageGradientFunction.h>
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. | |
ExtrapolateImageFunction * | Extrapolator () |
const ExtrapolateImageFunction * | Extrapolator () 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 BaseImage * | Input () 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 ExtrapolateImageFunction * | New (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 ImageGradientFunction * | New (enum InterpolationMode, const BaseImage *=NULL) |
Construct image gradient function with default infinite extension of input image. | |
static ImageGradientFunction * | New (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) |
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.
|
pure virtual |
Returns interval of discrete image indices whose values are needed for interpolation of the image value at a given continuous coordinate
Implemented in mirtk::GenericFastLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction< ImageType >, mirtk::GenericFastLinearImageGradientFunction< BaseImage >, mirtk::GenericLinearImageGradientFunction< TImage >, and mirtk::GenericLinearImageGradientFunction< BaseImage >.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
pure virtual |
Evaluate image gradient without handling boundary conditions
This version is faster than GetOutside, 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.
Implemented in mirtk::GenericFastLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction< ImageType >, mirtk::GenericFastLinearImageGradientFunction< BaseImage >, mirtk::GenericLinearImageGradientFunction< TImage >, mirtk::GenericLinearImageGradientFunction< BaseImage >, mirtk::GenericFastLinearImageGradientFunction3D< TImage >, mirtk::GenericFastLinearImageGradientFunction3D< BaseImage >, mirtk::GenericFastLinearImageGradientFunction2D< TImage >, mirtk::GenericFastLinearImageGradientFunction2D< BaseImage >, mirtk::GenericLinearImageGradientFunction2D< TImage >, mirtk::GenericLinearImageGradientFunction3D< TImage >, mirtk::GenericLinearImageGradientFunction2D< BaseImage >, and mirtk::GenericLinearImageGradientFunction3D< BaseImage >.
|
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.
|
pure virtual |
Evaluate image gradient without handling boundary conditions
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 GetWithPaddingOutside, 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.
Implemented in mirtk::GenericFastLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction< ImageType >, mirtk::GenericFastLinearImageGradientFunction< BaseImage >, mirtk::GenericLinearImageGradientFunction< TImage >, mirtk::GenericLinearImageGradientFunction< BaseImage >, mirtk::GenericFastLinearImageGradientFunction3D< TImage >, mirtk::GenericFastLinearImageGradientFunction3D< BaseImage >, mirtk::GenericFastLinearImageGradientFunction2D< TImage >, mirtk::GenericFastLinearImageGradientFunction2D< BaseImage >, mirtk::GenericLinearImageGradientFunction2D< TImage >, mirtk::GenericLinearImageGradientFunction2D< BaseImage >, mirtk::GenericLinearImageGradientFunction3D< TImage >, and mirtk::GenericLinearImageGradientFunction3D< BaseImage >.
|
pure virtual |
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.
Implemented in mirtk::GenericFastLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction< ImageType >, mirtk::GenericFastLinearImageGradientFunction< BaseImage >, mirtk::GenericFastLinearImageGradientFunction3D< TImage >, mirtk::GenericLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction3D< BaseImage >, mirtk::GenericLinearImageGradientFunction< BaseImage >, mirtk::GenericFastLinearImageGradientFunction2D< TImage >, and mirtk::GenericFastLinearImageGradientFunction2D< BaseImage >.
|
virtual |
Initialize image function
[in] | coeff | Whether input image contains interpolation coefficients already. Otherwise, the interpolate image function will compute these coefficients from the input intensities. |
Reimplemented in mirtk::GenericImageGradientFunction< TImage >, mirtk::GenericImageGradientFunction< ImageType >, mirtk::GenericImageGradientFunction< BaseImage >, mirtk::GenericFastLinearImageGradientFunction< TImage >, mirtk::GenericFastLinearImageGradientFunction< ImageType >, mirtk::GenericFastLinearImageGradientFunction< BaseImage >, mirtk::GenericLinearImageGradientFunction< TImage >, and mirtk::GenericLinearImageGradientFunction< BaseImage >.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.