48 m_Controls.m_comboBoxFixedSurface->SetDataStorage(this->GetDataStorage());
49 m_Controls.m_comboBoxFixedSurface->SetAutoSelectNewItems(
false);
50 m_Controls.m_comboBoxFixedSurface->SetPredicate(mitk::NodePredicateDataType::New(
"Surface"));
51 m_Controls.m_comboBoxMovingSurface->SetDataStorage(this->GetDataStorage());
52 m_Controls.m_comboBoxMovingSurface->SetAutoSelectNewItems(
false);
53 m_Controls.m_comboBoxMovingSurface->SetPredicate(mitk::NodePredicateDataType::New(
"Surface"));
65mitk::Surface::Pointer MovingSurface =
dynamic_cast<mitk::Surface*
>(
m_Controls.m_comboBoxMovingSurface->GetSelectedNode()->GetData());
66mitk::Surface::Pointer FixedSurface =
dynamic_cast<mitk::Surface*
>(
m_Controls.m_comboBoxFixedSurface->GetSelectedNode()->GetData());
67double Threshold =
m_Controls.m_threshold->value();
68int maxIterations =
m_Controls.m_maxIterations->value();
69itk::Matrix<double,3,3> TransformationR;
70itk::Vector<double,3> TransformationT;
73std::string ErrorMessage;
75 FixedSurface->GetVtkPolyData(),
79 FRE, n, ErrorMessage,maxIterations);
80mitk::AffineTransform3D::Pointer T = mitk::AffineTransform3D::New();
81T->SetTranslation(TransformationT);
82T->SetMatrix(TransformationR);
84MovingSurface->GetGeometry()->SetIndexToWorldTransform(T);
85MITK_INFO <<
"Performed ICP";
86MITK_INFO <<
"n:" << n;
87MITK_INFO <<
"R:" << TransformationR;
88MITK_INFO <<
"T:" << TransformationT;
89MITK_INFO <<
"Message:" << ErrorMessage;
91this->RequestRenderWindowUpdate();
static bool StandardICPPointRegisterAlgorithm(mitk::PointSet::Pointer MovingSet, mitk::PointSet::Pointer StaticSet, double Threshold, itk::Matrix< double, 3, 3 > &TransformationR, itk::Vector< double, 3 > &TransformationT, double &FRE, int &n, std::string &ErrorMessage, int max_iterations=100)
This method executes the standard iterative closest point algorithm to register a moving pointset X o...