ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRadialBasisFunctionBase.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 __itkRadialBasisFunctionBase_h
00019 #define __itkRadialBasisFunctionBase_h
00020 
00021 #include "itkFunctionBase.h"
00022 #include "itkArray.h"
00023 
00024 namespace itk
00025 {
00026 namespace Statistics
00027 {
00034 template<class ScalarType>
00035 class RadialBasisFunctionBase : public FunctionBase<ScalarType,ScalarType>
00036 {
00037 public:
00038 
00040   typedef RadialBasisFunctionBase             Self;
00041   typedef FunctionBase<ScalarType,ScalarType> Superclass;
00042   typedef SmartPointer<Self>                  Pointer;
00043   typedef SmartPointer<const Self>            ConstPointer;
00044 
00046   itkTypeMacro(RadialBasisFunctionBase, FunctionBase);
00047 
00049   typedef Array<ScalarType> ArrayType;
00050 
00052   virtual ScalarType Evaluate(const ScalarType& input) const=0;
00053 
00055   virtual ScalarType EvaluateDerivative(const ScalarType& dist, const ArrayType& input,
00056                                                     char mode,int element_id=0) const=0;
00057 
00058   itkSetMacro(Radius,ScalarType);
00059   itkGetConstMacro(Radius, ScalarType );
00060 
00061   itkSetMacro(Center,ArrayType);
00062   itkGetConstMacro(Center, ArrayType );
00063 
00064 protected:
00065 
00066   RadialBasisFunctionBase()
00067     {
00068     m_Radius = 0;
00069     }
00070   ~RadialBasisFunctionBase() {};
00071 
00073   virtual void PrintSelf( std::ostream& os, Indent indent ) const
00074     {
00075     os << indent << "RadialBasisFunctionBase(" << this << ")" << std::endl;
00076     Superclass::PrintSelf( os, indent );
00077     }
00079 
00080 private:
00081 
00082   ArrayType  m_Center;
00083   ScalarType m_Radius;
00084 
00085   RadialBasisFunctionBase(const Self&); //purposely not implemented
00086   void operator=(const Self&); //purposely not implemented
00087 };
00088 
00089 } // end namespace Statistics
00090 } // end namespace itk
00091 
00092 #endif
00093