ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkManifoldParzenWindowsPointSetFunction.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 __itkManifoldParzenWindowsPointSetFunction_h
00019 #define __itkManifoldParzenWindowsPointSetFunction_h
00020 
00021 #include "itkPointSetFunction.h"
00022 
00023 #include "itkGaussianMembershipFunction.h"
00024 #include "itkMatrix.h"
00025 #include "itkPointSet.h"
00026 #include "itkPointsLocator.h"
00027 #include "itkVector.h"
00028 
00029 #include <vector>
00030 
00031 namespace itk
00032 {
00033 
00044 template <class TPointSet, class TOutput = double, class TCoordRep = double>
00045 class ITK_EXPORT ManifoldParzenWindowsPointSetFunction
00046 : public PointSetFunction<TPointSet, TOutput, TCoordRep>
00047 {
00048 public:
00049   typedef ManifoldParzenWindowsPointSetFunction            Self;
00050   typedef PointSetFunction<TPointSet, TOutput, TCoordRep>  Superclass;
00051   typedef SmartPointer<Self>                               Pointer;
00052   typedef SmartPointer<const Self>                         ConstPointer;
00053 
00055   itkNewMacro(Self);
00056 
00058   itkStaticConstMacro( PointDimension, unsigned int, TPointSet::PointDimension );
00059 
00060   typedef typename Superclass::InputPointSetType   InputPointSetType;
00061   typedef typename Superclass::InputPointType      InputPointType;
00062 
00064   typedef TPointSet                                        PointSetType;
00065   typedef typename PointSetType::PointType                 PointType;
00066   typedef typename PointSetType::PointsContainer           PointsContainer;
00067   typedef typename PointsContainer::ElementIdentifier      PointIdentifier;
00068 
00070   typedef TOutput                                          RealType;
00071   typedef TOutput                                          OutputType;
00072   typedef TCoordRep                                        CoordRepType;
00073 
00075   typedef PointsLocator<PointIdentifier,
00076     itkGetStaticConstMacro( PointDimension ),
00077     CoordRepType, PointsContainer>                     PointsLocatorType;
00078   typedef typename PointsLocatorType::
00079     NeighborsIdentifierType                            NeighborsIdentifierType;
00080 
00081   typedef typename Statistics::
00082     GaussianMembershipFunction<PointType>                  GaussianType;
00083   typedef typename GaussianType::Pointer                   GaussianPointer;
00084   typedef std::vector<GaussianPointer>                     GaussianContainerType;
00085   typedef typename GaussianType::CovarianceMatrixType      CovarianceMatrixType;
00086 
00094   itkSetMacro( CovarianceKNeighborhood, unsigned int );
00095 
00097   itkGetConstMacro( CovarianceKNeighborhood, unsigned int );
00098 
00105   itkSetMacro( EvaluationKNeighborhood, unsigned int );
00106 
00108   itkGetConstMacro( EvaluationKNeighborhood, unsigned int );
00109 
00114   itkSetMacro( RegularizationSigma, RealType );
00115 
00117   itkGetConstMacro( RegularizationSigma, RealType );
00118 
00124   itkSetMacro( KernelSigma, RealType );
00125 
00127   itkGetConstMacro( KernelSigma, RealType );
00128 
00133   itkSetMacro( Normalize, bool );
00134 
00139   itkGetConstMacro( Normalize, bool );
00140 
00145   itkBooleanMacro( Normalize );
00146 
00152   itkSetMacro( UseAnisotropicCovariances, bool );
00153 
00159   itkGetConstMacro( UseAnisotropicCovariances, bool );
00160 
00166   itkBooleanMacro( UseAnisotropicCovariances );
00167 
00169   virtual void SetInputPointSet( const InputPointSetType * );
00170 
00172   virtual TOutput Evaluate( const InputPointType & ) const;
00173 
00175   GaussianPointer GetGaussian( PointIdentifier );
00176 
00178   itkGetConstObjectMacro( PointsLocator, PointsLocatorType );
00179 
00180 protected:
00181   ManifoldParzenWindowsPointSetFunction();
00182   virtual ~ManifoldParzenWindowsPointSetFunction();
00183   void PrintSelf( std::ostream& os, Indent indent ) const;
00184 
00185   void GenerateData();
00186 
00187 private:
00188   //purposely not implemented
00189   ManifoldParzenWindowsPointSetFunction( const Self& );
00190   void operator=( const Self& );
00191 
00192   typename PointsLocatorType::Pointer           m_PointsLocator;
00193 
00194   unsigned int                                  m_CovarianceKNeighborhood;
00195   unsigned int                                  m_EvaluationKNeighborhood;
00196   RealType                                      m_RegularizationSigma;
00197   RealType                                      m_KernelSigma;
00198 
00199   GaussianContainerType                         m_Gaussians;
00200   bool                                          m_Normalize;
00201   bool                                          m_UseAnisotropicCovariances;
00202 };
00203 
00204 } // end namespace itk
00205 
00206 #ifndef ITK_MANUAL_INSTANTIATION
00207 #include "itkManifoldParzenWindowsPointSetFunction.hxx"
00208 #endif
00209 
00210 #endif
00211