00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __itkBSplineDecompositionImageFilter_h
00022 #define __itkBSplineDecompositionImageFilter_h
00023
00024 #include <vector>
00025
00026 #include "itkImageLinearIteratorWithIndex.h"
00027 #include "vnl/vnl_matrix.h"
00028
00029 #include "itkImageToImageFilter.h"
00030
00031 namespace itk
00032 {
00065 template <class TInputImage, class TOutputImage>
00066 class ITK_EXPORT BSplineDecompositionImageFilter :
00067 public ImageToImageFilter<TInputImage,TOutputImage>
00068 {
00069 public:
00071 typedef BSplineDecompositionImageFilter Self;
00072 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00077 itkTypeMacro(BSplineDecompositionImageFilter, ImageToImageFilter);
00078
00080 itkNewMacro( Self );
00081
00083 typedef typename Superclass::InputImageType InputImageType;
00084 typedef typename Superclass::InputImagePointer InputImagePointer;
00085 typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00086 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00087
00089 itkStaticConstMacro(ImageDimension, unsigned int,TInputImage::ImageDimension);
00090
00092 typedef itk::ImageLinearIteratorWithIndex<TOutputImage> OutputLinearIterator;
00093
00096 void SetSplineOrder(unsigned int SplineOrder);
00097 itkGetMacro(SplineOrder, int);
00098
00099
00100 protected:
00101 BSplineDecompositionImageFilter();
00102 virtual ~BSplineDecompositionImageFilter() {};
00103 void PrintSelf(std::ostream& os, Indent indent) const;
00104
00105 void GenerateData( );
00106
00108 void GenerateInputRequestedRegion();
00109
00111 void EnlargeOutputRequestedRegion( DataObject *output );
00112
00114 std::vector<double> m_Scratch;
00115 typename TInputImage::SizeType m_DataLength;
00116 unsigned int m_SplineOrder;
00117 double m_SplinePoles[3];
00118 int m_NumberOfPoles;
00119 double m_Tolerance;
00120 unsigned int m_IteratorDirection;
00121
00122
00123 private:
00124 BSplineDecompositionImageFilter( const Self& );
00125 void operator=( const Self& );
00126
00128 virtual void SetPoles();
00129
00131 virtual bool DataToCoefficients1D();
00132
00135 void DataToCoefficientsND();
00136
00138 virtual void SetInitialCausalCoefficient(double z);
00139
00141 virtual void SetInitialAntiCausalCoefficient(double z);
00142
00144 void CopyImageToImage();
00145
00147 void CopyCoefficientsToScratch( OutputLinearIterator & );
00148
00150 void CopyScratchToCoefficients( OutputLinearIterator & );
00151
00152 };
00153
00154
00155 }
00156
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkBSplineDecompositionImageFilter.txx"
00159 #endif
00160
00161 #endif
00162