00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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) ;
00054
00056 typedef unsigned int MeasurementVectorSizeType;
00057
00059 typedef TInputSample InputSampleType;
00060 typedef typename InputSampleType::MeasurementVectorType MeasurementVectorType;
00061
00063 void SetInputSample( const TInputSample * sample )
00064 {
00065 if ( m_InputSample != sample )
00066 {
00067 m_InputSample = sample ;
00068 m_MeasurementVectorSize = m_InputSample->GetMeasurementVectorSize();
00069 this->Modified() ;
00070 }
00071 }
00073
00074
00079 itkGetConstMacro( MeasurementVectorSize, MeasurementVectorSizeType );
00080 itkSetMacro( MeasurementVectorSize, MeasurementVectorSizeType )
00081
00082 const TInputSample * GetInputSample() const
00083 { return m_InputSample.GetPointer() ; }
00084
00088 void Update()
00089 { this->GenerateData() ; }
00090
00091 protected:
00092 SampleAlgorithmBase() ;
00093 virtual ~SampleAlgorithmBase() {}
00094 void PrintSelf(std::ostream& os, Indent indent) const;
00095
00097 virtual void GenerateData() ;
00098
00099 private:
00101 MeasurementVectorSizeType m_MeasurementVectorSize;
00102
00104 typename TInputSample::ConstPointer m_InputSample ;
00105 } ;
00106
00107 }
00108 }
00109
00110 #ifndef ITK_MANUAL_INSTANTIATION
00111 #include "itkSampleAlgorithmBase.txx"
00112 #endif
00113
00114 #endif
00115
00116