| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkVectorLinearInterpolateImageFunction.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:49 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
DEF |
#ifndef _itkVectorLinearInterpolateImageFunction_h |
| 18 |
DEF |
#define _itkVectorLinearInterpolateImageFunction_h |
| 19 |
|
|
| 20 |
|
#include "itkVectorInterpolateImageFunction.h" |
| 21 |
|
|
| 22 |
|
namespace itk |
| 23 |
|
{ |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* \class VectorLinearInterpolateImageFunction |
| 27 |
|
* \brief Linearly interpolate a vector image at specified positions. |
| 28 |
|
* |
| 29 |
|
* VectorLinearInterpolateImageFunction linearly interpolates a vector |
| 30 |
|
* image intensity non-integer pixel position. This class is templated |
| 31 |
|
* over the input image type and the coordinate representation type. |
| 32 |
|
* |
| 33 |
|
* This function works for N-dimensional images. |
| 34 |
|
* |
| 35 |
|
* \warning This function work only for Vector images. For |
| 36 |
|
* scalar images use LinearInterpolateImageFunction. |
| 37 |
|
* |
| 38 |
|
* \ingroup ImageFunctions ImageInterpolators |
| 39 |
|
* |
| 40 |
|
*/ |
| 41 |
|
template <class TInputImage, class TCoordRep = float> |
| 42 |
|
class ITK_EXPORT VectorLinearInterpolateImageFunction : |
| 43 |
IND |
**public VectorInterpolateImageFunction<TInputImage,TCoordRep> |
| 44 |
|
{ |
| 45 |
|
public: |
| 46 |
|
/** Standard class typedefs. */ |
| 47 |
|
typedef VectorLinearInterpolateImageFunction Self; |
| 48 |
TDA |
typedef VectorInterpolateImageFunction<TInputImage,TCoordRep> Superclass; |
| 49 |
TDA |
typedef SmartPointer<Self> Pointer; |
| 50 |
TDA |
typedef SmartPointer<const Self> ConstPointer; |
| 51 |
|
|
| 52 |
|
/** Method for creation through the object factory. */ |
| 53 |
|
itkNewMacro(Self); |
| 54 |
|
|
| 55 |
|
/** Run-time type information (and related methods). */ |
| 56 |
|
itkTypeMacro(VectorLinearInterpolateImageFunction, |
| 57 |
|
VectorInterpolateImageFunction); |
| 58 |
|
|
| 59 |
|
/** InputImageType typedef support. */ |
| 60 |
|
typedef typename Superclass::InputImageType InputImageType; |
| 61 |
|
typedef typename Superclass::PixelType PixelType; |
| 62 |
|
typedef typename Superclass::ValueType ValueType; |
| 63 |
|
typedef typename Superclass::RealType RealType; |
| 64 |
|
|
| 65 |
|
/** Grab the vector dimension from the superclass. */ |
| 66 |
|
itkStaticConstMacro(Dimension, unsigned int, |
| 67 |
|
Superclass::Dimension); |
| 68 |
|
|
| 69 |
|
/** Dimension underlying input image. */ |
| 70 |
|
itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension); |
| 71 |
|
|
| 72 |
|
/** Index typedef support. */ |
| 73 |
|
typedef typename Superclass::IndexType IndexType; |
| 74 |
|
|
| 75 |
|
/** ContinuousIndex typedef support. */ |
| 76 |
|
typedef typename Superclass::ContinuousIndexType ContinuousIndexType; |
| 77 |
|
|
| 78 |
|
/** Output type is Vector<double,Dimension> */ |
| 79 |
|
typedef typename Superclass::OutputType OutputType; |
| 80 |
|
|
| 81 |
|
/** Evaluate the function at a ContinuousIndex position |
| 82 |
|
* |
| 83 |
|
* Returns the linearly interpolated image intensity at a |
| 84 |
|
* specified point position. No bounds checking is done. |
| 85 |
|
* The point is assume to lie within the image buffer. |
| 86 |
|
* |
| 87 |
|
* ImageFunction::IsInsideBuffer() can be used to check bounds before |
| 88 |
|
* calling the method. */ |
| 89 |
|
virtual OutputType EvaluateAtContinuousIndex( |
| 90 |
|
const ContinuousIndexType & index ) const; |
| 91 |
|
|
| 92 |
|
protected: |
| 93 |
|
VectorLinearInterpolateImageFunction(); |
| 94 |
|
~VectorLinearInterpolateImageFunction(){}; |
| 95 |
|
void PrintSelf(std::ostream& os, Indent indent) const; |
| 96 |
|
|
| 97 |
|
private: |
| 98 |
|
VectorLinearInterpolateImageFunction(const Self&); //purposely not implemented |
| 99 |
|
void operator=(const Self&); //purposely not implemented |
| 100 |
|
|
| 101 |
|
/** Number of neighbors used in the interpolation */ |
| 102 |
|
static const unsigned long m_Neighbors; |
| 103 |
|
|
| 104 |
|
}; |
| 105 |
|
|
| 106 |
|
} // namespace itk |
| 107 |
|
|
| 108 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 109 |
|
#include "itkVectorLinearInterpolateImageFunction.txx" |
| 110 |
|
#endif |
| 111 |
|
|
| 112 |
|
#endif |
| 113 |
|
|