00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkFourierSeriesPath.h,v $ 00005 Language: C++ 00006 Date: $Date: 2006/02/06 22:01:55 $ 00007 Version: $Revision: 1.5 $ 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 __itkFourierSeriesPath_h 00018 #define __itkFourierSeriesPath_h 00019 00020 #include "itkParametricPath.h" 00021 #include "itkVectorContainer.h" 00022 #include "itkContinuousIndex.h" 00023 #include "itkIndex.h" 00024 #include "itkOffset.h" 00025 #include "itkVector.h" 00026 00027 namespace itk 00028 { 00029 00030 00060 template <unsigned int VDimension> 00061 class ITK_EXPORT FourierSeriesPath : public 00062 ParametricPath< VDimension > 00063 { 00064 public: 00066 typedef FourierSeriesPath Self; 00067 typedef ParametricPath<VDimension> Superclass; 00068 typedef SmartPointer<Self> Pointer; 00069 typedef SmartPointer<const Self> ConstPointer; 00070 00072 itkTypeMacro(FourierSeriesPath, ParametricPath); 00073 00075 typedef typename Superclass::InputType InputType; 00076 00078 typedef typename Superclass::OutputType OutputType; 00079 00080 00082 typedef ContinuousIndex<double,VDimension> ContinuousIndexType; 00083 typedef Index< VDimension > IndexType; 00084 typedef Offset< VDimension > OffsetType; 00085 typedef Vector<double,VDimension> VectorType; 00086 typedef VectorContainer<unsigned, VectorType> CoefficientsType; 00087 typedef typename CoefficientsType::Pointer CoefficientsPointer; 00088 00089 00091 virtual OutputType Evaluate( const InputType & input ) const; 00092 00095 virtual VectorType EvaluateDerivative(const InputType & input) const; 00096 00098 void AddHarmonic( const VectorType & CosCoefficients, 00099 const VectorType & SinCoefficients ); 00100 00102 void Clear() 00103 { 00104 m_CosCoefficients->Initialize(); 00105 m_SinCoefficients->Initialize(); 00106 this->Modified(); 00107 } 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 } // end namespace itk 00133 00134 #ifndef ITK_MANUAL_INSTANTIATION 00135 #include "itkFourierSeriesPath.txx" 00136 #endif 00137 00138 #endif 00139