14 #ifndef mitkMAPRegistrationWrapper_h
15 #define mitkMAPRegistrationWrapper_h
22 #include <mapRegistrationBase.h>
23 #include <mapRegistration.h>
24 #include <mapExceptionObjectMacros.h>
25 #include <mapContinuousElements.h>
110 typedef ::map::core::RegistrationBase::TagType
TagType;
112 typedef ::map::core::RegistrationBase::ValueType
ValueType;
114 typedef ::map::core::RegistrationBase::TagMapType
TagMapType;
165 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
166 bool MapPoint(const ::itk::Point<mitk::ScalarType,VMovingDim>& inPoint, ::itk::Point<mitk::ScalarType,VTargetDim>& outPoint)
const
168 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
169 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
171 if (m_spRegistration.IsNull())
173 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
178 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
180 MAPMovingPointType tempInP;
181 MAPTargetPointType tempOutP;
182 tempInP.CastFrom(inPoint);
184 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
185 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
189 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
192 result = pCastedReg->mapPoint(tempInP,tempOutP);
195 outPoint.CastFrom(tempOutP);
215 template <
unsigned int VMovingDim,
unsigned int VTargetDim>
216 bool MapPointInverse(const ::itk::Point<mitk::ScalarType,VTargetDim> & inPoint, ::itk::Point<mitk::ScalarType,VMovingDim> & outPoint)
const
218 typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
219 typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
221 if (m_spRegistration.IsNull())
223 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
228 if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
230 MAPTargetPointType tempInP;
231 MAPMovingPointType tempOutP;
232 tempInP.CastFrom(inPoint);
234 typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
235 const CastedRegType* pCastedReg =
dynamic_cast<const CastedRegType*
>(m_spRegistration.GetPointer());
239 mapDefaultExceptionMacro(<<
"Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
242 result = pCastedReg->mapPointInverse(tempInP,tempOutP);
245 outPoint.CastFrom(tempOutP);
312 void PrintSelf (std::ostream &os, itk::Indent indent)
const override;
#define MITKMATCHPOINTREGISTRATION_EXPORT
Base class of all data objects.
Standard three-dimensional geometry.
std::string UIDType
Type alias for unique identifiers.
Wrapper class that adapts MatchPoint registration objects to the MITK data model.
mitk::Geometry3D GetInverseFieldRepresentation() const
Returns the field representation of the inverse mapping kernel as a Geometry3D.
bool IsEmptyTimeStep(unsigned int t) const override
Checks whether the registration is empty at the given time step.
mitkClassMacro(MAPRegistrationWrapper, BaseData)
~MAPRegistrationWrapper() override
virtual unsigned int GetTargetDimensions() const
Gets the number of dimensions of the target space.
::map::core::RegistrationBase::ValueType ValueType
Tag value type from the MatchPoint registration metadata.
void SetRequestedRegion(const itk::DataObject *) override
Identifiable::UIDType GetUID() const override
Returns the unique identifier of the wrapped registration.
void SetRequestedRegionToLargestPossibleRegion() override
::map::core::RegistrationBase * GetRegistration()
Returns a mutable pointer to the wrapped MatchPoint registration.
bool MapPointInverse(const ::itk::Point< mitk::ScalarType, VTargetDim > &inPoint, ::itk::Point< mitk::ScalarType, VMovingDim > &outPoint) const
Maps a point from target space to moving space using the inverse mapping kernel.
void PrecomputeInverseMapping()
Forces the inverse mapping kernel to precompute its deformation field.
bool IsEmpty() const override
Checks whether the registration wrapper contains no valid registration.
void SetUID(const UIDType &uid) override
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
virtual unsigned int GetMovingDimensions() const
Gets the number of dimensions of the moving space.
bool HasLimitedTargetRepresentation() const
Checks whether the inverse mapping kernel has a limited representation in target space.
MAPRegistrationWrapper(::map::core::RegistrationBase *registration)
bool GetTagValue(const TagType &tag, ValueType &value) const
Retrieves the value for a specific metadata tag.
const ::map::core::RegistrationBase * GetRegistration() const
Returns a const pointer to the wrapped MatchPoint registration.
const TagMapType & GetTags() const
Returns all metadata tags associated with this registration.
bool VerifyRequestedRegion() override
::map::core::RegistrationBase::Pointer m_spRegistration
mitkNewMacro1Param(Self, ::map::core::RegistrationBase *)
::map::core::RegistrationBase::TagMapType TagMapType
Map type associating tag keys with their values.
void PrecomputeDirectMapping()
Forces the direct mapping kernel to precompute its deformation field.
bool HasLimitedMovingRepresentation() const
Checks whether the direct mapping kernel has a limited representation in moving space.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
mitk::Geometry3D GetDirectFieldRepresentation() const
Returns the field representation of the direct mapping kernel as a Geometry3D.
bool MapPoint(const ::itk::Point< mitk::ScalarType, VMovingDim > &inPoint, ::itk::Point< mitk::ScalarType, VTargetDim > &outPoint) const
Maps a point from moving space to target space using the direct mapping kernel.
::map::core::RegistrationBase::TagType TagType
Tag key type from the MatchPoint registration metadata.
Find image slices visible on a given plane.