00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkRecursiveSeparableImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/02/26 23:20:31 $ 00007 Version: $Revision: 1.16 $ 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 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkRecursiveSeparableImageFilter_h 00018 #define __itkRecursiveSeparableImageFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkNumericTraits.h" 00022 00023 namespace itk 00024 { 00025 00038 template <typename TInputImage, typename TOutputImage=TInputImage> 00039 class ITK_EXPORT RecursiveSeparableImageFilter : 00040 public ImageToImageFilter<TInputImage,TOutputImage> 00041 { 00042 public: 00044 typedef RecursiveSeparableImageFilter Self; 00045 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass; 00046 typedef SmartPointer<Self> Pointer; 00047 typedef SmartPointer<const Self> ConstPointer; 00048 00050 itkTypeMacro( RecursiveSeparableImageFilter, ImageToImageFilter ); 00051 00053 typedef typename TInputImage::Pointer InputImagePointer; 00054 typedef typename TInputImage::ConstPointer InputImageConstPointer; 00055 00057 typedef typename TInputImage::PixelType InputPixelType; 00058 typedef typename NumericTraits<InputPixelType>::RealType RealType; 00059 00061 typedef TInputImage InputImageType; 00062 00064 typedef TOutputImage OutputImageType; 00065 00067 itkGetMacro(Direction, unsigned int); 00068 00070 itkSetMacro(Direction, unsigned int); 00071 00073 void SetInputImage( const TInputImage * ); 00074 00076 const TInputImage * GetInputImage( void ); 00077 00083 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError); 00084 00085 protected: 00086 RecursiveSeparableImageFilter(); 00087 virtual ~RecursiveSeparableImageFilter() {}; 00088 void PrintSelf(std::ostream& os, Indent indent) const; 00089 00091 void GenerateData(void); 00092 00093 // Override since the filter produces the entire dataset 00094 void EnlargeOutputRequestedRegion(DataObject *output); 00095 00099 virtual void SetUp(void) = 0; 00100 00105 void ApplyRecursiveFilter(unsigned int dimension); 00106 00112 virtual void ComputeFilterCoefficients(bool symmetric) = 0; 00113 00117 void FilterDataArray(RealType *outs, 00118 const RealType *data, unsigned int ln); 00119 00120 private: 00121 RecursiveSeparableImageFilter(const Self&); //purposely not implemented 00122 void operator=(const Self&); //purposely not implemented 00123 00126 unsigned int m_Direction; 00127 00128 protected: 00130 RealType m_K; 00131 00133 RealType m_Spacing; 00134 00136 RealType m_A0; 00137 RealType m_A1; 00138 RealType m_B0; 00139 RealType m_B1; 00140 RealType m_C0; 00141 RealType m_C1; 00142 RealType m_W0; 00143 RealType m_W1; 00144 00146 RealType m_N00; 00147 RealType m_N11; 00148 RealType m_N22; 00149 RealType m_N33; 00150 00153 RealType m_D11; 00154 RealType m_D22; 00155 RealType m_D33; 00156 RealType m_D44; 00157 00159 RealType m_M11; 00160 RealType m_M22; 00161 RealType m_M33; 00162 RealType m_M44; 00163 00165 RealType m_BN1; 00166 RealType m_BN2; 00167 RealType m_BN3; 00168 RealType m_BN4; 00169 00170 RealType m_BM1; 00171 RealType m_BM2; 00172 RealType m_BM3; 00173 RealType m_BM4; 00174 00175 }; 00176 00177 00178 } // end namespace itk 00179 00180 #ifndef ITK_MANUAL_INSTANTIATION 00181 #include "itkRecursiveSeparableImageFilter.txx" 00182 #endif 00183 00184 00185 #endif