14 #ifndef mitkMAPRegistrationWrapper_h
15 #define mitkMAPRegistrationWrapper_h
22 #include <mapRegistrationBase.h>
23 #include <mapRegistration.h>
24 #include <mapExceptionObjectMacros.h>
25 #include <mapContinuousElements.h>
50 void SetRequestedRegionToLargestPossibleRegion()
override;
56 bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
62 bool VerifyRequestedRegion()
override;
68 void SetRequestedRegion(
const itk::DataObject*)
override;
73 virtual unsigned int GetMovingDimensions()
const;
78 virtual unsigned int GetTargetDimensions()
const;
82 typedef ::map::core::RegistrationBase::TagType
TagType;
83 typedef ::map::core::RegistrationBase::ValueType
ValueType;
84 typedef ::map::core::RegistrationBase::TagMapType
TagMapType;
106 bool HasLimitedTargetRepresentation()
const;
116 bool HasLimitedMovingRepresentation()
const;
127 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
128 bool MapPoint(const ::itk::Point<mitk::ScalarType,VMovingDim>& inPoint, ::itk::Point<mitk::ScalarType,VTargetDim>& outPoint)
const
130 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
131 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
133 if (m_spRegistration.IsNull())
135 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
140 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
142 MAPMovingPointType tempInP;
143 MAPTargetPointType tempOutP;
144 tempInP.CastFrom(inPoint);
146 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
147 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
151 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
154 result = pCastedReg->mapPoint(tempInP,tempOutP);
157 outPoint.CastFrom(tempOutP);
173 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
174 bool MapPointInverse(const ::itk::Point<mitk::ScalarType,VTargetDim> & inPoint, ::itk::Point<mitk::ScalarType,VMovingDim> & outPoint)
const
176 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
177 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
179 if (m_spRegistration.IsNull())
181 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
186 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
188 MAPTargetPointType tempInP;
189 MAPMovingPointType tempOutP;
190 tempInP.CastFrom(inPoint);
192 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
193 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
197 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
200 result = pCastedReg->mapPointInverse(tempInP,tempOutP);
203 outPoint.CastFrom(tempOutP);
238 void PrecomputeDirectMapping();
245 void PrecomputeInverseMapping();
247 ::map::core::RegistrationBase* GetRegistration();
248 const ::map::core::RegistrationBase* GetRegistration()
const;
251 void PrintSelf (std::ostream &os, itk::Indent indent)
const override;
256 void SetUID(
const UIDType& uid)
override;