16 #include <vtkImageData.h>
17 #include <vtkDoubleArray.h>
18 #include <vtkVectorText.h>
19 #include <vtkFollower.h>
20 #include <vtkSphereSource.h>
21 #include <vtkPolyDataMapper.h>
22 #include <vtkProperty.h>
23 #include <vtkRenderer.h>
24 #include <vtkRenderWindow.h>
30 #include "boost/bind.hpp"
38 connect(mDataManager->getPatientLandmarks().get(), SIGNAL(landmarkAdded(QString)),
this, SIGNAL(
changed()));
39 connect(mDataManager->getPatientLandmarks().get(), SIGNAL(landmarkRemoved(QString)),
this, SIGNAL(
changed()));
40 connect(mDataManager.get(), SIGNAL(rMprChanged()),
this, SIGNAL(
changed()));
44 return mDataManager->getPatientLandmarks()->getLandmarks();
48 return mDataManager->get_rMpr();
77 disconnect(mData->getLandmarks().get(), SIGNAL(landmarkAdded(QString)),
this, SIGNAL(
changed()));
78 disconnect(mData->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)),
this, SIGNAL(
changed()));
79 disconnect(mData.get(), SIGNAL(transformChanged()),
this, SIGNAL(
changed()));
86 connect(mData->getLandmarks().get(), SIGNAL(landmarkAdded(QString)),
this, SIGNAL(
changed()));
87 connect(mData->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)),
this, SIGNAL(
changed()));
88 connect(mData.get(), SIGNAL(transformChanged()),
this, SIGNAL(
changed()));
98 return mData->getLandmarks()->getLandmarks();
104 return Transform3D::Identity();
105 return mData->get_rMd();
110 Vector3D imageCenter = mData->boundingBox().center();
112 Vector3D numberPosition = p_l + 10.0 * centerToSkinVector;
113 return numberPosition;
127 mDataManager(dataManager),
128 mInactiveColor(QColor::fromRgbF(0.5,0.5,0.5)),
129 mColor(QColor(Qt::green)),
131 mSecondaryColor(QColor::fromRgbF(0, 0.9, 0.5)),
132 mShowLandmarks(true),
199 for (LandmarkGraphicsMapType::iterator iter =
mGraphics.begin(); iter !=
mGraphics.end(); ++iter)
201 if (iter->second.mPrimaryPoint)
202 iter->second.mPrimaryPoint->getActor()->SetVisibility(on);
203 if (iter->second.mSecondaryPoint)
204 iter->second.mSecondaryPoint->getActor()->SetVisibility(on);
205 if (iter->second.mText)
206 iter->second.mText->getActor()->SetVisibility(on);
207 if (iter->second.mLine)
208 iter->second.mLine->getActor()->SetVisibility(on);
219 for (LandmarkPropertyMap::iterator it = props.begin(); it != props.end(); ++it)
241 if (!view || !view->getRenderer())
263 if (property.getUid().isEmpty())
274 if (!property.getActive())
289 primary =
mPrimary->getLandmarks()[uid];
290 if (!primary.
getUid().isEmpty())
301 current.
mText->setText(property.getName());
302 current.
mText->setSizeInNormalizedViewport(
true, 0.025);
303 current.
mText->setColor(color);
308 current.
mText->setPosition(text_r);
318 if (!secondary.
getUid().isEmpty())
330 if (!secondary.
getUid().isEmpty() && !secondary.
getUid().isEmpty())
333 current.
mLine->setColor(secondaryColor);
334 current.
mLine->setStipple(0x0F0F);
336 current.
mLine->setValue(primary_r, secondary_r);
348 for (LandmarkGraphicsMapType::iterator iter =
mGraphics.begin(); iter !=
mGraphics.end(); ++iter)
356 primaryPoint->setRadius(sphereSize);
362 secondaryPoint->setRadius(sphereSize);