12 #include <vtkPolyData.h> 38 RegistrationBaseWidget(services, parent,
"org_custusx_registration_method_bronchoscopy_image2image_widget",
39 "Bronchoscopy Registration"),
42 mVerticalLayout =
new QVBoxLayout(
this);
50 void BronchoscopyImage2ImageRegistrationWidget::setup()
52 mOptions =
profile()->getXmlSettings().descend(
"bronchoscopyregistrationimage2imagewidget");
55 mSelectMeshFixedWidget->setValueName(
"Centerline fixed image: ");
58 mSelectMeshMovingWidget->setValueName(
"Centerline moving image: ");
62 mRegisterButton =
new QPushButton(
"Register");
63 connect(mRegisterButton, SIGNAL(clicked()),
this, SLOT(registerSlot()));
66 mVerticalLayout->setMargin(0);
70 mVerticalLayout->addWidget(mRegisterButton);
72 mVerticalLayout->addStretch();
77 return QString(
"Registration of CT images based on airway centerlines");
80 void BronchoscopyImage2ImageRegistrationWidget::registerSlot()
83 if(!mSelectMeshFixedWidget->getMesh())
88 if(!mSelectMeshMovingWidget->getMesh())
94 vtkPolyDataPtr centerlineFixed = mSelectMeshFixedWidget->getMesh()->getVtkPolyData();
95 Transform3D rMdFixed = mSelectMeshFixedWidget->getMesh()->get_rMd();
97 vtkPolyDataPtr centerlineMoving = mSelectMeshMovingWidget->getMesh()->getVtkPolyData();
98 Transform3D rMdMoving = mSelectMeshMovingWidget->getMesh()->get_rMd();
100 Transform3D d_M_d =
Transform3D(mBronchoscopyRegistration->runBronchoscopyRegistrationImage2Image(centerlineFixed, centerlineMoving));
102 DataPtr fixedData = mSelectMeshFixedWidget->getData();
103 mServices->registration()->setFixedData(fixedData);
104 DataPtr movingData = mSelectMeshMovingWidget->getData();
105 mServices->registration()->setMovingData(movingData);
107 Transform3D delta_pre_rMd = rMdFixed * d_M_d * rMdMoving.inv();
108 mServices->registration()->addImage2ImageRegistration(delta_pre_rMd,
"Bronchoscopy: centerline to centerline");
111 void BronchoscopyImage2ImageRegistrationWidget::clearDataOnNewPatient()
cxResource_EXPORT ProfilePtr profile()
void reportError(QString msg)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class RegServices > RegServicesPtr
vtkSmartPointer< vtkPolyData > vtkPolyDataPtr
static StringPropertySelectMeshPtr New(PatientModelServicePtr patientModelService)
Namespace for all CustusX production code.