Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPCAShapeSignedDistanceFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPCAShapeSignedDistanceFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/12/12 22:07:24 $
00007   Version:   $Revision: 1.6 $
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 _itkPCAShapeSignedDistanceFunction_h
00018 #define _itkPCAShapeSignedDistanceFunction_h
00019 
00020 
00021 #include "itkShapeSignedDistanceFunction.h"
00022 #include "itkImage.h"
00023 #include "itkInterpolateImageFunction.h"
00024 #include "itkExtrapolateImageFunction.h"
00025 
00026 namespace itk
00027 {
00028 
00029 
00064 template< typename TCoordRep, 
00065           unsigned int VSpaceDimension,
00066           typename TImage = Image<double,VSpaceDimension> >
00067 class ITK_EXPORT PCAShapeSignedDistanceFunction : 
00068   public ShapeSignedDistanceFunction<TCoordRep, VSpaceDimension>
00069 {
00070 
00071 public:
00073   typedef PCAShapeSignedDistanceFunction          Self;
00074   typedef ShapeSignedDistanceFunction<
00075     TCoordRep, VSpaceDimension>                   Superclass;
00076   typedef SmartPointer<Self>                      Pointer;
00077   typedef SmartPointer<const Self>                ConstPointer;
00078   
00079 
00081   itkTypeMacro(PCAShapeSignedDistanceFunction, ShapeSignedDistancFunction);
00082 
00084   itkNewMacro(Self);
00085 
00087   itkStaticConstMacro(SpaceDimension,unsigned int,Superclass::SpaceDimension);
00088 
00089 
00091   typedef typename Superclass::CoordRepType       CoordRepType;
00092 
00094   typedef typename Superclass::InputType          InputType;
00095 
00097   typedef typename Superclass::OutputType         OutputType;
00098   
00100   typedef typename Superclass::PointType          PointType;
00101 
00103   typedef typename Superclass::ParametersType     ParametersType;
00104 
00105 
00107   typedef TImage                                  ImageType;
00108   typedef typename ImageType::Pointer             ImagePointer;
00109   typedef std::vector<ImagePointer>               ImagePointerVector;
00110 
00112   typedef Transform<CoordRepType, 
00113                     itkGetStaticConstMacro(SpaceDimension), 
00114                     itkGetStaticConstMacro(SpaceDimension)> TransformType;
00115 
00117   typedef InterpolateImageFunction<ImageType, CoordRepType> InterpolatorType;
00118   typedef typename InterpolatorType::Pointer                InterpolatorPointer;
00119   typedef std::vector<InterpolatorPointer>                  InterpolatorPointerVector;
00120 
00122   typedef ExtrapolateImageFunction<ImageType, CoordRepType> ExtrapolatorType;
00123   typedef typename ExtrapolatorType::Pointer                ExtrapolatorPointer;
00124   typedef std::vector<ExtrapolatorPointer>                  ExtrapolatorPointerVector;
00125 
00127   typedef ImageFunction<ImageType, double, CoordRepType> FunctionType;
00128   typedef typename FunctionType::Pointer                 FunctionPointer;
00129   typedef std::vector<FunctionPointer>                   FunctionPointerVector;
00130 
00131 
00134   void SetNumberOfPrincipalComponents(unsigned int n);
00135   itkGetMacro(NumberOfPrincipalComponents, unsigned int);
00136 
00138   itkSetObjectMacro(MeanImage, ImageType);
00139   itkGetObjectMacro(MeanImage, ImageType);
00140 
00142   void SetPrincipalComponentImages(ImagePointerVector v)
00143     { m_PrincipalComponentImages = v; }
00144 //  ImagePointerVector & GetPrincipalComponentImages()
00145 //    { return m_PrincipalComponentImages; }
00146 
00149   itkSetMacro(PrincipalComponentStandardDeviations, ParametersType);
00150   itkGetMacro(PrincipalComponentStandardDeviations, ParametersType);
00151 
00153   itkSetObjectMacro(Transform, TransformType);
00154   itkGetObjectMacro(Transform, TransformType);
00155 
00156 
00158   virtual void SetParameters( const ParametersType & );
00159   virtual unsigned int GetNumberOfShapeParameters(void) const
00160     { return m_NumberOfPrincipalComponents; }
00161   virtual unsigned int GetNumberOfPoseParameters(void) const
00162     { return m_Transform ? m_Transform->GetNumberOfParameters() : 0; }
00163 
00165   virtual OutputType Evaluate(const PointType& point) const;
00166 
00169   virtual void Initialize() throw ( ExceptionObject );
00170 
00171 
00172 protected:
00173   PCAShapeSignedDistanceFunction();
00174   ~PCAShapeSignedDistanceFunction(){};
00175 
00176   void PrintSelf(std::ostream& os, Indent indent) const;
00177 
00178 
00179 private:
00180   PCAShapeSignedDistanceFunction(const Self&); //purposely not implemented
00181   void operator=( const Self& ); //purposely not implemented
00182 
00183 
00185   unsigned int                  m_NumberOfPrincipalComponents;
00186   unsigned int                  m_NumberOfTransformParameters;
00187 
00188   ImagePointer                  m_MeanImage;
00189   ImagePointerVector            m_PrincipalComponentImages;
00190   ParametersType                m_PrincipalComponentStandardDeviations;
00191 
00193   typename TransformType::Pointer        m_Transform;
00194   InterpolatorPointerVector              m_Interpolators;
00195   ExtrapolatorPointerVector              m_Extrapolators;
00196   mutable FunctionPointerVector          m_Selectors;
00197 
00199   ParametersType                m_WeightOfPrincipalComponents;
00200   ParametersType                m_TransformParameters;         
00201 
00202 };
00203 
00204 } // namespace itk
00205 
00206 #ifndef ITK_MANUAL_INSTANTIATION
00207 #include "itkPCAShapeSignedDistanceFunction.txx"
00208 #endif
00209 
00210 #endif

Generated at Wed Mar 30 00:07:13 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000