14 #ifndef mitkMAPRegistrationWrapper_h
15 #define mitkMAPRegistrationWrapper_h
22 #include <mapRegistrationBase.h>
23 #include <mapRegistration.h>
24 #include <mapExceptionObjectMacros.h>
25 #include <mapContinuousElements.h>
86 typedef ::map::core::RegistrationBase::TagType
TagType;
87 typedef ::map::core::RegistrationBase::ValueType
ValueType;
88 typedef ::map::core::RegistrationBase::TagMapType
TagMapType;
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);
255 void PrintSelf (std::ostream &os, itk::Indent indent)
const override;
#define MITKMATCHPOINTREGISTRATION_EXPORT
Base of all data objects.
Standard implementation of BaseGeometry.
MAPRegistrationWrapper Wrapper class to allow the handling of MatchPoint registration objects as mitk...
mitk::Geometry3D GetInverseFieldRepresentation() const
bool IsEmptyTimeStep(unsigned int t) const override
Check whether object contains data (at a specified time), e.g., a set of points may be empty.
mitkClassMacro(MAPRegistrationWrapper, BaseData)
~MAPRegistrationWrapper() override
virtual unsigned int GetTargetDimensions() const
Gets the number of target dimensions.
::map::core::RegistrationBase::ValueType ValueType
void SetRequestedRegion(const itk::DataObject *) override
Identifiable::UIDType GetUID() const override
Get unique ID of an object.
void SetRequestedRegionToLargestPossibleRegion() override
::map::core::RegistrationBase * GetRegistration()
bool MapPointInverse(const ::itk::Point< mitk::ScalarType, VTargetDim > &inPoint, ::itk::Point< mitk::ScalarType, VMovingDim > &outPoint) const
void PrecomputeInverseMapping()
bool IsEmpty() const override
Check whether object contains data (at least at one point in time), e.g., a set of points may be empt...
void SetUID(const UIDType &uid) override
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
virtual unsigned int GetMovingDimensions() const
Gets the number of moving dimensions.
bool HasLimitedTargetRepresentation() const
MAPRegistrationWrapper(::map::core::RegistrationBase *registration)
bool GetTagValue(const TagType &tag, ValueType &value) const
returns the tag value for a specific tag
const ::map::core::RegistrationBase * GetRegistration() const
const TagMapType & GetTags() const
returns the tags associated with this registration
bool VerifyRequestedRegion() override
::map::core::RegistrationBase::Pointer m_spRegistration
mitkNewMacro1Param(Self, ::map::core::RegistrationBase *)
::map::core::RegistrationBase::TagMapType TagMapType
void PrecomputeDirectMapping()
bool HasLimitedMovingRepresentation() const
void PrintSelf(std::ostream &os, itk::Indent indent) const override
mitk::Geometry3D GetDirectFieldRepresentation() const
bool MapPoint(const ::itk::Point< mitk::ScalarType, VMovingDim > &inPoint, ::itk::Point< mitk::ScalarType, VTargetDim > &outPoint) const
::map::core::RegistrationBase::TagType TagType
Find image slices visible on a given plane.