HI all,<br>I tried to use the mouse tracker in the navigator exp. in plz of other IGSTK trackers. As there is not reference tool I changed the initializing to make the tracker the world reference and then attached the tracker tool to the tracker.<br>
tracker->RequestSetTransformAndParent(identity, m_WorldReference); is what I did in the Tracker Initializing.<br><br>Then when accepting the tracker fiducials, I did the following. But the transforms are not achieved by the tracker tool's transform observer. I tried various things but nothing was succesful. So if anyone could help me as quick as possible that would be very helpful. Also I should ask here whether we should attach the tracker to the GUI to use it as a mouse tracker, I mean to get the coordinates. The code snippets is given below. <br>
<br>void <br>Navigator::AcceptTrackerFiducialProcessing()<br>{<br> igstkLogMacro2( m_Logger, DEBUG, "igstk::Navigator::"<br> "AcceptTrackerFiducialProcessing called...\n");<br><br> typedef igstk::TransformObserver ObserverType;<br>
ObserverType::Pointer transformObserver = ObserverType::New();<br> transformObserver->ObserveTransformEventsFrom( trackerTool );<br> typedef ::itk::Vector<double, 3> VectorType;<br> typedef ::itk::Versor<double> VersorType;<br>
TransformType transform;<br> VectorType position;<br> transformObserver->Clear();<br> trackerTool->RequestComputeTransformTo( m_WorldReference );<br><br> int n = m_FiducialsPointList->value();<br> int m = m_FiducialsPointList->size();<br>
<br> if (transformObserver->GotTransform())<br> {<br> transform=transformObserver->GetTransform();<br> position = transform.GetTranslation();<br> std::cout << "Trackertool :"<br> << trackerTool->GetTrackerToolIdentifier()<br>
<< "\t\t Position = (" << position[0]<br> << "," << position[1] << "," << position[2]<br> << ")" << std::endl;<br> m_LandmarksContainer[n]= TransformToPoint( transform );<br>
}<br> m_AcceptedLandmarksContainer[n] = true;<br><br> m_AxialFiducialRepresentationVector[n]->SetColor( 0.0, 1.0, 0.0 );<br> m_SagittalFiducialRepresentationVector[n]->SetColor( 0.0, 1.0, 0.0 );<br> m_CoronalFiducialRepresentationVector[n]->SetColor( 0.0, 1.0, 0.0 );<br>
<br> if ( n < m )<br> {<br> m_FiducialsPointList->value(n+1);<br> }<br> else<br> {<br> m_FiducialsPointList->value(0);<br> }<br><br> this->RequestChangeSelectedFiducial();<br><br> fl_beep( FL_BEEP_MESSAGE );<br>
<br> AcceptedLandmarkPointContainerType::const_iterator iter;<br> iter = m_AcceptedLandmarksContainer.begin();<br><br> unsigned int numberOfAcceptedLandmarks = 0;<br> for (;iter != m_AcceptedLandmarksContainer.end(); iter++)<br>
{<br> if (iter->second)<br> numberOfAcceptedLandmarks++;<br> }<br><br> if ( numberOfAcceptedLandmarks >= 3 )<br> {<br> m_RegisterButton->label("Ready"); <br> m_RegisterButton->color(FL_GREEN);<br>
}<br><br>}<br>