template<typename TImageType, typename TCoordRep = double, typename TCoefficientType = double>
class itk::BSplineInterpolateImageFunction< TImageType, TCoordRep, TCoefficientType >
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.
- See Also
- BSplineDecompositionImageFilter
- Wiki Examples:
-
- Examples:
- Examples/Filtering/ResampleImageFilter7.cxx, and WikiExamples/ImageProcessing/Upsampling.cxx.
Definition at line 84 of file itkBSplineInterpolateImageFunction.h.
|
using | CoefficientDataType = TCoefficientType |
|
using | CoefficientFilter = BSplineDecompositionImageFilter< TImageType, CoefficientImageType > |
|
using | CoefficientFilterPointer = typename CoefficientFilter::Pointer |
|
using | CoefficientImageType = Image< CoefficientDataType, Self::ImageDimension > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | ContinuousIndexType = typename Superclass::ContinuousIndexType |
|
using | CovariantVectorType = CovariantVector< OutputType, Self::ImageDimension > |
|
using | IndexType = typename Superclass::IndexType |
|
using | InputImageType = typename Superclass::InputImageType |
|
using | Iterator = ImageLinearIteratorWithIndex< TImageType > |
|
using | OutputType = typename Superclass::OutputType |
|
using | Pointer = SmartPointer< Self > |
|
using | PointType = typename Superclass::PointType |
|
using | Self = BSplineInterpolateImageFunction |
|
using | Superclass = InterpolateImageFunction< TImageType, TCoordRep > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | ContinuousIndexType = typename Superclass::ContinuousIndexType |
|
using | IndexType = typename Superclass::IndexType |
|
using | IndexValueType = typename Superclass::IndexValueType |
|
using | InputImageType = typename Superclass::InputImageType |
|
using | OutputType = typename Superclass::OutputType |
|
using | Pointer = SmartPointer< Self > |
|
using | PointType = typename Superclass::PointType |
|
using | RealType = typename NumericTraits< typename TImageType::PixelType >::RealType |
|
using | Self = InterpolateImageFunction |
|
using | Superclass = ImageFunction< TImageType, typename NumericTraits< typename TImageType::PixelType >::RealType, TCoordRep > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | ContinuousIndexType = ContinuousIndex< TCoordRep, Self::ImageDimension > |
|
using | CoordRepType = TCoordRep |
|
using | IndexType = typename InputImageType::IndexType |
|
using | IndexValueType = typename InputImageType::IndexValueType |
|
using | InputImageConstPointer = typename InputImageType::ConstPointer |
|
using | InputImageType = TImageType |
|
using | InputPixelType = typename InputImageType::PixelType |
|
using | OutputType = NumericTraits< TImageType::PixelType >::RealType |
|
using | Pointer = SmartPointer< Self > |
|
using | PointType = Point< TCoordRep, Self::ImageDimension > |
|
using | Self = ImageFunction |
|
using | Superclass = FunctionBase< Point< TCoordRep, Self::ImageDimension >, NumericTraits< TImageType::PixelType >::RealType > |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | InputType = Point< TCoordRep, TImageType::ImageDimension > |
|
using | OutputType = NumericTraits< TImageType::PixelType >::RealType |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = FunctionBase |
|
using | Superclass = Object |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = Object |
|
using | Superclass = LightObject |
|
using | ConstPointer = SmartPointer< const Self > |
|
using | Pointer = SmartPointer< Self > |
|
using | Self = LightObject |
|
|
virtual ::itk::LightObject::Pointer | CreateAnother () const |
|
OutputType | Evaluate (const PointType &point) const override |
|
virtual OutputType | Evaluate (const PointType &point, ThreadIdType threadId) const |
|
OutputType | EvaluateAtContinuousIndex (const ContinuousIndexType &index) const override |
|
virtual OutputType | EvaluateAtContinuousIndex (const ContinuousIndexType &index, ThreadIdType threadId) const |
|
CovariantVectorType | EvaluateDerivative (const PointType &point) const |
|
CovariantVectorType | EvaluateDerivative (const PointType &point, ThreadIdType threadId) const |
|
CovariantVectorType | EvaluateDerivativeAtContinuousIndex (const ContinuousIndexType &x) const |
|
CovariantVectorType | EvaluateDerivativeAtContinuousIndex (const ContinuousIndexType &x, ThreadIdType threadId) const |
|
void | EvaluateValueAndDerivative (const PointType &point, OutputType &value, CovariantVectorType &deriv) const |
|
void | EvaluateValueAndDerivative (const PointType &point, OutputType &value, CovariantVectorType &deriv, ThreadIdType threadId) const |
|
void | EvaluateValueAndDerivativeAtContinuousIndex (const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const |
|
void | EvaluateValueAndDerivativeAtContinuousIndex (const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv, ThreadIdType threadId) const |
|
virtual const char * | GetNameOfClass () const |
|
virtual ThreadIdType | GetNumberOfWorkUnits () const |
|
virtual int | GetSplineOrder () const |
|
void | SetInputImage (const TImageType *inputData) override |
|
void | SetNumberOfWorkUnits (ThreadIdType numThreads) |
|
void | SetSplineOrder (unsigned int SplineOrder) |
|
|
virtual void | SetUseImageDirection (bool _arg) |
|
virtual bool | GetUseImageDirection () const |
|
virtual void | UseImageDirectionOn () |
|
virtual void | UseImageDirectionOff () |
|
OutputType | Evaluate (const PointType &point) const override |
|
OutputType | EvaluateAtContinuousIndex (const ContinuousIndexType &index) const override=0 |
|
OutputType | EvaluateAtIndex (const IndexType &index) const override |
|
void | ConvertContinuousIndexToNearestIndex (const ContinuousIndexType &cindex, IndexType &index) const |
|
void | ConvertPointToContinuousIndex (const PointType &point, ContinuousIndexType &cindex) const |
|
void | ConvertPointToNearestIndex (const PointType &point, IndexType &index) const |
|
virtual const ContinuousIndexType & | GetEndContinuousIndex () const |
|
virtual const IndexType & | GetEndIndex () const |
|
const InputImageType * | GetInputImage () const |
|
virtual const ContinuousIndexType & | GetStartContinuousIndex () const |
|
virtual const IndexType & | GetStartIndex () const |
|
virtual bool | IsInsideBuffer (const IndexType &index) const |
|
virtual bool | IsInsideBuffer (const ContinuousIndexType &index) const |
|
virtual bool | IsInsideBuffer (const PointType &point) const |
|
unsigned long | AddObserver (const EventObject &event, Command *) |
|
unsigned long | AddObserver (const EventObject &event, Command *) 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) |
|
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 |
|
virtual void | Delete () |
|
virtual int | GetReferenceCount () const |
|
| itkCloneMacro (Self) |
|
void | Print (std::ostream &os, Indent indent=0) const |
|
|
| BSplineInterpolateImageFunction () |
|
virtual OutputType | EvaluateAtContinuousIndexInternal (const ContinuousIndexType &index, vnl_matrix< long > &evaluateIndex, vnl_matrix< double > &weights) const |
|
virtual CovariantVectorType | EvaluateDerivativeAtContinuousIndexInternal (const ContinuousIndexType &x, vnl_matrix< long > &evaluateIndex, vnl_matrix< double > &weights, vnl_matrix< double > &weightsDerivative) const |
|
virtual void | EvaluateValueAndDerivativeAtContinuousIndexInternal (const ContinuousIndexType &x, OutputType &value, CovariantVectorType &derivativeValue, vnl_matrix< long > &evaluateIndex, vnl_matrix< double > &weights, vnl_matrix< double > &weightsDerivative) const |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~BSplineInterpolateImageFunction () override |
|
| InterpolateImageFunction ()=default |
|
void | PrintSelf (std::ostream &os, Indent indent) const override |
|
| ~InterpolateImageFunction () override=default |
|
| ImageFunction () |
|
| ~ImageFunction () override=default |
|
| FunctionBase ()=default |
|
| ~FunctionBase () override=default |
|
| Object () |
|
bool | PrintObservers (std::ostream &os, Indent indent) const |
|
virtual void | SetTimeStamp (const TimeStamp &time) |
|
| ~Object () override |
|
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 () |
|
template<typename TImageType, typename TCoordRep = double, typename TCoefficientType = double>
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.