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) ;
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 } ;
00104
00105 }
00106 }
00107
00108 #ifndef ITK_MANUAL_INSTANTIATION
00109 #include "itkSampleAlgorithmBase.txx"
00110 #endif
00111
00112 #endif
00113