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

itkBSplineResampleImageFilterBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBSplineResampleImageFilterBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:39:01 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkBSplineResampleImageFilterBase_h
00022 #define __itkBSplineResampleImageFilterBase_h
00023 
00024 #include <vector>
00025 
00026 #include "itkImageLinearIteratorWithIndex.h"
00027 #include "itkImageLinearConstIteratorWithIndex.h"
00028 #include "itkImageRegionIterator.h"   // Used for the output iterator needs to match filter program
00029 
00030 
00031 #include "itkImageToImageFilter.h"
00032 
00033 namespace itk
00034 {
00074 template <class TInputImage, class TOutputImage>
00075 class ITK_EXPORT BSplineResampleImageFilterBase : 
00076   public ImageToImageFilter<TInputImage,TOutputImage>  
00077 {
00078 
00079 public:
00081   typedef BSplineResampleImageFilterBase       Self;
00082   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00083   typedef SmartPointer<Self>                    Pointer;
00084   typedef SmartPointer<const Self>              ConstPointer;
00085 
00087   itkTypeMacro(BSplineResampleImageFilterBase, ImageToImageFilter);
00088 
00089  
00091   //  Must be sustantiated through another class. itkNewMacro( Self );
00092 
00094   typedef typename Superclass::InputImageType InputImageType;
00095 
00097   itkStaticConstMacro(ImageDimension, unsigned int,
00098                       TInputImage::ImageDimension);
00099 
00101   typedef typename TInputImage::IndexType IndexType;
00102 
00104   typedef typename TInputImage::SizeType SizeType;
00105 
00107   typedef typename TInputImage::RegionType RegionType;
00108 
00110   typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
00111 
00113   typedef itk::ImageLinearConstIteratorWithIndex<TInputImage> ConstInputImageIterator;
00114 
00116   typedef itk::ImageLinearConstIteratorWithIndex<TOutputImage> ConstOutputImageIterator;
00117 
00119   typedef itk::ImageLinearIteratorWithIndex<TOutputImage> OutputImageIterator;
00120 
00123   void SetSplineOrder(int SplineOrder);
00124 
00126   itkGetMacro(SplineOrder, int);
00127 
00128 
00129 protected:
00131   void ReduceNDImage(OutputImageIterator &OutItr);
00132 
00134   void ExpandNDImage(OutputImageIterator &OutItr);
00135 
00138   virtual void InitializePyramidSplineFilter(int SplineOrder);
00139 
00141   virtual void Reduce1DImage( 
00142         const std::vector<double> & In, 
00143         OutputImageIterator & Iter, 
00144         unsigned int traverseSize
00145         );
00146 
00148   virtual void Expand1DImage( 
00149         const std::vector<double> & In, 
00150         OutputImageIterator & Iter, 
00151         unsigned int traverseSize
00152         );
00153 
00154   BSplineResampleImageFilterBase();
00155   virtual ~BSplineResampleImageFilterBase() {};
00156   void PrintSelf(std::ostream& os, Indent indent) const;
00157 
00158   int                       m_SplineOrder;// User specified spline order 
00159   int                       m_gSize;      // downsampling filter size
00160   int                       m_hSize;      // upsampling filter size
00161   std::vector<double>       m_g;          // downsampling filter coefficients
00162   std::vector<double>       m_h;          // upsampling filter coefficients
00163 
00164 private:
00165 
00166   // Resizes m_Scratch Variable based on image sizes
00167   void InitializeScratch(SizeType DataLength);
00168 
00169   // Copies a line of data from the input to the m_Scratch for subsequent processing
00170   void CopyInputLineToScratch(ConstInputImageIterator & Iter);
00171   void CopyOutputLineToScratch(ConstOutputImageIterator & Iter);
00172   void CopyLineToScratch(ConstInputImageIterator & Iter);
00173 
00174 
00175   std::vector<double>       m_Scratch;        // temp storage for processing of Coefficients
00176 
00177   BSplineResampleImageFilterBase( const Self& ); //purposely not implemented
00178   void operator=( const Self& ); //purposely not implemented
00179   
00180 };
00181 
00182 } // namespace itk
00183 
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "itkBSplineResampleImageFilterBase.txx"
00186 #endif
00187 
00188 #endif

Generated at Fri May 21 01:14:30 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000