Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::MAPAlgorithmHelper Class Reference

Helper class for bridging between MITK data objects and MatchPoint registration algorithms. More...

#include <mitkMAPAlgorithmHelper.h>

Classes

struct  CheckError
 Error codes returned by CheckData() indicating data compatibility issues. More...
 

Public Member Functions

 MAPAlgorithmHelper (map::algorithm::RegistrationAlgorithmBase *algorithm)
 Constructs a helper for the given registration algorithm. More...
 
void SetData (const mitk::BaseData *moving, const mitk::BaseData *target)
 Sets moving and target data on the algorithm. More...
 
void SetAllowImageCasting (bool allowCasting)
 Enables or disables automatic pixel type casting for images. More...
 
bool GetAllowImageCasting () const
 Returns whether automatic pixel type casting is currently allowed. More...
 
bool CheckData (const mitk::BaseData *moving, const mitk::BaseData *target, CheckError::Type &error) const
 Checks whether the given moving and target data are compatible with the algorithm. More...
 
map::core::RegistrationBase::Pointer GetRegistration () const
 Retrieves the registration result from the algorithm. More...
 
mitk::MAPRegistrationWrapper::Pointer GetMITKRegistrationWrapper () const
 Retrieves the registration result wrapped in a MITK-compatible wrapper. More...
 
 ~MAPAlgorithmHelper ()
 

Static Public Member Functions

static bool HasImageAlgorithmInterface (const map::algorithm::RegistrationAlgorithmBase *algorithm)
 Checks whether the given algorithm supports image-based registration. More...
 
static bool HasPointSetAlgorithmInterface (const map::algorithm::RegistrationAlgorithmBase *algorithm)
 Checks whether the given algorithm supports point-set-based registration. More...
 

Detailed Description

Helper class for bridging between MITK data objects and MatchPoint registration algorithms.

MAPAlgorithmHelper simplifies setting MITK images or point sets as input data for MatchPoint registration algorithms. It handles data type checking, optional pixel type casting, and extraction of registration results.

Note
Current implementation is not thread-safe. Use one helper instance per registration task.
See also
mitk::MAPRegistrationWrapper, mitk::MaskedAlgorithmHelper

Definition at line 43 of file mitkMAPAlgorithmHelper.h.

Constructor & Destructor Documentation

◆ MAPAlgorithmHelper()

mitk::MAPAlgorithmHelper::MAPAlgorithmHelper ( map::algorithm::RegistrationAlgorithmBase *  algorithm)

Constructs a helper for the given registration algorithm.

Parameters
[in]algorithmPointer to the MatchPoint registration algorithm to assist.

◆ ~MAPAlgorithmHelper()

mitk::MAPAlgorithmHelper::~MAPAlgorithmHelper ( )
inline

Definition at line 139 of file mitkMAPAlgorithmHelper.h.

Member Function Documentation

◆ CheckData()

bool mitk::MAPAlgorithmHelper::CheckData ( const mitk::BaseData *  moving,
const mitk::BaseData *  target,
CheckError::Type &  error 
) const

Checks whether the given moving and target data are compatible with the algorithm.

Parameters
[in]movingPointer to the moving data.
[in]targetPointer to the target data.
[out]errorThe specific error type if the data is incompatible.
Returns
True if the data can be used with the algorithm (considering the AllowImageCasting setting).
Precondition
The algorithm, moving, and target must be valid pointers.

◆ GetAllowImageCasting()

bool mitk::MAPAlgorithmHelper::GetAllowImageCasting ( ) const

Returns whether automatic pixel type casting is currently allowed.

Returns
True if casting is allowed, false otherwise.

◆ GetMITKRegistrationWrapper()

mitk::MAPRegistrationWrapper::Pointer mitk::MAPAlgorithmHelper::GetMITKRegistrationWrapper ( ) const

Retrieves the registration result wrapped in a MITK-compatible wrapper.

Returns
Smart pointer to a MAPRegistrationWrapper containing the algorithm's registration.
See also
GetRegistration

◆ GetRegistration()

map::core::RegistrationBase::Pointer mitk::MAPAlgorithmHelper::GetRegistration ( ) const

Retrieves the registration result from the algorithm.

Returns
Smart pointer to the computed MatchPoint registration, or nullptr if unavailable.
Exceptions
map::core::ExceptionObjectif the algorithm has unsupported dimensionality.

◆ HasImageAlgorithmInterface()

static bool mitk::MAPAlgorithmHelper::HasImageAlgorithmInterface ( const map::algorithm::RegistrationAlgorithmBase *  algorithm)
static

Checks whether the given algorithm supports image-based registration.

Parameters
[in]algorithmPointer to the algorithm to check.
Returns
True if the algorithm implements the ImageRegistrationAlgorithmInterface.

◆ HasPointSetAlgorithmInterface()

static bool mitk::MAPAlgorithmHelper::HasPointSetAlgorithmInterface ( const map::algorithm::RegistrationAlgorithmBase *  algorithm)
static

Checks whether the given algorithm supports point-set-based registration.

Parameters
[in]algorithmPointer to the algorithm to check.
Returns
True if the algorithm implements the PointSetRegistrationAlgorithmInterface.

◆ SetAllowImageCasting()

void mitk::MAPAlgorithmHelper::SetAllowImageCasting ( bool  allowCasting)

Enables or disables automatic pixel type casting for images.

When enabled, images whose pixel types differ from the algorithm's expected type will be automatically cast to the default internal pixel type.

Parameters
[in]allowCastingTrue to allow casting, false to disallow.

◆ SetData()

void mitk::MAPAlgorithmHelper::SetData ( const mitk::BaseData *  moving,
const mitk::BaseData *  target 
)

Sets moving and target data on the algorithm.

The data can be either images or point sets. If images require pixel type casting and casting is allowed, they will be cast to the algorithm's default internal type.

Parameters
[in]movingPointer to the moving data (Image or PointSet).
[in]targetPointer to the target data (Image or PointSet).
Precondition
The algorithm must be set.
moving and target must be valid pointers.
Exceptions
map::core::ExceptionObjectif the data cannot be set on the algorithm.

The documentation for this class was generated from the following file: