35 #include <QVBoxLayout>
57 this->setObjectName(
"TrackedCenterlineWidget");
58 this->setWindowTitle(
"Tracked Centerline");
73 "<h3>Tracked Centerline.</h3>"
74 "<p><i>Record the tool movement as a centerline.</i></br>"
114 mSessionID = sessionId;
125 if(transforms_prMt.empty())
127 reportError(
"Could not find any tracking data from session "+mSessionID+
". Aborting volume tracking data generation.");
156 TrackingService::ToolMap::iterator toolIt = tools.begin();
159 for(; toolIt != tools.end(); ++toolIt)
161 activeRep3D = mServices->visualizationService->get3DReps()->findFirst<
ToolRep3D>(toolIt->second);
165 activeRep3D->getTracer()->start();
173 TrackingService::ToolMap::iterator toolIt = tools.begin();
176 for(; toolIt != tools.end(); ++toolIt)
178 activeRep3D = mServices->visualizationService->get3DReps()->findFirst<
ToolRep3D>(toolIt->second);
181 if (activeRep3D->getTracer()->isRunning())
184 activeRep3D->getTracer()->clear();
192 double startTime = session->getStartTime();
193 double stopTime = session->getStopTime();
195 ToolPtr tool = this->findTool(startTime, stopTime);
198 reportWarning(
"Found no tool with tracking data from the given session.");
202 retval = tool->getSessionHistory(startTime, stopTime);
207 ToolPtr TrackedCenterlineWidget::findTool(
double startTime,
double stopTime)
211 SessionToolHistoryMap toolTransformMap = mServices->getToolManager()->getSessionHistory(startTime, stopTime);
212 if(toolTransformMap.size() == 1)
214 report(
"Found one tool("+toolTransformMap.begin()->first->getName()+
") with relevant data.");
215 retval = toolTransformMap.begin()->first;
217 else if(toolTransformMap.size() > 1)
219 reportWarning(
"Found more than one tool with relevant data, user needs to choose which one to use for tracked centerline extraction.");
221 retval = toolTransformMap.begin()->first;
223 }
else if(toolTransformMap.empty())
225 reportWarning(
"Could not find any session history for given session.");
void reportError(QString msg)
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
boost::shared_ptr< class VisServices > VisServicesPtr
std::map< ToolPtr, TimedTransformMap > SessionToolHistoryMap
boost::shared_ptr< class RecordSession > RecordSessionPtr
void reportWarning(QString msg)
void loadMeshFromToolTransforms(PatientModelServicePtr dataManager, TimedTransformMap transforms_prMt)
cxLogicManager_EXPORT AcquisitionServicePtr acquisitionService()
std::map< QString, ToolPtr > ToolMap
boost::shared_ptr< class ToolRep3D > ToolRep3DPtr
std::map< double, Transform3D > TimedTransformMap
boost::shared_ptr< class Tool > ToolPtr