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

itkSampleAlgorithmBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkSampleAlgorithmBase.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/07/26 15:55:04 $
00007   Version:   $Revision: 1.7 $
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 __itkSampleAlgorithmBase_h
00019 #define __itkSampleAlgorithmBase_h
00020 
00021 #include <vnl/vnl_vector.h>
00022 #include <vnl/vnl_matrix.h>
00023 
00024 #include "itkMacro.h"
00025 #include "itkObjectFactory.h"
00026 #include "itkObject.h"
00027 #include "itkMeasurementVectorTraits.h"
00028 
00029 namespace itk{ 
00030   namespace Statistics{
00031   
00040 template< class TInputSample >
00041 class ITK_EXPORT SampleAlgorithmBase : public Object
00042 {
00043 public:
00045   typedef SampleAlgorithmBase Self;
00046   typedef Object Superclass ;
00047   typedef SmartPointer< Self > Pointer;
00048   typedef SmartPointer< const Self > ConstPointer;
00049 
00051   itkTypeMacro(SampleAlgorithmBase, Object);
00052   itkNewMacro(Self) ;
00053   
00055   typedef unsigned int MeasurementVectorSizeType;
00056 
00058   typedef TInputSample                                    InputSampleType;
00059   typedef typename InputSampleType::MeasurementVectorType MeasurementVectorType;
00060 
00062   void SetInputSample( const TInputSample * sample ) 
00063   {
00064     if ( m_InputSample != sample )
00065       {
00066         m_InputSample = sample ;
00067         m_MeasurementVectorSize = m_InputSample->GetMeasurementVectorSize();
00068         this->Modified() ;
00069       }
00070   }
00071 
00072 
00077   itkGetConstMacro( MeasurementVectorSize, MeasurementVectorSizeType );
00078   itkSetMacro( MeasurementVectorSize, MeasurementVectorSizeType )
00079 
00080   const TInputSample * GetInputSample() const
00081   { return m_InputSample.GetPointer() ; }
00082 
00086   void Update()
00087   { this->GenerateData() ; }
00088     
00089 protected:
00090   SampleAlgorithmBase() ;
00091   virtual ~SampleAlgorithmBase() {}
00092   void PrintSelf(std::ostream& os, Indent indent) const;
00093 
00095   virtual void GenerateData() ;
00096 
00097 private:
00099   MeasurementVectorSizeType m_MeasurementVectorSize;
00100   
00102   typename TInputSample::ConstPointer m_InputSample ;
00103 } ; // end of class
00104     
00105   } // end of namespace Statistics 
00106 } // end of namespace itk 
00107 
00108 #ifndef ITK_MANUAL_INSTANTIATION
00109 #include "itkSampleAlgorithmBase.txx"
00110 #endif
00111 
00112 #endif
00113 

Generated at Wed May 24 23:59:21 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000