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

itkImagePCADecompositionCalculator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImagePCADecompositionCalculator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/05/13 20:04:46 $
00007   Version:   $Revision: 1.4 $
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 
00018 #ifndef __itkImagePCADecompositionCalculator_h
00019 #define __itkImagePCADecompositionCalculator_h
00020 
00021 #include "itkObject.h"
00022 #include "itkImagePCAShapeModelEstimator.h"
00023 #include "vnl/vnl_vector.h"
00024 #include "vnl/vnl_matrix.h"
00025 
00026 namespace itk
00027 {
00028 
00057 template <class TInputImage, 
00058     class TBasisImage = Image<double, ::itk::GetImageDimension<TInputImage>::ImageDimension> >
00059 class ITK_EXPORT ImagePCADecompositionCalculator : public Object 
00060 {
00061 public:
00063   typedef ImagePCADecompositionCalculator Self;
00064   typedef Object  Superclass;
00065   typedef SmartPointer<Self>   Pointer;
00066   typedef SmartPointer<const Self>  ConstPointer;
00067 
00069   itkNewMacro(Self);
00070 
00072   itkTypeMacro(ImagePCADecompositionCalculator, Object);
00073 
00075   typedef TInputImage  InputImageType;
00076   typedef TBasisImage  BasisImageType;
00077   
00079   typedef typename TInputImage::Pointer  InputImagePointer;
00080   typedef typename TBasisImage::Pointer  BasisImagePointer;
00081   
00083   typedef typename TInputImage::ConstPointer InputImageConstPointer;
00084   
00086   typedef typename TBasisImage::PixelType BasisPixelType;
00088   itkStaticConstMacro(InputImageDimension, unsigned int,
00089                       TInputImage::ImageDimension); 
00090 
00092   itkStaticConstMacro(BasisImageDimension, unsigned int,
00093                       TBasisImage::ImageDimension); 
00094   
00095   
00097   typedef std::vector< BasisImagePointer > BasisImagePointerVector;
00098   
00100   typedef vnl_matrix<BasisPixelType> BasisMatrixType;
00101   typedef vnl_vector<BasisPixelType> BasisVectorType;
00102   
00104   itkSetConstObjectMacro(Image,InputImageType);
00105   
00107   void SetBasisImages(const BasisImagePointerVector _arg); 
00108   
00110   BasisImagePointerVector& GetBasisImages(void) {return m_BasisImages;}
00111   
00113   typedef typename ImagePCAShapeModelEstimator<TInputImage,
00114     TBasisImage>::Pointer ModelPointerType;
00116   void SetBasisFromModel(ModelPointerType model);
00117   
00119   void Compute(void);
00120 
00122   itkGetMacro(Projection,BasisVectorType);
00123   
00124 
00125 protected:
00126   ImagePCADecompositionCalculator();
00127   virtual ~ImagePCADecompositionCalculator() {};
00128   void PrintSelf(std::ostream& os, Indent indent) const;
00129   void CalculateBasisMatrix(void);
00130   void CalculateImageAsVector(void);
00131   
00132 private:
00133   typedef typename BasisImageType::SizeType BasisSizeType;
00134     
00135   ImagePCADecompositionCalculator(const Self&); //purposely not implemented
00136   void operator=(const Self&); //purposely not implemented
00137   
00138   BasisVectorType m_Projection;
00139   BasisVectorType m_ImageAsVector;
00140   BasisImagePointerVector  m_BasisImages;
00141   BasisSizeType m_Size;
00142   InputImageConstPointer  m_Image;
00143   BasisMatrixType  m_BasisMatrix;
00144   bool m_BasisMatrixCalculated;
00145   unsigned long m_NumPixels;
00146 };
00147 
00148 } // end namespace itk
00149 
00150 
00151 #ifndef ITK_MANUAL_INSTANTIATION
00152 #include "itkImagePCADecompositionCalculator.txx"
00153 #endif
00154 
00155 #endif

Generated at Tue Mar 29 23:56:09 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000