Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 #include <vtkAbstractTransform.h>
19 
22  m_LandmarkProjector(nullptr),
23  m_InterpolatingAbstractTransform(nullptr),
24  m_TargetLandmarks(nullptr)
25 {
26 }
27 
30  : Superclass(other)
31 {
34  this->ComputeGeometry();
35 }
36 
38 {
39  if (m_InterpolatingAbstractTransform != nullptr)
40  m_InterpolatingAbstractTransform->Delete();
41 }
42 
44 {
45  itkDebugMacro("setting LandmarkProjector to " << aLandmarkProjector);
46  if (m_LandmarkProjector != aLandmarkProjector)
47  {
48  m_LandmarkProjector = aLandmarkProjector;
49  if (m_LandmarkProjector.IsNotNull())
50  {
51  if (m_FrameGeometry.IsNotNull())
52  m_LandmarkProjector->SetFrameGeometry(m_FrameGeometry);
53 
54  if (m_InterpolatingAbstractTransform == nullptr)
55  {
56  itkWarningMacro(<< "m_InterpolatingAbstractTransform not set.");
57  }
58  m_LandmarkProjector->SetInterpolatingAbstractTransform(GetInterpolatingAbstractTransform());
59 
60  SetVtkAbstractTransform(m_LandmarkProjector->GetCompleteAbstractTransform());
61  }
62  Modified();
63  }
64 }
65 
67 {
68  Superclass::SetFrameGeometry(frameGeometry);
69  if (m_LandmarkProjector.IsNotNull())
70  m_LandmarkProjector->SetFrameGeometry(frameGeometry);
71 }
72 
74 {
75  if (m_LandmarkProjector.IsNull())
76  {
77  itkExceptionMacro(<< "m_LandmarkProjector is not set.");
78  }
79  m_LandmarkProjector->ProjectLandmarks(m_TargetLandmarks);
80  SetPlane(m_LandmarkProjector->GetParameterPlane());
81 }
83 {
85  newGeometry->UnRegister();
86  return newGeometry.GetPointer();
87 }
itk::SmartPointer< Self > Pointer
Superclass of AbstractTransformGeometry sub-classes defined by a set of landmarks.
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...
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
virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry) override
Set the frame geometry which is used as the standard part of an BaseGeometry (IndexToWorldTransform a...
virtual void SetFrameGeometry(const mitk::BaseGeometry *_arg)
Set frame geometry within which the interpolation shall occur.
Describes a two-dimensional, rectangular plane.
BaseGeometry Describes the geometry of a data object.
void SetLandmarkProjector(mitk::LandmarkProjector *aLandmarkProjector)