14 #ifndef mitkMAPRegistrationWrapper_h
15 #define mitkMAPRegistrationWrapper_h
22 #include <mapRegistrationBase.h>
23 #include <mapRegistration.h>
24 #include <mapExceptionObjectMacros.h>
25 #include <mapContinuousElements.h>
46 bool IsEmptyTimeStep(
unsigned int t)
const override;
48 bool IsEmpty()
const override;
54 void SetRequestedRegionToLargestPossibleRegion()
override;
60 bool RequestedRegionIsOutsideOfTheBufferedRegion()
override;
66 bool VerifyRequestedRegion()
override;
72 void SetRequestedRegion(
const itk::DataObject*)
override;
77 virtual unsigned int GetMovingDimensions()
const;
82 virtual unsigned int GetTargetDimensions()
const;
86 typedef ::map::core::RegistrationBase::TagType
TagType;
87 typedef ::map::core::RegistrationBase::ValueType
ValueType;
88 typedef ::map::core::RegistrationBase::TagMapType
TagMapType;
110 bool HasLimitedTargetRepresentation()
const;
120 bool HasLimitedMovingRepresentation()
const;
131 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
132 bool MapPoint(const ::itk::Point<mitk::ScalarType,VMovingDim>& inPoint, ::itk::Point<mitk::ScalarType,VTargetDim>& outPoint)
const
134 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
135 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
137 if (m_spRegistration.IsNull())
139 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
144 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
146 MAPMovingPointType tempInP;
147 MAPTargetPointType tempOutP;
148 tempInP.CastFrom(inPoint);
150 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
151 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
155 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
158 result = pCastedReg->mapPoint(tempInP,tempOutP);
161 outPoint.CastFrom(tempOutP);
177 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
178 bool MapPointInverse(const ::itk::Point<mitk::ScalarType,VTargetDim> & inPoint, ::itk::Point<mitk::ScalarType,VMovingDim> & outPoint)
const
180 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
181 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
183 if (m_spRegistration.IsNull())
185 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
190 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
192 MAPTargetPointType tempInP;
193 MAPMovingPointType tempOutP;
194 tempInP.CastFrom(inPoint);
196 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
197 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
201 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
204 result = pCastedReg->mapPointInverse(tempInP,tempOutP);
207 outPoint.CastFrom(tempOutP);
242 void PrecomputeDirectMapping();
249 void PrecomputeInverseMapping();
251 ::map::core::RegistrationBase* GetRegistration();
252 const ::map::core::RegistrationBase* GetRegistration()
const;
255 void PrintSelf (std::ostream &os, itk::Indent indent)
const override;
260 void SetUID(
const UIDType& uid)
override;