Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMAPRegistrationWrapper.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 
19 #include <mapExceptionObjectMacros.h>
20 
22 {
23 }
24 
26 {
27 }
28 
30 {
31  //nothing to do
32 }
33 
35 {
36  return false;
37 }
38 
40 {
41  return true;
42 }
43 
45 {
46  //nothing to do
47 }
48 
50 {
51  if (m_spRegistration.IsNull())
52  {
53  mitkThrow()<< "Error. Cannot return moving dimension. Wrapper points to invalid registration (NULL).";
54  }
55  return m_spRegistration->getMovingDimensions();
56 }
57 
58 
60 {
61  if (m_spRegistration.IsNull())
62  {
63  mitkThrow()<< "Error. Cannot return target dimension. Wrapper points to invalid registration (NULL).";
64  }
65  return m_spRegistration->getTargetDimensions();
66 }
67 
69 {
70  if (m_spRegistration.IsNull())
71  {
72  mitkThrow()<< "Error. Cannot return registration tags. Wrapper points to invalid registration (NULL).";
73  }
74  return m_spRegistration->getTags();
75 }
76 
78 {
79  if (m_spRegistration.IsNull())
80  {
81  mitkThrow()<< "Error. Cannot return registration tag value. Wrapper points to invalid registration (NULL). Tag: " << tag;
82  }
83  return m_spRegistration->getTagValue(tag,value);
84 }
85 
87 {
88  if (m_spRegistration.IsNull())
89  {
90  mitkThrow()<< "Error. Cannot determin HasLimitedTargetRepresentation(). Wrapper points to invalid registration (NULL).";
91  }
92  return m_spRegistration->hasLimitedTargetRepresentation();
93 }
94 
96 {
97  if (m_spRegistration.IsNull())
98  {
99  mitkThrow()<< "Error. Cannot determin HasLimitedMovingRepresentation(). Wrapper points to invalid registration (NULL).";
100  }
101  return m_spRegistration->hasLimitedMovingRepresentation();
102 }
103 
104 map::core::RegistrationBase* mitk::MAPRegistrationWrapper::GetRegistration()
105 {
106  return m_spRegistration;
107 }
108 
109 const map::core::RegistrationBase* mitk::MAPRegistrationWrapper::GetRegistration() const
110 {
111  return m_spRegistration;
112 }
113 
114 void mitk::MAPRegistrationWrapper::SetRegistration(map::core::RegistrationBase* pReg)
115 {
116  m_spRegistration = pReg;
117 }
118 
119 void mitk::MAPRegistrationWrapper::PrintSelf (std::ostream &os, itk::Indent indent) const
120 {
121  Superclass::PrintSelf(os,indent);
122  if (m_spRegistration.IsNull())
123  {
124  os<< "Error. Wrapper points to invalid registration (NULL).";
125  }
126  else
127  {
128  os<<std::endl<<indent<<"MatchPoint registration instance:";
129  m_spRegistration->Print(os,indent.GetNextIndent());
130 
131  typedef map::core::Registration<3,3> CastedRegType;
132  const CastedRegType* pCastedReg = dynamic_cast<const CastedRegType*>(m_spRegistration.GetPointer());
133 
134  os<<std::endl<<indent<<"MatchPoint registration direct kernel instance:";
135  pCastedReg->getDirectMapping().Print(os,indent.GetNextIndent());
136 
137  os<<std::endl<<indent<<"MatchPoint registration inverse kernel instance:";
138  pCastedReg->getInverseMapping().Print(os,indent.GetNextIndent());
139 
140  }
141 }
::map::core::RegistrationBase::ValueType ValueType
void SetRegistration(map::core::RegistrationBase *pReg)
virtual unsigned int GetMovingDimensions() const
Gets the number of moving dimensions.
virtual void SetRequestedRegion(const itk::DataObject *)
::map::core::RegistrationBase::TagType TagType
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
map::core::RegistrationBase * GetRegistration()
#define mitkThrow()
bool GetTagValue(const TagType &tag, ValueType &value) const
returns the tag value for a specific tag
::map::core::RegistrationBase::TagMapType TagMapType
virtual unsigned int GetTargetDimensions() const
Gets the number of target dimensions.
const TagMapType & GetTags() const
returns the tags associated with this registration