Fraxinus  2023.01.05-dev+develop.0da12
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
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
FastPatientRegistrationWidget(RegServicesPtr services, QWidget *parent)
Widget used as a tab in the ContexDockWidget for patient registration.
virtual Transform3D getTargetTransform() const
virtual void setTargetLandmark(QString uid, Vector3D p_target)
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
#define CX_LOG_WARNING
Definition: cxLogger.h:98
Namespace for all CustusX production code.