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