#ifndef __CPPLUGINS__EXTENSIONS__ALGORITHMS__KALMANFILTER__H__
#define __CPPLUGINS__EXTENSIONS__ALGORITHMS__KALMANFILTER__H__
+#include <itkObject.h>
+#include <itkObjectFactory.h>
#include <vnl/vnl_matrix.h>
#include <vnl/vnl_vector.h>
// -------------------------------------------------------------------------
-#define kalmanGetMacro( type, name ) \
- virtual type Get##name( ) const \
- { return( this->m_##name ); }
-
-// -------------------------------------------------------------------------
-#define kalmanSetMacro( type, name ) \
- virtual void Set##name( const type& m ) \
- { this->m_##name = m; }
-
-// -------------------------------------------------------------------------
-#define kalmanGetSetMacro( type, name ) \
- kalmanGetMacro( type, name ); \
- kalmanSetMacro( type, name );
+#define kalmanGetSetMacro( type, name ) \
+ itkGetConstMacro( name, type ); \
+ itkSetMacro( name, type );
// -------------------------------------------------------------------------
#define kalmanGetMatrixMacro( var, name ) \
// -------------------------------------------------------------------------
#define kalmanSetMatrixMacro( var, name ) \
virtual void Set##name( const TMatrix& m ) \
- { this->m_##var = m; }
+ { this->Set##var( m ); }
// -------------------------------------------------------------------------
#define kalmanGetSetMatrixMacro( var, name ) \
// -------------------------------------------------------------------------
#define kalmanSetVectorMacro( var, name ) \
virtual void Set##name( const TVector& v ) \
- { this->m_##var = v; }
+ { this->Set##var( v ); }
// -------------------------------------------------------------------------
#define kalmanGetSetVectorMacro( var, name ) \
*/
template< typename T >
class KalmanFilter
+ : public itk::Object
{
public:
- typedef KalmanFilter Self;
+ typedef KalmanFilter Self;
+ typedef itk::Object Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
// Template parameters types
typedef T TScalar;
};
public:
+ itkNewMacro( Self );
+ itkTypeMacro( KalmanFilter, itkObject );
+
// Values
- kalmanGetMacro( unsigned int, StateSize );
- kalmanGetMacro( unsigned int, InputSize );
- kalmanGetMacro( unsigned int, MeasureSize );
+ itkGetConstMacro( StateSize, unsigned int );
+ itkGetConstMacro( InputSize, unsigned int );
+ itkGetConstMacro( MeasureSize, unsigned int );
// Matrices
kalmanGetSetMacro( TMatrix, A );
kalmanGetSetVectorMacro( xp, APosterioriState );
public:
- KalmanFilter(
- unsigned int s = 1, unsigned int i = 1, unsigned int m = 1
- );
- virtual ~KalmanFilter( );
void Configure( unsigned int s, unsigned int i, unsigned int m );
unsigned char CurrentStep( ) const
{ return( this->m_Step ); }
+ protected:
+ KalmanFilter( );
+ virtual ~KalmanFilter( );
+
private:
// Purposely not implemented
KalmanFilter( const Self& );