CustusX  22.04-rc5
An IGT application
cxSeansVesselRegistrationWidget.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 <QPushButton>
15 #include <QLabel>
16 #include <QSpinBox>
17 #include <QCheckBox>
18 #include <QGroupBox>
19 #include <vtkCellArray.h>
20 #include "cxTypeConversions.h"
21 #include "cxLogger.h"
22 #include "cxTimedAlgorithm.h"
26 #include "cxMesh.h"
27 #include "cxView.h"
28 #include "cxGeometricRep.h"
29 #include "cxGraphicalPrimitives.h"
30 #include "cxRegistrationService.h"
31 #include "cxViewService.h"
32 #include "cxPatientModelService.h"
33 #include "cxICPWidget.h"
34 #include "cxMeshInView.h"
36 #include "cxSpaceProvider.h"
37 #include "cxSpaceListener.h"
38 #include "cxProfile.h"
39 
40 namespace cx
41 {
42 
44  ICPRegistrationBaseWidget(services, parent,
45  "org_custusx_registration_method_vessel_seans_widget",
46  "Seans Vessel Registration")
47 {
48 }
49 
51 {
52  mSpaceListenerMoving = mServices->spaceProvider()->createListener();
53  mSpaceListenerFixed = mServices->spaceProvider()->createListener();
54  connect(mSpaceListenerMoving.get(), &SpaceListener::changed, this, &SeansVesselRegistrationWidget::onSpacesChanged);
55  connect(mSpaceListenerFixed.get(), &SpaceListener::changed, this, &SeansVesselRegistrationWidget::onSpacesChanged);
56 
57  connect(mServices->registration().get(), &RegistrationService::fixedDataChanged,
59  connect(mServices->registration().get(), &RegistrationService::movingDataChanged,
61 
62  QVBoxLayout* layout = new QVBoxLayout(this);
63  QGridLayout* entryLayout = new QGridLayout;
64  entryLayout->setColumnStretch(1, 1);
65 
66  mFixedImage.reset(new StringPropertyRegistrationFixedImage(mServices->registration(), mServices->patient()));
67  new LabeledComboBoxWidget(this, mFixedImage, entryLayout, 0);
68  mMovingImage.reset(new StringPropertyRegistrationMovingImage(mServices->registration(), mServices->patient()));
69  new LabeledComboBoxWidget(this, mMovingImage, entryLayout, 1);
70 
71  layout->addLayout(entryLayout);
72  layout->addWidget(mICPWidget);
73 
74  this->inputChanged();
75  this->onSettingsChanged();
76 }
77 
79 {
80 }
81 
83 {
84  DataPtr moving = mServices->registration()->getMovingData();
85  DataPtr fixed = mServices->registration()->getFixedData();
86  QString logPath = mServices->patient()->getActivePatientFolder() + "/Logs/";
87 
88  mRegistrator->initialize(moving, fixed, logPath);
89 }
90 
92 {
93  if (mObscuredListener->isObscured())
94  return;
95 
96  DataPtr moving = mServices->registration()->getMovingData();
97  DataPtr fixed = mServices->registration()->getFixedData();
98 
99  mSpaceListenerFixed->setSpace(mServices->spaceProvider()->getD(fixed));
100  mSpaceListenerMoving->setSpace(mServices->spaceProvider()->getD(moving));
101 
102  this->onSpacesChanged();
103 }
104 
106 {
107  mServices->registration()->addImage2ImageRegistration(delta, "Vessel based");
108 }
109 
111 {
112  this->inputChanged();
113 }
114 
115 
116 
117 
118 
119 }//namespace cx
virtual void applyRegistration(Transform3D delta)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
SeansVesselRegistrationWidget(RegServicesPtr services, QWidget *parent)
Composite widget for string selection.
void fixedDataChanged(QString uid)
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class WidgetObscuredListener > mObscuredListener
boost::shared_ptr< class RegServices > RegServicesPtr
Definition: cxRegServices.h:20
void movingDataChanged(QString uid)
Namespace for all CustusX production code.