Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkBSplineDecompositionImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBSplineDecompositionImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-25 12:27:05 $
00007   Version:   $Revision: 1.11 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
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   itkStaticConstMacro(OutputImageDimension, unsigned int,
00091                       TOutputImage::ImageDimension);
00093 
00095   typedef ImageLinearIteratorWithIndex<TOutputImage> OutputLinearIterator;
00096 
00099   void SetSplineOrder(unsigned int SplineOrder);
00100   itkGetConstMacro(SplineOrder, int);
00102 
00103 #ifdef ITK_USE_CONCEPT_CHECKING
00104 
00105   itkConceptMacro(DimensionCheck,
00106     (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00107   itkConceptMacro(InputConvertibleToDoubleCheck,
00108     (Concept::Convertible<typename TInputImage::PixelType, double>));
00109   itkConceptMacro(OutputConvertibleToDoubleCheck,
00110     (Concept::Convertible<typename TOutputImage::PixelType, double>));
00111   itkConceptMacro(InputConvertibleToOutputCheck,
00112      (Concept::Convertible<typename TInputImage::PixelType,
00113                            typename TOutputImage::PixelType>));
00114   itkConceptMacro(DoubleConvertibleToOutputCheck,
00115     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00116 
00118 #endif
00119 
00120 protected:
00121   BSplineDecompositionImageFilter();
00122   virtual ~BSplineDecompositionImageFilter() {};
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<double>              m_Scratch;       // temp storage for processing of Coefficients
00135   typename TInputImage::SizeType   m_DataLength;  // Image size
00136 
00137   unsigned int              m_SplineOrder;   // User specified spline order (3rd or cubic is the default)
00138   double                    m_SplinePoles[3];// Poles calculated for a given spline order
00139   int                       m_NumberOfPoles; // number of poles
00140   double                    m_Tolerance;     // Tolerance used for determining initial causal coefficient
00141   unsigned int              m_IteratorDirection; // Direction for iterator incrementing
00142 
00143 
00144 private:
00145   BSplineDecompositionImageFilter( const Self& ); //purposely not implemented
00146   void operator=( const Self& ); //purposely not implemented
00147 
00149   virtual void SetPoles();
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 } // namespace itk
00177 
00178 #ifndef ITK_MANUAL_INSTANTIATION
00179 #include "itkBSplineDecompositionImageFilter.txx"
00180 #endif
00181 
00182 #endif
00183 

Generated at Tue Sep 15 02:27:04 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000