35 #include <QPushButton>
51 mPlateRegistrationButton(new QPushButton(
"Load registration points", this)),
52 mReferenceToolInfoLabel(new QLabel(
"", this))
54 connect(mPlateRegistrationButton, SIGNAL(clicked()),
this, SLOT(plateRegistrationSlot()));
57 QVBoxLayout* toptopLayout =
new QVBoxLayout(
this);
58 toptopLayout->addWidget(mReferenceToolInfoLabel);
59 toptopLayout->addWidget(mPlateRegistrationButton);
60 toptopLayout->addStretch();
62 this->internalUpdate();
73 "<h3>Plate registration.</h3>"
74 "<p>Internally register the reference plates reference points as landmarks.</p>"
75 "<p><i>Click the button to load landmarks.</i></p>"
79 void PlateRegistrationWidget::showEvent(QShowEvent* event)
83 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
85 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
90 void PlateRegistrationWidget::hideEvent(QHideEvent* event)
92 BaseWidget::hideEvent(event);
94 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
96 this, &PlateRegistrationWidget::landmarkUpdatedSlot);
101 void PlateRegistrationWidget::landmarkUpdatedSlot()
106 void PlateRegistrationWidget::plateRegistrationSlot()
116 std::map<int, Vector3D> referencePoints = refTool->getReferencePoints();
117 if(referencePoints.empty())
119 reportDebug(
"No referenceppoints in reftool "+refTool->getName());
123 std::map<int, Vector3D>::iterator it = referencePoints.begin();
124 for(; it != referencePoints.end(); ++it)
133 LandmarkPropertyMap::iterator landmarkIt = map.begin();
134 for(; landmarkIt != map.end(); ++landmarkIt)
140 mPlateRegistrationButton->setDisabled(
true);
143 void PlateRegistrationWidget::internalUpdate()
147 QString labelText =
"";
148 if(!refTool || refTool->getReferencePoints().size()<1)
150 mPlateRegistrationButton->setDisabled(
true);
152 labelText.append(
"Configure the tracker to have <br>a reference frame that has at least <br>one reference point.");
155 mPlateRegistrationButton->setEnabled(
true);
157 labelText =
"<b>Reference tool selected:</b> <br>";
158 labelText.append(
"Tool name: <i>"+refTool->getName()+
"</i><br>");
159 labelText.append(
"Number of defined reference points: <i>"+
qstring_cast(refTool->getReferencePoints().size())+
"</i>");
162 mReferenceToolInfoLabel->setText(labelText);
QString qstring_cast(const T &val)
void landmarkAdded(QString uid)
VisualizationServicePtr visualizationService
TrackingServicePtr trackingService
std::map< QString, LandmarkProperty > LandmarkPropertyMap
PatientModelServicePtr patientModelService
void landmarkRemoved(QString uid)
void reportDebug(QString msg)
RegistrationServicePtr registrationService
boost::shared_ptr< class Tool > ToolPtr