36 #include <QVBoxLayout>
37 #include <QPushButton>
38 #include <QTableWidget>
39 #include <QTableWidgetItem>
40 #include <QHeaderView>
43 #include <vtkDoubleArray.h>
44 #include <vtkImageData.h>
62 LandmarkImageRegistrationWidget::LandmarkImageRegistrationWidget(
RegServices services, QWidget* parent,
63 QString objectName, QString windowTitle) :
76 mAddLandmarkButton->setToolTip(
"Add landmark");
77 mAddLandmarkButton->setDisabled(
true);
95 QHBoxLayout* landmarkButtonsLayout =
new QHBoxLayout;
96 landmarkButtonsLayout->addWidget(mAddLandmarkButton);
109 "<h3>Landmark based image registration.</h3>"
110 "<p>Sample landmarks in the data set. </p>"
111 "<p><i>Click the volume and either add or resample landmarks.</i></p>"
112 "<p>Landmark image registration will move the active image to the fixed image</p>"
140 DataPtr LandmarkImageRegistrationWidget::getCurrentData()
const
150 reportError(
"Could not find a rep to add the landmark to.");
154 DataPtr image = this->getCurrentData();
159 Vector3D pos_r = PickerRep->getPosition();
160 Vector3D pos_d = image->get_rMd().inv().coord(pos_r);
161 image->getLandmarks()->setLandmark(
Landmark(uid, pos_d));
172 reportError(
"Could not find a rep to edit the landmark for.");
176 DataPtr image = this->getCurrentData();
181 Vector3D pos_r = PickerRep->getPosition();
182 Vector3D pos_d = image->get_rMd().inv().coord(pos_r);
183 image->getLandmarks()->setLandmark(
Landmark(uid, pos_d));
190 DataPtr image = this->getCurrentData();
208 bool loaded = this->getCurrentData() != 0;
214 DataPtr image = this->getCurrentData();
217 mAddLandmarkButton->setToolTip(QString(
"Add landmark to image %1").arg(image->getName()));
218 mEditLandmarkButton->setToolTip(QString(
"Resample landmark in image %1").arg(image->getName()));
273 DataPtr image = this->getCurrentData();
277 return image->getLandmarks()->getLandmarks();
285 DataPtr image = this->getCurrentData();
287 return Transform3D::Identity();
288 return image->get_rMd();
293 DataPtr image = this->getCurrentData();
296 image->getLandmarks()->setLandmark(
Landmark(uid, p_target));
301 DataPtr image = this->getCurrentData();
304 return image->getName();
void reportError(QString msg)
static ImageLandmarksSourcePtr New()
One landmark, or fiducial, coordinate.
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class Image > ImagePtr
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class PickerRep > PickerRepPtr
Picking of points in an image.
void setPrimarySource(LandmarksSourcePtr primary)
static StringPropertySelectDataPtr New(PatientModelServicePtr patientModelService)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
VisualizationServicePtr visualizationService
boost::shared_ptr< LandmarksSource > LandmarksSourcePtr
std::map< QString, class Landmark > LandmarkMap
TrackingServicePtr trackingService
PatientModelServicePtr patientModelService
boost::shared_ptr< class LandmarkRep > LandmarkRepPtr
RegistrationServicePtr registrationService