ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkFourierSeriesPath.h
Go to the documentation of this file.
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 __itkFourierSeriesPath_h
00019 #define __itkFourierSeriesPath_h
00020 
00021 #include "itkParametricPath.h"
00022 #include "itkVectorContainer.h"
00023 #include "itkIndex.h"
00024 
00025 namespace itk
00026 {
00057 template< unsigned int VDimension >
00058 class ITK_EXPORT FourierSeriesPath:public
00059   ParametricPath< VDimension >
00060 {
00061 public:
00063   typedef FourierSeriesPath            Self;
00064   typedef ParametricPath< VDimension > Superclass;
00065   typedef SmartPointer< Self >         Pointer;
00066   typedef SmartPointer< const Self >   ConstPointer;
00067 
00069   itkTypeMacro(FourierSeriesPath, ParametricPath);
00070 
00072   typedef typename Superclass::InputType InputType;
00073 
00075   typedef typename Superclass::OutputType OutputType;
00076 
00078   typedef ContinuousIndex< double, VDimension >   ContinuousIndexType;
00079   typedef Index<  VDimension >                    IndexType;
00080   typedef Offset< VDimension >                    OffsetType;
00081   typedef Vector< double, VDimension >            VectorType;
00082   typedef VectorContainer< unsigned, VectorType > CoefficientsType;
00083   typedef typename CoefficientsType::Pointer      CoefficientsPointer;
00084 
00086   virtual OutputType Evaluate(const InputType & input) const;
00087 
00090   virtual VectorType EvaluateDerivative(const InputType & input) const;
00091 
00093   void AddHarmonic(const VectorType & CosCoefficients,
00094                    const VectorType & SinCoefficients);
00095 
00097   void Clear()
00098   {
00099     m_CosCoefficients->Initialize();
00100     m_SinCoefficients->Initialize();
00101     this->Modified();
00102   }
00104 
00106   itkNewMacro(Self);
00107 
00109   virtual void Initialize(void)
00110   {
00111     this->Clear();
00112   }
00113 
00114 protected:
00115   FourierSeriesPath();
00116   ~FourierSeriesPath(){}
00117   void PrintSelf(std::ostream & os, Indent indent) const;
00118 
00119 private:
00120   FourierSeriesPath(const Self &); //purposely not implemented
00121   void operator=(const Self &);    //purposely not implemented
00122 
00123   CoefficientsPointer m_CosCoefficients;
00124   CoefficientsPointer m_SinCoefficients;
00125 };
00126 } // end namespace itk
00127 
00128 // Define instantiation macro for this template.
00129 #define ITK_TEMPLATE_FourierSeriesPath(_, EXPORT, TypeX, TypeY)     \
00130   namespace itk                                                     \
00131   {                                                                 \
00132   _( 1 ( class EXPORT FourierSeriesPath< ITK_TEMPLATE_1 TypeX > ) ) \
00133   namespace Templates                                               \
00134   {                                                                 \
00135   typedef FourierSeriesPath< ITK_TEMPLATE_1 TypeX >                 \
00136   FourierSeriesPath##TypeY;                                       \
00137   }                                                                 \
00138   }
00139 
00140 #if ITK_TEMPLATE_EXPLICIT
00141 #include "Templates/itkFourierSeriesPath+-.h"
00142 #endif
00143 
00144 #if ITK_TEMPLATE_TXX
00145 #include "itkFourierSeriesPath.hxx"
00146 #endif
00147 
00148 #endif
00149