void mitk::NavigationDataReferenceTransformFilter::SetTargetLandmarks(mitk::PointSet::Pointer targetPointSet)
{
  m_OneSourceRegistration = false;
  m_ReferenceRegistration = false;


  m_TargetPoints.clear();
  TransformInitializerType::LandmarkPointType lPoint;


  for (mitk::PointSet::PointsContainer::ConstIterator it = targetPointSet->GetPointSet()->GetPoints()->Begin(); 
    it != targetPointSet->GetPointSet()->GetPoints()->End(); it++)
  {
    mitk::FillVector3D(lPoint, it->Value().GetElement(0), it->Value().GetElement(1), it->Value().GetElement(2));
    m_TargetPoints.push_back(lPoint);
  }

  if(m_TargetPoints.size() < 1)
  {
    itkExceptionMacro("TargetPointSet must contain at least 1 point");
  }

  if(this->IsInitialized())
    this->UpdateLandmarkTransform(m_SourcePoints, m_TargetPoints);

}
Ejemplo n.º 2
0
std::string mitk::NavigationToolWriter::ConvertPointSetToString(mitk::PointSet::Pointer pointSet)
  {
  std::stringstream returnValue;
  mitk::PointSet::PointDataIterator it;
  for ( it = pointSet->GetPointSet()->GetPointData()->Begin();it != pointSet->GetPointSet()->GetPointData()->End();it++ )
    {
    mitk::Point3D thisPoint = pointSet->GetPoint(it->Index());
    returnValue << it->Index() << ";" << ConvertPointToString(thisPoint) << "|";
    }
  return returnValue.str();
  }
void mitk::NavigationDataLandmarkTransformFilter::SetTargetLandmarks(mitk::PointSet::Pointer mitkTargetPointSet)
{
  m_TargetPoints.clear();
  TransformInitializerType::LandmarkPointType lPoint;
  for (mitk::PointSet::PointsContainer::ConstIterator it = mitkTargetPointSet->GetPointSet()->GetPoints()->Begin();
    it != mitkTargetPointSet->GetPointSet()->GetPoints()->End(); ++it)
  {
    mitk::FillVector3D(lPoint, it->Value().GetElement(0), it->Value().GetElement(1), it->Value().GetElement(2));
    m_TargetPoints.push_back(lPoint);
  }

  if (m_TargetPoints.size() < 3)
  {
    itkExceptionMacro("TargetPointSet must contain at least 3 points");
  }

  if (this->IsInitialized())
    this->InitializeLandmarkTransform(m_SourcePoints, m_TargetPoints);
}