Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
20 {
21 }
22 
24 {
25 }
26 
28 {
29  // we do not need any special pre- or post-transform, thus simply set
30  // the InterpolatingAbstractTransform as m_CompleteAbstractTransform.
31  m_CompleteAbstractTransform = GetInterpolatingAbstractTransform();
32 }
33 
34 void mitk::PlaneLandmarkProjector::ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks)
35 {
36  if (m_ProjectionPlane.IsNull())
37  {
38  itkExceptionMacro(<< "m_ProjectionPlane is not set.");
39  }
40 
41  m_ParameterPlane = m_ProjectionPlane;
42 
43  m_ProjectedLandmarks->Initialize();
44  m_FinalTargetLandmarks = targetLandmarks;
45 
46  mitk::PointSet::DataType::PointsContainer::ConstIterator pointiterator, start = targetLandmarks->Begin();
47  mitk::PointSet::DataType::PointsContainer::ElementIdentifier id;
48 
49  mitk::Point3D point;
50  mitk::Point3D projectedPoint;
51 
52  unsigned int size = targetLandmarks->Size();
53  m_ProjectedLandmarks->Reserve(size);
54  for (id = 0, pointiterator = start; id < size; ++id, ++pointiterator)
55  {
56  point = pointiterator->Value();
57  m_ProjectionPlane->Project(point, projectedPoint);
58 
59  m_ProjectedLandmarks->InsertElement(id, projectedPoint);
60  }
61 }
virtual void ComputeCompleteAbstractTransform() override
Compute the transform from parameter space to world space incorporating the given interpolating trans...
virtual void ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks) override