ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGaussianSpatialFunction.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 __itkGaussianSpatialFunction_h
00019 #define __itkGaussianSpatialFunction_h
00020 
00021 #include "itkSpatialFunction.h"
00022 #include "itkFixedArray.h"
00023 
00024 namespace itk
00025 {
00040 template< typename TOutput = double,
00041           unsigned int VImageDimension = 3,
00042           typename TInput = Point< double, VImageDimension > >
00043 class ITK_EXPORT GaussianSpatialFunction:
00044   public SpatialFunction< TOutput, VImageDimension, TInput >
00045 {
00046 public:
00048   typedef GaussianSpatialFunction                             Self;
00049   typedef SpatialFunction< TOutput, VImageDimension, TInput > Superclass;
00050   typedef SmartPointer< Self >                                Pointer;
00051   typedef SmartPointer< const Self >                          ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(GaussianSpatialFunction, SpatialFunction);
00058 
00060   typedef typename Superclass::InputType InputType;
00061 
00063   typedef typename Superclass::OutputType OutputType;
00064 
00066   typedef FixedArray< double, VImageDimension > ArrayType;
00067 
00069   OutputType Evaluate(const TInput & position) const;
00070 
00072   itkSetMacro(Scale, double);
00073   itkGetConstMacro(Scale, double);
00074   itkSetMacro(Normalized, bool);
00075   itkGetConstMacro(Normalized, bool);
00076   itkSetMacro(Sigma, ArrayType);
00077   itkGetConstMacro(Sigma, ArrayType);
00078   itkSetMacro(Mean, ArrayType);
00079   itkGetConstMacro(Mean, ArrayType);
00080 protected:
00081   GaussianSpatialFunction();
00082   virtual ~GaussianSpatialFunction();
00083   void PrintSelf(std::ostream & os, Indent indent) const;
00085 
00086 private:
00087   GaussianSpatialFunction(const Self &); //purposely not implemented
00088   void operator=(const Self &);          //purposely not implemented
00089 
00091   ArrayType m_Sigma;
00092 
00094   ArrayType m_Mean;
00095 
00097   double m_Scale;
00098 
00100   bool m_Normalized;
00101 };
00102 } // end namespace itk
00103 
00104 // Define instantiation macro for this template.
00105 #define ITK_TEMPLATE_GaussianSpatialFunction(_, EXPORT, TypeX, TypeY)     \
00106   namespace itk                                                           \
00107   {                                                                       \
00108   _( 3 ( class EXPORT GaussianSpatialFunction< ITK_TEMPLATE_3 TypeX > ) ) \
00109   namespace Templates                                                     \
00110   {                                                                       \
00111   typedef GaussianSpatialFunction< ITK_TEMPLATE_3 TypeX >                 \
00112   GaussianSpatialFunction##TypeY;                                       \
00113   }                                                                       \
00114   }
00115 
00116 #if ITK_TEMPLATE_EXPLICIT
00117 #include "Templates/itkGaussianSpatialFunction+-.h"
00118 #endif
00119 
00120 #if ITK_TEMPLATE_TXX
00121 #include "itkGaussianSpatialFunction.hxx"
00122 #endif
00123 
00124 #endif
00125