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-01-20 18:00:40 $
00007   Version:   $Revision: 1.21 $
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<TPixel, VDimension, TAllocator>  Superclass;
00053 
00054   typedef typename Superclass::PixelType     PixelType;
00055   typedef typename Superclass::PixelRealType PixelRealType;
00056 
00058   DerivativeOperator() : m_Order(1) {}
00059 
00061   DerivativeOperator(const Self& other)
00062     : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00063   { m_Order = other.m_Order;  }
00064 
00066   Self &operator=(const Self& other)
00067   {
00068     Superclass::operator=(other);
00069     m_Order = other.m_Order;
00070     return *this;
00071   }
00073 
00075   void SetOrder(const unsigned int &order)
00076   {  m_Order = order;  }
00077 
00079   unsigned int GetOrder() const { return m_Order; }
00080 
00082   virtual void PrintSelf(std::ostream &os, Indent i) const  
00083   { 
00084     os << i << "DerivativeOperator { this=" << this
00085        << ", m_Order = " << m_Order << "}" << std::endl;
00086     Superclass::PrintSelf(os, i.GetNextIndent());
00087   }
00089 
00090 protected:
00093   typedef typename Superclass::CoefficientVector CoefficientVector;
00094 
00096   CoefficientVector GenerateCoefficients();
00097 
00099   void Fill(const CoefficientVector &coeff)
00100   {   Superclass::FillCenteredDirectional(coeff);  }
00101 
00102 private:
00104   unsigned int m_Order;
00105 };
00106 
00107 } // namespace itk
00108 
00109 // Define instantiation macro for this template.
00110 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, x, y) namespace itk { \
00111   _(2(class EXPORT DerivativeOperator< ITK_TEMPLATE_2 x >)) \
00112   namespace Templates { typedef DerivativeOperator< ITK_TEMPLATE_2 x > \
00113                                                   DerivativeOperator##y; } \
00114   }
00115 
00116 #if ITK_TEMPLATE_EXPLICIT
00117 # include "Templates/itkDerivativeOperator+-.h"
00118 #endif
00119 
00120 #if ITK_TEMPLATE_TXX
00121 # include "itkDerivativeOperator.txx"
00122 #endif
00123 
00124 #endif
00125 
00126 
00127 

Generated at Mon Apr 14 12:13:24 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000