ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkDerivativeOperator_h 00019 #define __itkDerivativeOperator_h 00020 00021 #include "itkNeighborhoodOperator.h" 00022 00023 namespace itk 00024 { 00065 template< class TPixel, unsigned int VDimension = 2, 00066 class TAllocator = NeighborhoodAllocator< TPixel > > 00067 class ITK_EXPORT DerivativeOperator: 00068 public NeighborhoodOperator< TPixel, VDimension, TAllocator > 00069 { 00070 public: 00071 00073 typedef DerivativeOperator Self; 00074 typedef NeighborhoodOperator< 00075 TPixel, VDimension, TAllocator > Superclass; 00076 00077 typedef typename Superclass::PixelType PixelType; 00078 typedef typename Superclass::PixelRealType PixelRealType; 00079 00081 DerivativeOperator():m_Order(1) {} 00082 00084 DerivativeOperator(const Self & other): 00085 NeighborhoodOperator< TPixel, VDimension, TAllocator >(other) 00086 { m_Order = other.m_Order; } 00087 00089 Self & operator=(const Self & other) 00090 { 00091 Superclass::operator=(other); 00092 m_Order = other.m_Order; 00093 return *this; 00094 } 00096 00098 void SetOrder(const unsigned int & order) 00099 { 00100 this->m_Order = order; 00101 } 00102 00104 unsigned int GetOrder() const { return m_Order; } 00105 00107 virtual void PrintSelf(std::ostream & os, Indent i) const 00108 { 00109 os << i << "DerivativeOperator { this=" << this 00110 << ", m_Order = " << m_Order << "}" << std::endl; 00111 Superclass::PrintSelf( os, i.GetNextIndent() ); 00112 } 00114 00115 protected: 00118 typedef typename Superclass::CoefficientVector CoefficientVector; 00119 00121 CoefficientVector GenerateCoefficients(); 00122 00124 void Fill(const CoefficientVector & coeff) 00125 { Superclass::FillCenteredDirectional(coeff); } 00126 private: 00127 00129 unsigned int m_Order; 00130 }; 00131 } // namespace itk 00132 00133 // Define instantiation macro for this template. 00134 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, TypeX, TypeY) \ 00135 namespace itk \ 00136 { \ 00137 _( 2 ( class EXPORT DerivativeOperator< ITK_TEMPLATE_2 TypeX > ) ) \ 00138 namespace Templates \ 00139 { \ 00140 typedef DerivativeOperator< ITK_TEMPLATE_2 TypeX > \ 00141 DerivativeOperator##TypeY; \ 00142 } \ 00143 } 00144 00145 #if ITK_TEMPLATE_EXPLICIT 00146 #include "Templates/itkDerivativeOperator+-.h" 00147 #endif 00148 00149 #if ITK_TEMPLATE_TXX 00150 #include "itkDerivativeOperator.hxx" 00151 #endif 00152 00153 #endif 00154