34 #include <vtkPolyData.h> 60 RegistrationBaseWidget(services, parent,
"org_custusx_registration_method_bronchoscopy_image2image_widget",
61 "Bronchoscopy Registration"),
64 mVerticalLayout =
new QVBoxLayout(
this);
72 void BronchoscopyImage2ImageRegistrationWidget::setup()
74 mOptions =
profile()->getXmlSettings().descend(
"bronchoscopyregistrationimage2imagewidget");
77 mSelectMeshFixedWidget->setValueName(
"Centerline fixed image: ");
80 mSelectMeshMovingWidget->setValueName(
"Centerline moving image: ");
84 mRegisterButton =
new QPushButton(
"Register");
85 connect(mRegisterButton, SIGNAL(clicked()),
this, SLOT(registerSlot()));
88 mVerticalLayout->setMargin(0);
92 mVerticalLayout->addWidget(mRegisterButton);
94 mVerticalLayout->addStretch();
99 return QString(
"Registration of CT images based on airway centerlines");
102 void BronchoscopyImage2ImageRegistrationWidget::registerSlot()
105 if(!mSelectMeshFixedWidget->getMesh())
110 if(!mSelectMeshMovingWidget->getMesh())
116 vtkPolyDataPtr centerlineFixed = mSelectMeshFixedWidget->getMesh()->getVtkPolyData();
117 Transform3D rMdFixed = mSelectMeshFixedWidget->getMesh()->get_rMd();
119 vtkPolyDataPtr centerlineMoving = mSelectMeshMovingWidget->getMesh()->getVtkPolyData();
120 Transform3D rMdMoving = mSelectMeshMovingWidget->getMesh()->get_rMd();
122 Transform3D updated_rMdMoving =
Transform3D(mBronchoscopyRegistration->runBronchoscopyRegistrationImage2Image(centerlineFixed, centerlineMoving));
124 DataPtr fixedData = mSelectMeshFixedWidget->getData();
125 mServices->registration()->setFixedData(fixedData);
126 DataPtr movingData = mSelectMeshMovingWidget->getData();
127 mServices->registration()->setMovingData(movingData);
129 Transform3D new_rMdMoving = updated_rMdMoving * rMdMoving.inv();
130 mServices->registration()->addImage2ImageRegistration(new_rMdMoving,
"Bronchoscopy: centerline to centerline");
133 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.