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: 2003/09/10 14:28:44 $ 00007 Version: $Revision: 1.5 $ 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 __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 #include "itkProgressReporter.h" 00030 #include "itkImageToImageFilter.h" 00031 00032 namespace itk 00033 { 00073 template <class TInputImage, class TOutputImage> 00074 class ITK_EXPORT BSplineResampleImageFilterBase : 00075 public ImageToImageFilter<TInputImage,TOutputImage> 00076 { 00077 00078 public: 00080 typedef BSplineResampleImageFilterBase Self; 00081 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass; 00082 typedef SmartPointer<Self> Pointer; 00083 typedef SmartPointer<const Self> ConstPointer; 00084 00086 itkTypeMacro(BSplineResampleImageFilterBase, ImageToImageFilter); 00087 00088 00090 // Must be sustantiated through another class. itkNewMacro( Self ); 00091 00093 typedef typename Superclass::InputImageType InputImageType; 00094 00096 itkStaticConstMacro(ImageDimension, unsigned int, 00097 TInputImage::ImageDimension); 00098 00100 typedef typename TInputImage::IndexType IndexType; 00101 00103 typedef typename TInputImage::SizeType SizeType; 00104 00106 typedef typename TInputImage::RegionType RegionType; 00107 00109 typedef typename Superclass::OutputImagePixelType OutputImagePixelType; 00110 00112 typedef itk::ImageLinearConstIteratorWithIndex<TInputImage> ConstInputImageIterator; 00113 00115 typedef itk::ImageLinearConstIteratorWithIndex<TOutputImage> ConstOutputImageIterator; 00116 00118 typedef itk::ImageLinearIteratorWithIndex<TOutputImage> OutputImageIterator; 00119 00122 void SetSplineOrder(int SplineOrder); 00123 00125 itkGetMacro(SplineOrder, int); 00126 00127 00128 protected: 00130 void ReduceNDImage(OutputImageIterator &OutItr); 00131 00133 void ExpandNDImage(OutputImageIterator &OutItr); 00134 00137 virtual void InitializePyramidSplineFilter(int SplineOrder); 00138 00140 virtual void Reduce1DImage( 00141 const std::vector<double> & In, 00142 OutputImageIterator & Iter, 00143 unsigned int traverseSize, 00144 ProgressReporter &progress 00145 ); 00146 00148 virtual void Expand1DImage( 00149 const std::vector<double> & In, 00150 OutputImageIterator & Iter, 00151 unsigned int traverseSize, 00152 ProgressReporter &progress 00153 ); 00154 00155 BSplineResampleImageFilterBase(); 00156 virtual ~BSplineResampleImageFilterBase() {}; 00157 void PrintSelf(std::ostream& os, Indent indent) const; 00158 00159 int m_SplineOrder;// User specified spline order 00160 int m_gSize; // downsampling filter size 00161 int m_hSize; // upsampling filter size 00162 std::vector<double> m_g; // downsampling filter coefficients 00163 std::vector<double> m_h; // upsampling filter coefficients 00164 00165 private: 00166 00167 // Resizes m_Scratch Variable based on image sizes 00168 void InitializeScratch(SizeType DataLength); 00169 00170 // Copies a line of data from the input to the m_Scratch for subsequent processing 00171 void CopyInputLineToScratch(ConstInputImageIterator & Iter); 00172 void CopyOutputLineToScratch(ConstOutputImageIterator & Iter); 00173 void CopyLineToScratch(ConstInputImageIterator & Iter); 00174 00175 00176 std::vector<double> m_Scratch; // temp storage for processing of Coefficients 00177 00178 BSplineResampleImageFilterBase( const Self& ); //purposely not implemented 00179 void operator=( const Self& ); //purposely not implemented 00180 00181 }; 00182 00183 } // namespace itk 00184 00185 #ifndef ITK_MANUAL_INSTANTIATION 00186 #include "itkBSplineResampleImageFilterBase.txx" 00187 #endif 00188 00189 #endif

Generated at Sat Mar 31 02:15:20 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000