NorMIT-nav  22.09
An IGT application
cxFastPatientRegistrationWidget.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
13 
14 #include <QTableWidgetItem>
15 
16 #include "cxRegistrationService.h"
17 #include "cxViewService.h"
18 #include "cxLogger.h"
19 
20 namespace cx
21 {
23  PatientLandMarksWidget(services, parent,
24  "org_custusx_registration_method_fast_landmark_image_to_patient_patient_landmarks_widget",
25  "Fast Patient Registration")
26 {
27 }
28 
30 {}
31 
32 void FastPatientRegistrationWidget::performRegistration()
33 {
34  mServices->registration()->doFastRegistration_Translation();
36 }
37 
39 {
40  QTableWidgetItem* item = getLandmarkTableItem();
41  if(!item)
42  {
43  CX_LOG_WARNING() << "FastPatientRegistrationWidget::pointSampled() Cannot get item from mLandmarkTableWidget";
44  return;
45  }
46  QString uid = item->data(Qt::UserRole).toString();
47 
48  Transform3D rMtarget = this->getTargetTransform();
49  Vector3D p_target = rMtarget.inv().coord(p_r);
50 
51  this->setTargetLandmark(uid, p_target);
52  this->performRegistration();
53 }
54 
55 }//namespace cx
cxLogger.h
cx::LandmarkRegistrationWidget::getLandmarkTableItem
QTableWidgetItem * getLandmarkTableItem()
Definition: cxLandmarkRegistrationWidget.cpp:400
cx::FastPatientRegistrationWidget::~FastPatientRegistrationWidget
virtual ~FastPatientRegistrationWidget()
Definition: cxFastPatientRegistrationWidget.cpp:29
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::FastPatientRegistrationWidget::FastPatientRegistrationWidget
FastPatientRegistrationWidget(RegServicesPtr services, QWidget *parent)
Definition: cxFastPatientRegistrationWidget.cpp:22
cxFastPatientRegistrationWidget.h
cx::RegistrationBaseWidget::mServices
RegServicesPtr mServices
Definition: cxRegistrationBaseWidget.h:35
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cxViewService.h
cx::LandmarkRegistrationWidget::updateAverageAccuracyLabel
void updateAverageAccuracyLabel()
Definition: cxLandmarkRegistrationWidget.cpp:312
cx::RegServicesPtr
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
cx::PatientLandMarksWidget::getTargetTransform
virtual Transform3D getTargetTransform() const
Definition: cxPatientLandMarksWidget.cpp:167
cx::PatientLandMarksWidget::setTargetLandmark
virtual void setTargetLandmark(QString uid, Vector3D p_target)
Definition: cxPatientLandMarksWidget.cpp:173
cx::FastPatientRegistrationWidget::pointSampled
virtual void pointSampled(Vector3D p_r)
Definition: cxFastPatientRegistrationWidget.cpp:38
cxRegistrationService.h
CX_LOG_WARNING
#define CX_LOG_WARNING
Definition: cxLogger.h:98
cx::PatientLandMarksWidget
Widget used as a tab in the ContexDockWidget for patient registration.
Definition: cxPatientLandMarksWidget.h:31
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42