Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkLandmarkProjectorBasedCurvedGeometry.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 #include <vtkAbstractTransform.h>
15 
18  m_LandmarkProjector(nullptr),
19  m_InterpolatingAbstractTransform(nullptr),
20  m_TargetLandmarks(nullptr)
21 {
22 }
23 
26  : Superclass(other)
27 {
30  this->ComputeGeometry();
31 }
32 
34 {
35  if (m_InterpolatingAbstractTransform != nullptr)
37 }
38 
40 {
41  itkDebugMacro("setting LandmarkProjector to " << aLandmarkProjector);
42  if (m_LandmarkProjector != aLandmarkProjector)
43  {
44  m_LandmarkProjector = aLandmarkProjector;
45  if (m_LandmarkProjector.IsNotNull())
46  {
47  if (m_FrameGeometry.IsNotNull())
48  m_LandmarkProjector->SetFrameGeometry(m_FrameGeometry);
49 
50  if (m_InterpolatingAbstractTransform == nullptr)
51  {
52  itkWarningMacro(<< "m_InterpolatingAbstractTransform not set.");
53  }
54  m_LandmarkProjector->SetInterpolatingAbstractTransform(GetInterpolatingAbstractTransform());
55 
56  SetVtkAbstractTransform(m_LandmarkProjector->GetCompleteAbstractTransform());
57  }
58  Modified();
59  }
60 }
61 
63 {
64  Superclass::SetFrameGeometry(frameGeometry);
65  if (m_LandmarkProjector.IsNotNull())
66  m_LandmarkProjector->SetFrameGeometry(frameGeometry);
67 }
68 
70 {
71  if (m_LandmarkProjector.IsNull())
72  {
73  itkExceptionMacro(<< "m_LandmarkProjector is not set.");
74  }
75  m_LandmarkProjector->ProjectLandmarks(m_TargetLandmarks);
76  SetPlane(m_LandmarkProjector->GetParameterPlane());
77 }
79 {
81  newGeometry->UnRegister();
82  return newGeometry.GetPointer();
83 }
Superclass of AbstractTransformGeometry sub-classes defined by a set of landmarks.
virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform)
Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry)
Set the frame geometry which is used as the standard part of an BaseGeometry (IndexToWorldTransform a...
virtual void SetTargetLandmarks(const mitk::PointSet::DataType::PointsContainer *_arg)
Set the landmarks through which the geometry shall pass.
Base-class of landmark-projectors, which project the target landmarks to create source landmarks...
void Modified() const override
Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class...
itk::LightObject::Pointer InternalClone() const override
clones the geometry
Describes a geometry defined by an vtkAbstractTransform and a plane.
mitk::PointSet::DataType::PointsContainer::ConstPointer m_TargetLandmarks
void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry) override
Set the frame geometry which is used as the standard part of an BaseGeometry (IndexToWorldTransform a...
virtual vtkAbstractTransform * GetInterpolatingAbstractTransform() const
virtual void SetPlane(const mitk::PlaneGeometry *aPlane)
Set the rectangular area that is used for transformation by m_VtkAbstractTransform and therewith defi...
Describes a two-dimensional, rectangular plane.
BaseGeometry Describes the geometry of a data object.
void SetLandmarkProjector(mitk::LandmarkProjector *aLandmarkProjector)