ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRecursiveSeparableImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkRecursiveSeparableImageFilter_h
00019 #define __itkRecursiveSeparableImageFilter_h
00020 
00021 #include "itkInPlaceImageFilter.h"
00022 #include "itkNumericTraits.h"
00023 
00024 namespace itk
00025 {
00049 template< typename TInputImage, typename TOutputImage = TInputImage >
00050 class ITK_EXPORT RecursiveSeparableImageFilter:
00051   public InPlaceImageFilter< TInputImage, TOutputImage >
00052 {
00053 public:
00055   typedef RecursiveSeparableImageFilter                   Self;
00056   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00057   typedef SmartPointer< Self >                            Pointer;
00058   typedef SmartPointer< const Self >                      ConstPointer;
00059 
00061   itkTypeMacro(RecursiveSeparableImageFilter, ImageToImageFilter);
00062 
00064   typedef typename TInputImage::Pointer      InputImagePointer;
00065   typedef typename TInputImage::ConstPointer InputImageConstPointer;
00066 
00072   typedef typename TInputImage::PixelType                          InputPixelType;
00073   typedef typename NumericTraits< InputPixelType >::RealType       RealType;
00074   typedef typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType;
00075 
00076   typedef typename TOutputImage::RegionType OutputImageRegionType;
00077 
00079   typedef TInputImage InputImageType;
00080 
00082   typedef TOutputImage OutputImageType;
00083 
00085   itkGetConstMacro(Direction, unsigned int);
00086 
00088   itkSetMacro(Direction, unsigned int);
00089 
00091   void SetInputImage(const TInputImage *);
00092 
00094   const TInputImage * GetInputImage(void);
00095 
00096 protected:
00097   RecursiveSeparableImageFilter();
00098   virtual ~RecursiveSeparableImageFilter() {}
00099   void PrintSelf(std::ostream & os, Indent indent) const;
00100 
00102   void BeforeThreadedGenerateData();
00103 
00104   void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId);
00105 
00106   unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion);
00107 
00116   void EnlargeOutputRequestedRegion(DataObject *output);
00117 
00122   virtual void SetUp(ScalarRealType spacing) = 0;
00123 
00130   void FilterDataArray(RealType *outs, const RealType *data, RealType *scratch,
00131                        unsigned int ln);
00132 
00133 protected:
00135   ScalarRealType m_N0;
00136   ScalarRealType m_N1;
00137   ScalarRealType m_N2;
00138   ScalarRealType m_N3;
00139 
00143   ScalarRealType m_D1;
00144   ScalarRealType m_D2;
00145   ScalarRealType m_D3;
00146   ScalarRealType m_D4;
00147 
00149   ScalarRealType m_M1;
00150   ScalarRealType m_M2;
00151   ScalarRealType m_M3;
00152   ScalarRealType m_M4;
00153 
00156   ScalarRealType m_BN1;
00157   ScalarRealType m_BN2;
00158   ScalarRealType m_BN3;
00159   ScalarRealType m_BN4;
00160 
00161   ScalarRealType m_BM1;
00162   ScalarRealType m_BM2;
00163   ScalarRealType m_BM3;
00164   ScalarRealType m_BM4;
00165 private:
00166   RecursiveSeparableImageFilter(const Self &); //purposely not implemented
00167   void operator=(const Self &);                //purposely not implemented
00168 
00171   unsigned int m_Direction;
00172 };
00173 } // end namespace itk
00174 
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkRecursiveSeparableImageFilter.hxx"
00177 #endif
00178 
00179 #endif
00180