Medical Imaging Interaction Toolkit  2018.4.99-936b789b
Medical Imaging Interaction Toolkit
mitkPlaneLandmarkProjector.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
16 {
17 }
18 
20 {
21 }
22 
24 {
25  // we do not need any special pre- or post-transform, thus simply set
26  // the InterpolatingAbstractTransform as m_CompleteAbstractTransform.
28 }
29 
30 void mitk::PlaneLandmarkProjector::ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks)
31 {
32  if (m_ProjectionPlane.IsNull())
33  {
34  itkExceptionMacro(<< "m_ProjectionPlane is not set.");
35  }
36 
38 
39  m_ProjectedLandmarks->Initialize();
40  m_FinalTargetLandmarks = targetLandmarks;
41 
42  mitk::PointSet::DataType::PointsContainer::ConstIterator pointiterator, start = targetLandmarks->Begin();
43  mitk::PointSet::DataType::PointsContainer::ElementIdentifier id;
44 
45  mitk::Point3D point;
46  mitk::Point3D projectedPoint;
47 
48  unsigned int size = targetLandmarks->Size();
49  m_ProjectedLandmarks->Reserve(size);
50  for (id = 0, pointiterator = start; id < size; ++id, ++pointiterator)
51  {
52  point = pointiterator->Value();
53  m_ProjectionPlane->Project(point, projectedPoint);
54 
55  m_ProjectedLandmarks->InsertElement(id, projectedPoint);
56  }
57 }
mitk::PlaneGeometry::ConstPointer m_ParameterPlane
mitk::PointSet::DataType::PointsContainer::ConstPointer m_FinalTargetLandmarks
void ComputeCompleteAbstractTransform() override
Compute the transform from parameter space to world space incorporating the given interpolating trans...
virtual vtkAbstractTransform * GetInterpolatingAbstractTransform() const
Get the interpolating (world-space-to-world-space) transform, which uses the landmarks.
void ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks) override
vtkAbstractTransform * m_CompleteAbstractTransform
mitk::PlaneGeometry::ConstPointer m_ProjectionPlane
mitk::PointSet::DataType::PointsContainer::Pointer m_ProjectedLandmarks