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: 2010-03-19 07:06:01 $
00007   Version:   $Revision: 1.12 $
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 
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);
00095 
00097   typedef ImageLinearIteratorWithIndex<TOutputImage> OutputLinearIterator;
00098 
00101   void SetSplineOrder(unsigned int SplineOrder);
00102   itkGetConstMacro(SplineOrder, int);
00104 
00105 #ifdef ITK_USE_CONCEPT_CHECKING
00106 
00107   itkConceptMacro(DimensionCheck,
00108     (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00109   itkConceptMacro(InputConvertibleToOutputCheck,
00110      (Concept::Convertible<typename TInputImage::PixelType,
00111                            typename TOutputImage::PixelType>));
00112   itkConceptMacro(DoubleConvertibleToOutputCheck,
00113     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00114 
00116 #endif
00117 
00118 protected:
00119   BSplineDecompositionImageFilter();
00120   virtual ~BSplineDecompositionImageFilter() {};
00121   void PrintSelf(std::ostream& os, Indent indent) const;
00122 
00123   void GenerateData( );
00124 
00126   void GenerateInputRequestedRegion();
00127 
00129   void EnlargeOutputRequestedRegion( DataObject *output ); 
00130 
00132   std::vector<CoeffType>           m_Scratch;       // temp storage for processing of Coefficients
00133   typename TInputImage::SizeType   m_DataLength;  // Image size
00134 
00135   unsigned int              m_SplineOrder;   // User specified spline order (3rd or cubic is the default)
00136   double                    m_SplinePoles[3];// Poles calculated for a given spline order
00137   int                       m_NumberOfPoles; // number of poles
00138   double                    m_Tolerance;     // Tolerance used for determining initial causal coefficient
00139   unsigned int              m_IteratorDirection; // Direction for iterator incrementing
00140 
00141 
00142 private:
00143   BSplineDecompositionImageFilter( const Self& ); //purposely not implemented
00144   void operator=( const Self& ); //purposely not implemented
00145 
00147   virtual void SetPoles();
00148 
00150   virtual bool DataToCoefficients1D();
00151 
00154   void DataToCoefficientsND();
00155 
00157   virtual void SetInitialCausalCoefficient(double z);
00158 
00160   virtual void SetInitialAntiCausalCoefficient(double z);
00161 
00163   void CopyImageToImage();
00164 
00166   void CopyCoefficientsToScratch( OutputLinearIterator & );
00167 
00169   void CopyScratchToCoefficients( OutputLinearIterator & );
00170 
00171 };
00172 
00173 
00174 } // namespace itk
00175 
00176 #ifndef ITK_MANUAL_INSTANTIATION
00177 #include "itkBSplineDecompositionImageFilter.txx"
00178 #endif
00179 
00180 #endif
00181 

Generated at Mon Jul 12 2010 17:58:23 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000