[IGSTK-Users] Pivot Calibration events problems.

Özgür Güler ozgur_guler at gmx.at
Wed Jan 16 07:56:37 EST 2013


Hi Fabian,
your callback function is not complete. The "if" and "else if" statements
do not check for a certain event invoked. Use code above as template:

  if( const igstk::PivotCalibration::DataAcquisitionEvent *evt =
     dynamic_cast< const igstk::PivotCalibration::DataAcquisitionEvent * >
(&event) )
  {
// set progress bar
  }
  else if( dynamic_cast<
          const igstk::PivotCalibration::DataAcquisitionEndEvent * >
(&event) )
  {
// do nothing
  }
  else if( const igstk::PivotCalibration::CalibrationFailureEvent *evt =
       dynamic_cast<
          const igstk::PivotCalibration::CalibrationFailureEvent * >
(&event) )
  {
 // handle error
  }
 else if( dynamic_cast<
          const igstk::PivotCalibration::CalibrationSuccessEvent * >
(&event) )
  {
// process results
}

Best,
Ozgur


2013/1/14 Fabian Torres <fabian.trobles at gmail.com>

> Hi all.
>
> Im trying to ise the igstk::PivotCalibration class. Im using the
> igstkPivotCalibratioFLTKWidget class as a guideline.
>
> The problem I have is that I do not receive some calibration events. I get
> the following events:
>
> igstk::PivotCalibration::InitializationFailureEvent()
> igstk::PivotCalibration::InitializationSuccessEvent()
> igstk::PivotCalibration::DataAcquisitionStartEvent()
>
>
> After the InitializationSuccessEvent I use
>
>                        pivotCalibration->RequestComputeCalibration();
>
> and receive a  DataAcquisitionStartEvent, but after that I do not get any
> event. I do not receive
> a DataAcquisitionEvent, DataAcquisitionEndEvent, CalibrationSuccessEvent
> or CalibrationFailureEvent.
>
> This is my callback function for events
>
> void NeedleCalibration::OnCalibrationEvent( itk::Object * caller, const
> itk::EventObject & event )
> {
>
> std::cout<<"OnCalibrationEvent"<<std::endl;
>
> if(dynamic_cast< const
>     igstk::PivotCalibration::DataAcquisitionStartEvent * > (&event) )
>  {
> std::cout<<"Data Acquisition Started"<<std::endl;
>  }
> else if(dynamic_cast< const
>     igstk::PivotCalibration::DataAcquisitionEvent * > (&event) )
>        {
>                 std::cout<<"Data Acquisition"<<std::endl;
>        }
> else if( dynamic_cast<
>   const igstk::PivotCalibration::DataAcquisitionEndEvent * > (&event) )
>        {
> std::cout<<"Data Acquisition Ended"<<std::endl;
>        }
>   else if(dynamic_cast<
> const igstk::PivotCalibration::CalibrationFailureEvent * > (&event) )
>        {
> std::cout<<"Calibration failed"<<std::endl;
>   }
>  else if( dynamic_cast<
>   const igstk::PivotCalibration::CalibrationSuccessEvent * > (&event) )
>       {
> std::cout<<"Calibration Succed"<<std::endl;
>
>       }
> }
>
> And this are my observers
>
> typedef itk::MemberCommand<NeedleCalibration>   CalibrationObserverType;
> this->m_CalibrationObserver = CalibrationObserverType::New();
> this->m_CalibrationObserver->SetCallbackFunction(this,
> &NeedleCalibration::OnCalibrationEvent );
> pivotCalibration->AddObserver(igstk::PivotCalibration::DataAcquisitionStartEvent(),
> this->m_CalibrationObserver );
> pivotCalibration->AddObserver(igstk::PivotCalibration::DataAcquisitionEvent(),
> this->m_CalibrationObserver );
> pivotCalibration->AddObserver(igstk::PivotCalibration::DataAcquisitionEndEvent(),this->m_CalibrationObserver
> );
> pivotCalibration->AddObserver(igstk::PivotCalibration::CalibrationSuccessEvent(),this->m_CalibrationObserver
> );
> pivotCalibration->AddObserver(igstk::PivotCalibration::CalibrationFailureEvent(),this->m_CalibrationObserver
> );
>
> My tracker is in tracking state
>
> Can anyone help me with this problem
> Thanks for your time
> --
> Fabián Torres Robles
> Maestria en Ciencias en Ingeniería Electrónica
> Ingeniería en Sistemas Electrónicos
> tel. 58081280, 0445534661338
> e-mail fabian.trobles at gmail.com, dae.wong at gmail.com
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>



-- 
*********************************************************************
Dr. Dipl.-Ing. Özgür Güler, Bakk. techn. PhD
Research Assistant
4D-Visualization Laboratory
Univ. ENT Clinic
Innsbruck Medical University
Anichstr. 35, A-6020 Innsbruck, Austria

tel.: +43 512 504 23428, fax.: +43 512 504 25231

voxelmaster.eu
www.gueler.at
*********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20130116/2c89a3e2/attachment-0001.html>


More information about the IGSTK-Users mailing list