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

itkDerivativeOperator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkDerivativeOperator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-07 09:09:39 $
00007   Version:   $Revision: 1.22 $
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      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 __itkDerivativeOperator_h
00018 #define __itkDerivativeOperator_h
00019 
00020 #include "itkExceptionObject.h"
00021 #include "itkNeighborhoodOperator.h"
00022 
00023 namespace itk {
00024 
00043 template<class TPixel, unsigned int VDimension=2,
00044   class TAllocator = NeighborhoodAllocator<TPixel> >
00045 class ITK_EXPORT DerivativeOperator
00046   : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
00047 {
00048 
00049 public:
00051   typedef DerivativeOperator                  Self;
00052   typedef NeighborhoodOperator<
00053     TPixel, VDimension, TAllocator>           Superclass;
00054 
00055   typedef typename Superclass::PixelType      PixelType;
00056   typedef typename Superclass::PixelRealType  PixelRealType;
00057 
00059   DerivativeOperator() : m_Order(1) {}
00060 
00062   DerivativeOperator(const Self& other)
00063     : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00064   { m_Order = other.m_Order;  }
00065 
00067   Self &operator=(const Self& other)
00068   {
00069     Superclass::operator=(other);
00070     m_Order = other.m_Order;
00071     return *this;
00072   }
00074 
00076   void SetOrder(const unsigned int &order)
00077     {  
00078     this->m_Order = order;
00079     }
00080 
00082   unsigned int GetOrder() const { return m_Order; }
00083 
00085   virtual void PrintSelf(std::ostream &os, Indent i) const  
00086     { 
00087     os << i << "DerivativeOperator { this=" << this
00088        << ", m_Order = " << m_Order << "}" << std::endl;
00089     Superclass::PrintSelf(os, i.GetNextIndent());
00090     }
00092 
00093 protected:
00096   typedef typename Superclass::CoefficientVector CoefficientVector;
00097 
00099   CoefficientVector GenerateCoefficients();
00100 
00102   void Fill(const CoefficientVector &coeff)
00103   {   Superclass::FillCenteredDirectional(coeff);  }
00104 
00105 private:
00107   unsigned int m_Order;
00108 };
00109 
00110 } // namespace itk
00111 
00112 // Define instantiation macro for this template.
00113 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, x, y) namespace itk { \
00114   _(2(class EXPORT DerivativeOperator< ITK_TEMPLATE_2 x >)) \
00115   namespace Templates { typedef DerivativeOperator< ITK_TEMPLATE_2 x > \
00116                                                   DerivativeOperator##y; } \
00117   }
00118 
00119 #if ITK_TEMPLATE_EXPLICIT
00120 # include "Templates/itkDerivativeOperator+-.h"
00121 #endif
00122 
00123 #if ITK_TEMPLATE_TXX
00124 # include "itkDerivativeOperator.txx"
00125 #endif
00126 
00127 #endif
00128 

Generated at Tue Sep 15 02:47:29 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000