00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkFourierSeriesPath.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:08 $ 00007 Version: $Revision: 1.4 $ 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 00018 #ifndef _itkFourierSeriesPath_h 00019 #define _itkFourierSeriesPath_h 00020 00021 #include "itkParametricPath.h" 00022 #include "itkVectorContainer.h" 00023 #include "itkContinuousIndex.h" 00024 #include "itkIndex.h" 00025 #include "itkOffset.h" 00026 #include "itkVector.h" 00027 00028 namespace itk 00029 { 00030 00031 00061 template <unsigned int VDimension> 00062 class ITK_EXPORT FourierSeriesPath : public 00063 ParametricPath< VDimension > 00064 { 00065 public: 00067 typedef FourierSeriesPath Self; 00068 typedef ParametricPath<VDimension> Superclass; 00069 typedef SmartPointer<Self> Pointer; 00070 typedef SmartPointer<const Self> ConstPointer; 00071 00073 itkTypeMacro(FourierSeriesPath, ParametricPath); 00074 00076 typedef typename Superclass::InputType InputType; 00077 00079 typedef typename Superclass::OutputType OutputType; 00080 00081 00083 typedef ContinuousIndex<double,VDimension> ContinuousIndexType; 00084 typedef Index< VDimension > IndexType; 00085 typedef Offset< VDimension > OffsetType; 00086 typedef Vector<double,VDimension> VectorType; 00087 typedef VectorContainer<unsigned, VectorType> CoefficientsType; 00088 typedef typename CoefficientsType::Pointer CoefficientsPointer; 00089 00090 00092 virtual OutputType Evaluate( const InputType & input ) const; 00093 00096 virtual VectorType EvaluateDerivative(const InputType & input) const; 00097 00099 void AddHarmonic( const VectorType & CosCoefficients, 00100 const VectorType & SinCoefficients ); 00101 00103 void Clear() 00104 { 00105 m_CosCoefficients->Initialize(); 00106 m_SinCoefficients->Initialize(); 00107 this->Modified(); 00108 } 00109 00111 itkNewMacro( Self ); 00112 00114 virtual void Initialize(void) 00115 { 00116 this->Clear(); 00117 } 00118 00119 protected: 00120 FourierSeriesPath(); 00121 ~FourierSeriesPath(){} 00122 void PrintSelf(std::ostream& os, Indent indent) const; 00123 00124 private: 00125 FourierSeriesPath(const Self&); //purposely not implemented 00126 void operator=(const Self&); //purposely not implemented 00127 00128 CoefficientsPointer m_CosCoefficients; 00129 CoefficientsPointer m_SinCoefficients; 00130 }; 00131 00132 } // namespace itk 00133 00134 #ifndef ITK_MANUAL_INSTANTIATION 00135 #include "itkFourierSeriesPath.txx" 00136 #endif 00137 00138 #endif