Dear list, I want to get information on the orientation in space of a tool I track using MicronTracker. To do so, I call the tool's GetOrientation(mitk::Quaternion) method and display values of real(), x(), y(), z() and angle() methods of the mitk::Quaternion I stored orientation information in. The code below shows this. For some reason, I always get values > 1000000000 for any of these values. Sometimes positive, sometimes negative. Here is my code, dealing with displaying position and orientation data of my tracked tools. Can anybody imagine what's wrong with this code?
Here is my code:
void QmitkMITKUltraSoundCalibrationPluginView::DisplayCoordinates(QString
toolName, QLabel* displayLabelPosition, QLabel* displayLabelOrientation){
if (m_Source.IsNotNull()){
if (m_Source->GetTrackingDevice()->GetState() ==
mitk::TrackingDevice::Tracking)
{
mitk::Point3D pos3D;
mitk::Quaternion orientation;
mitk::TrackingTool* tool =
m_Source->GetTrackingDevice()->GetToolByName(toolName.toStdString());
if (tool != NULL){
tool->GetPosition(pos3D);
tool->GetOrientation(orientation);
QString position;
position.sprintf("[x;y;z] = %.2f; %.2f;
%.2f",-pos3D[0],-pos3D[1],pos3D[2]);
if(displayLabelPosition != NULL)
displayLabelPosition->setText(position);
QString _orientation;
displayLabelOrientation->setToolTip("real part; imaginary
part along axis (x,y,z); angle of rotation");
_orientation.sprintf("%d; %d; %d; %d; %.2f;",
orientation.real(),orientation.x(),orientation.y(),orientation.z(),
orientation.angle());
if (displayLabelOrientation != NULL){
displayLabelOrientation->setText(_orientation);
}
}
}
}
}
I attached a screenshot to show you what's going on.
Best
Michael
<<attachment: screen_prob_orientation.jpg>>
------------------------------------------------------------------------------
_______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
