ITK
4.2.0
Insight Segmentation and Registration Toolkit
|
#include <itkBSplineInterpolateImageFunction.h>
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | ImageDimension = Superclass::ImageDimension |
Static Public Attributes inherited from itk::InterpolateImageFunction< TImageType, TCoordRep > | |
Static Public Attributes inherited from itk::ImageFunction< TImageType, NumericTraits< TImageType::PixelType >::RealType, TCoordRep > |
Protected Attributes | |
CoefficientImageType::ConstPointer | m_Coefficients |
TImageType::SizeType | m_DataLength |
std::vector< CoefficientDataType > | m_Scratch |
unsigned int | m_SplineOrder |
Private Member Functions | |
void | ApplyMirrorBoundaryConditions (vnl_matrix< long > &evaluateIndex, unsigned int splineOrder) const |
BSplineInterpolateImageFunction (const Self &) | |
void | DetermineRegionOfSupport (vnl_matrix< long > &evaluateIndex, const ContinuousIndexType &x, unsigned int splineOrder) const |
void | GeneratePointsToIndex () |
void | operator= (const Self &) |
void | SetDerivativeWeights (const ContinuousIndexType &x, const vnl_matrix< long > &EvaluateIndex, vnl_matrix< double > &weights, unsigned int splineOrder) const |
void | SetInterpolationWeights (const ContinuousIndexType &x, const vnl_matrix< long > &EvaluateIndex, vnl_matrix< double > &weights, unsigned int splineOrder) const |
Private Attributes | |
Iterator | m_CIterator |
CoefficientFilterPointer | m_CoefficientFilter |
unsigned long | m_MaxNumberInterpolationPoints |
ThreadIdType | m_NumberOfThreads |
std::vector< IndexType > | m_PointsToIndex |
vnl_matrix< long > * | m_ThreadedEvaluateIndex |
vnl_matrix< double > * | m_ThreadedWeights |
vnl_matrix< double > * | m_ThreadedWeightsDerivative |
bool | m_UseImageDirection |
Evaluates the B-Spline interpolation of an image. Spline order may be from 0 to 5.
This class defines N-Dimension B-Spline transformation. It is based on: [1] M. Unser, "Splines: A Perfect Fit for Signal and Image Processing," IEEE Signal Processing Magazine, vol. 16, no. 6, pp. 22-38, November 1999. [2] M. Unser, A. Aldroubi and M. Eden, "B-Spline Signal Processing: Part I--Theory," IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 821-832, February 1993. [3] M. Unser, A. Aldroubi and M. Eden, "B-Spline Signal Processing: Part II--Efficient Design and Applications," IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 834-848, February 1993. And code obtained from bigwww.epfl.ch by Philippe Thevenaz
The B spline coefficients are calculated through the BSplineDecompositionImageFilter
Limitations: Spline order must be between 0 and 5. Spline order must be set before setting the image. Uses mirror boundary conditions. Requires the same order of Spline for each dimension. Spline is determined in all dimensions, cannot selectively pick dimension for calculating spline.
Definition at line 84 of file itkBSplineInterpolateImageFunction.h.
typedef TCoefficientType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::CoefficientDataType |
Internal Coefficient typedef support
Definition at line 122 of file itkBSplineInterpolateImageFunction.h.
typedef BSplineDecompositionImageFilter< TImageType, CoefficientImageType > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::CoefficientFilter |
Define filter for calculating the BSpline coefficients
Definition at line 128 of file itkBSplineInterpolateImageFunction.h.
typedef CoefficientFilter::Pointer itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::CoefficientFilterPointer |
Definition at line 129 of file itkBSplineInterpolateImageFunction.h.
typedef Image< CoefficientDataType, itkGetStaticConstMacro(ImageDimension) > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::CoefficientImageType |
Definition at line 125 of file itkBSplineInterpolateImageFunction.h.
typedef SmartPointer< const Self > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::ConstPointer |
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
Definition at line 92 of file itkBSplineInterpolateImageFunction.h.
typedef Superclass::ContinuousIndexType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::ContinuousIndexType |
ContinuousIndex typedef support.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 113 of file itkBSplineInterpolateImageFunction.h.
typedef CovariantVector< OutputType, itkGetStaticConstMacro(ImageDimension) > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::CovariantVectorType |
Derivative typedef support
Definition at line 134 of file itkBSplineInterpolateImageFunction.h.
typedef Superclass::IndexType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::IndexType |
Index typedef support.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 110 of file itkBSplineInterpolateImageFunction.h.
typedef Superclass::InputImageType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::InputImageType |
InputImageType typedef support.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 104 of file itkBSplineInterpolateImageFunction.h.
typedef ImageLinearIteratorWithIndex< TImageType > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::Iterator |
Iterator typedef support
Definition at line 119 of file itkBSplineInterpolateImageFunction.h.
typedef Superclass::OutputType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::OutputType |
OutputType typedef support.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 98 of file itkBSplineInterpolateImageFunction.h.
typedef SmartPointer< Self > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::Pointer |
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
Definition at line 91 of file itkBSplineInterpolateImageFunction.h.
typedef Superclass::PointType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::PointType |
PointType typedef support
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 116 of file itkBSplineInterpolateImageFunction.h.
typedef BSplineInterpolateImageFunction itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::Self |
Standard class typedefs.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
Definition at line 89 of file itkBSplineInterpolateImageFunction.h.
typedef InterpolateImageFunction< TImageType, TCoordRep > itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::Superclass |
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
Definition at line 90 of file itkBSplineInterpolateImageFunction.h.
|
protected |
|
protected |
|
private |
|
private |
Set the indices in evaluateIndex at the boundaries based on mirror boundary conditions.
|
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.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
|
private |
Determines the indices to use give the splines region of support
|
inlinevirtual |
Evaluate the function at a ContinuousIndex position.
Returns the B-Spline interpolated image intensity at a specified point position. No bounds checking is done. The point is assume to lie within the image buffer.
ImageFunction::IsInsideBuffer() can be used to check bounds before calling the method.
Definition at line 144 of file itkBSplineInterpolateImageFunction.h.
|
inlinevirtual |
Definition at line 154 of file itkBSplineInterpolateImageFunction.h.
|
inlinevirtual |
Definition at line 164 of file itkBSplineInterpolateImageFunction.h.
|
virtual |
|
protectedvirtual |
The following methods take working space (evaluateIndex, weights, weightsDerivative) that is managed by the caller. If threadID is known, the working variables are looked up in the thread indexed arrays. If threadID is not known, working variables are made on the stack and passed to these methods. The stack allocation should be ok since these methods do not store the working variables, i.e. they are not expected to be available beyond the scope of the function call.
This was done to allow for two types of re-entrancy. The first is when a threaded filter, e.g. InterpolateImagePointsFilter calls EvaluateAtContinuousIndex from multiple threads without passing a threadID. So, EvaluateAtContinuousIndex must be thread safe. This is handled with the stack-based allocation of the working space.
The second form of re-entrancy involves methods that call EvaluateAtContinuousIndex from multiple threads, but pass a threadID. In this case, we can gain a little efficiency (hopefully) by looking up pre-allocated working space in arrays that are indexed by thread. The efficiency gain is likely dependent on the size of the working variables, which are in-turn dependent on the dimensionality of the image and the order of the spline.
|
inline |
Definition at line 183 of file itkBSplineInterpolateImageFunction.h.
|
inline |
Definition at line 193 of file itkBSplineInterpolateImageFunction.h.
|
inline |
Definition at line 203 of file itkBSplineInterpolateImageFunction.h.
CovariantVectorType itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::EvaluateDerivativeAtContinuousIndex | ( | const ContinuousIndexType & | x, |
ThreadIdType | threadID | ||
) | const |
|
protectedvirtual |
|
inline |
Definition at line 227 of file itkBSplineInterpolateImageFunction.h.
|
inline |
Definition at line 242 of file itkBSplineInterpolateImageFunction.h.
|
inline |
Definition at line 257 of file itkBSplineInterpolateImageFunction.h.
void itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::EvaluateValueAndDerivativeAtContinuousIndex | ( | const ContinuousIndexType & | x, |
OutputType & | value, | ||
CovariantVectorType & | deriv, | ||
ThreadIdType | threadID | ||
) | const |
|
protectedvirtual |
|
private |
Precomputation for converting the 1D index of the interpolation neighborhood to an N-dimensional index.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
|
virtual |
|
virtual |
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coodinate system of physical space. The difference is whether we take into account the image Direction or not. The flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. The default value of this flag is On.
|
static |
New macro for creation of through a Smart Pointer
Reimplemented from itk::Object.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
|
private |
Mutex lock to protect modification to the reference count
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
|
protectedvirtual |
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::InterpolateImageFunction< TImageType, TCoordRep >.
|
private |
Determines the weights for the derivative portion of the value x
|
virtual |
Set the input image. This must be set by the user.
Reimplemented from itk::ImageFunction< TImageType, NumericTraits< TImageType::PixelType >::RealType, TCoordRep >.
Reimplemented in itk::BSplineResampleImageFunction< TImageType, TCoordRep >.
|
private |
Determines the weights for interpolation of the value x
void itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::SetNumberOfThreads | ( | ThreadIdType | numThreads | ) |
void itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >::SetSplineOrder | ( | unsigned int | SplineOrder | ) |
Get/Sets the Spline Order, supports 0th - 5th order splines. The default is a 3rd order spline.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coodinate system of physical space. The difference is whether we take into account the image Direction or not. The flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. The default value of this flag is On.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coodinate system of physical space. The difference is whether we take into account the image Direction or not. The flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. The default value of this flag is On.
|
virtual |
The UseImageDirection flag determines whether image derivatives are computed with respect to the image grid or with respect to the physical space. When this flag is ON the derivatives are computed with respect to the coodinate system of physical space. The difference is whether we take into account the image Direction or not. The flag ON will take into account the image direction and will result in an extra matrix multiplication compared to the amount of computation performed when the flag is OFF. The default value of this flag is On.
|
static |
Dimension underlying input image.
Reimplemented from itk::InterpolateImageFunction< TImageType, TCoordRep >.
Definition at line 107 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 397 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 409 of file itkBSplineInterpolateImageFunction.h.
|
protected |
Definition at line 366 of file itkBSplineInterpolateImageFunction.h.
|
protected |
Definition at line 361 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 400 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 415 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 404 of file itkBSplineInterpolateImageFunction.h.
|
protected |
Definition at line 359 of file itkBSplineInterpolateImageFunction.h.
|
protected |
Definition at line 363 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 416 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 417 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 418 of file itkBSplineInterpolateImageFunction.h.
|
private |
Definition at line 413 of file itkBSplineInterpolateImageFunction.h.