22 ,m_QuaternionTransform(NULL)
23 ,m_SourceLandmarksFromNavigationDatas(NULL)
24 ,m_TargetLandmarksFromNavigationDatas(NULL)
35 m_QuaternionTransform = NULL;
41 if(m_SourceLandmarksFromNavigationDatas.IsNotNull())
42 m_SourceLandmarksFromNavigationDatas->Clear();
46 if(sourceNavigationDatas.empty())
52 if(sourceNavigationDatas.size() < 3)
53 this->CreateLandmarkPointsForSingleNavigationData(m_SourceLandmarksFromNavigationDatas, sourceNavigationDatas);
55 for(
unsigned int i=0; i < sourceNavigationDatas.size(); ++i){
56 mitk::Point3D point = sourceNavigationDatas.at(i)->GetPosition();
57 m_SourceLandmarksFromNavigationDatas->InsertPoint(i,point);
61 this->InitializeTransform();
67 if(m_TargetLandmarksFromNavigationDatas.IsNotNull())
68 m_TargetLandmarksFromNavigationDatas->Clear();
72 if(targetNavigationDatas.empty())
78 if(targetNavigationDatas.size() < 3)
79 this->CreateLandmarkPointsForSingleNavigationData(m_TargetLandmarksFromNavigationDatas, targetNavigationDatas);
81 for(
unsigned int i=0; i < targetNavigationDatas.size(); ++i){
82 mitk::Point3D point = targetNavigationDatas.at(i)->GetPosition();
83 m_TargetLandmarksFromNavigationDatas->InsertPoint(i,point);
87 this->InitializeTransform();
92 bool sameSize = m_SourceLandmarksFromNavigationDatas->GetSize() == m_TargetLandmarksFromNavigationDatas->GetSize();
96 if(m_SourceLandmarksFromNavigationDatas->GetSize() >= 3 && m_TargetLandmarksFromNavigationDatas->GetSize() >= 3)
98 m_SourcePoints.clear();
99 m_TargetPoints.clear();
101 this->SetSourceLandmarks(this->GetSourceLandmarks());
102 this->SetTargetLandmarks(this->GetTargetLandmarks());
114 m_SourceLandmarksFromNavigationDatas->Clear();
115 m_TargetLandmarksFromNavigationDatas->Clear();
118 m_TargetPoints.clear();
119 m_SourcePoints.clear();
127 if(m_QuaternionTransform.IsNull())
128 return landmarkContainer;
130 for(
unsigned int i=0; i < navigationDatas.size(); ++i)
153 vnl_quaternion<double>
const vnlQuatIn(quatIn.x(), quatIn.y(), quatIn.z(), quatIn.r());
155 m_QuaternionTransform->SetRotation(vnlQuatIn);
158 pointA = m_QuaternionTransform->TransformPoint(pointA);
159 pointB = m_QuaternionTransform->TransformPoint(pointB);
160 pointC = m_QuaternionTransform->TransformPoint(pointC);
163 pointA[0] += nd->GetPosition()[0];
164 pointA[1] += nd->GetPosition()[1];
165 pointA[2] += nd->GetPosition()[2];
167 pointB[0] += nd->GetPosition()[0];
168 pointB[1] += nd->GetPosition()[1];
169 pointB[2] += nd->GetPosition()[2];
171 pointC[0] += nd->GetPosition()[0];
172 pointC[1] += nd->GetPosition()[1];
173 pointC[2] += nd->GetPosition()[2];
176 int currSize = landmarkContainer->GetSize();
178 landmarkContainer->InsertPoint(currSize++,pointA);
179 landmarkContainer->InsertPoint(currSize++,pointB);
180 landmarkContainer->InsertPoint(currSize++,pointC);
183 return landmarkContainer;
188 return m_SourceLandmarksFromNavigationDatas;
193 return m_TargetLandmarksFromNavigationDatas;
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
mitk::Quaternion OrientationType
Type that holds the orientation part of the tracking data.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.