[IGSTK-Users] PulseGenerator and PulseObserver problem

alberto.vaccarella at mail.polimi.it alberto.vaccarella at mail.polimi.it
Wed May 27 07:18:15 EDT 2009


Hi everybody,

I need to use a pulse generator object within my class to trigger a  
callback function at a rate of 20Hz. I copied the code used in tracker  
or view classes, as follows:

DECLARATION

#include "igstkPulseGenerator.h"

private:
  igstk::PulseGenerator::Pointer				m_PulseGenerator;
  typedef itk::SimpleMemberCommand< Self >	        ObserverType;
  ObserverType::Pointer					m_PulseObserver;

INSTANTIATION

m_PulseGenerator = igstk::PulseGenerator::New();
m_PulseObserver  = ObserverType::New();
m_PulseObserver->SetCallbackFunction( this, &MyClass::MyCallback );
m_PulseGenerator->AddObserver( PulseEvent(), m_PulseObserver );
m_PulseGenerator->RequestSetFrequency( 20.0 );
m_PulseGenerator->RequestStart();

The first error I got was: "Self: undeclared identifier"; I tried to  
solve this by using MyClass instead of Self, but now I get the  
following: "PulseEvent: function does not take 0 arguments"...

Thanks in advance for any help
Alberto




More information about the IGSTK-Users mailing list