Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __itkMultiOrderBSplineDecompositionImageFilter_h
00022 #define __itkMultiOrderBSplineDecompositionImageFilter_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 MultiOrderBSplineDecompositionImageFilter :
00067 public ImageToImageFilter<TInputImage,TOutputImage>
00068 {
00069 public:
00071 typedef MultiOrderBSplineDecompositionImageFilter Self;
00072 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00077 itkTypeMacro(MultiOrderBSplineDecompositionImageFilter, 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
00088 typedef typename itk::NumericTraits<typename TOutputImage::PixelType>::RealType CoeffType;
00089
00091 itkStaticConstMacro(ImageDimension, unsigned int,TInputImage::ImageDimension);
00092 itkStaticConstMacro(OutputImageDimension, unsigned int,
00093 TOutputImage::ImageDimension);
00094
00096 typedef ImageLinearIteratorWithIndex<TOutputImage> OutputLinearIterator;
00097
00100 void SetSplineOrder( unsigned int order );
00101 void SetSplineOrder( unsigned int dimension, unsigned int order );
00102 void GetSplineOrder( unsigned int dimension )
00103 {
00104 return m_SplineOrder[ dimension ];
00105 }
00106
00107
00108 #ifdef ITK_USE_CONCEPT_CHECKING
00109
00110 itkConceptMacro(DimensionCheck,
00111 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00112 itkConceptMacro(InputConvertibleToOutputCheck,
00113 (Concept::Convertible<typename TInputImage::PixelType,
00114 typename TOutputImage::PixelType>));
00115 itkConceptMacro(DoubleConvertibleToOutputCheck,
00116 (Concept::Convertible<double, typename TOutputImage::PixelType>));
00118 #endif
00119
00120 protected:
00121 MultiOrderBSplineDecompositionImageFilter();
00122 virtual ~MultiOrderBSplineDecompositionImageFilter() {};
00123 void PrintSelf(std::ostream& os, Indent indent) const;
00124
00125 void GenerateData( );
00126
00128 void GenerateInputRequestedRegion();
00129
00131 void EnlargeOutputRequestedRegion( DataObject *output );
00132
00134 std::vector<CoeffType> m_Scratch;
00135 typename TInputImage::SizeType m_DataLength;
00136
00137 unsigned int m_SplineOrder[ImageDimension];
00138 double m_SplinePoles[3];
00139 int m_NumberOfPoles;
00140 double m_Tolerance;
00141 unsigned int m_IteratorDirection;
00142
00143
00144 private:
00145 MultiOrderBSplineDecompositionImageFilter( const Self& );
00146 void operator=( const Self& );
00147
00149 virtual void SetPoles( unsigned int dimension );
00150
00152 virtual bool DataToCoefficients1D();
00153
00156 void DataToCoefficientsND();
00157
00159 virtual void SetInitialCausalCoefficient(double z);
00160
00162 virtual void SetInitialAntiCausalCoefficient(double z);
00163
00165 void CopyImageToImage();
00166
00168 void CopyCoefficientsToScratch( OutputLinearIterator & );
00169
00171 void CopyScratchToCoefficients( OutputLinearIterator & );
00172
00173 };
00174
00175
00176 }
00177
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkMultiOrderBSplineDecompositionImageFilter.txx"
00180 #endif
00181
00182 #endif