Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ImageMappingHelper Namespace Reference

Namespace providing helper functions for mapping (resampling) MITK images using MatchPoint registrations. More...

Typedefs

typedef ::map::core::RegistrationBase RegistrationType
 MatchPoint registration base type. More...
 
typedef ::mitk::MAPRegistrationWrapper MITKRegistrationType
 MITK wrapper type for MatchPoint registrations. More...
 
typedef ::mitk::BaseGeometry ResultImageGeometryType
 Geometry type used for the result image grid specification. More...
 
typedef ::mitk::Image InputImageType
 Input image type for mapping operations. More...
 
typedef ::mitk::Image ResultImageType
 Result image type returned by mapping operations. More...
 

Functions

MITKMATCHPOINTREGISTRATION_EXPORT TimeGeometry::Pointer CreateResultTimeGeometry (const mitk::BaseData *input, const mitk::ImageMappingHelper::ResultImageGeometryType *resultGeometry)
 Creates a TimeGeometry for the mapping result based on the input data and optional result geometry. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map (const InputImageType *input, const RegistrationType *registration, bool throwOnOutOfInputAreaError=false, const double &paddingValue=0, const ResultImageGeometryType *resultGeometry=nullptr, bool throwOnMappingError=true, const double &errorValue=0, mitk::ImageMappingInterpolator::Type interpolatorType=mitk::ImageMappingInterpolator::Linear)
 Maps (resamples) an input image using a MatchPoint registration. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map (const InputImageType *input, const MITKRegistrationType *registration, bool throwOnOutOfInputAreaError=false, const double &paddingValue=0, const ResultImageGeometryType *resultGeometry=nullptr, bool throwOnMappingError=true, const double &errorValue=0, mitk::ImageMappingInterpolator::Type interpolatorType=mitk::ImageMappingInterpolator::Linear)
 Maps (resamples) an input image using a MITK registration wrapper. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageGeometryType::Pointer GenerateSuperSampledGeometry (const ResultImageGeometryType *inputGeometry, double xScaling, double yScaling, double zScaling)
 Generates a super-sampled geometry by scaling the spacing of an existing geometry. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer refineGeometry (const InputImageType *input, const RegistrationType *registration, bool throwOnError=true)
 Refines the geometry of an image by applying an affine registration to its Geometry3D. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer refineGeometry (const InputImageType *input, const MITKRegistrationType *registration, bool throwOnError=true)
 
MITKMATCHPOINTREGISTRATION_EXPORT bool canRefineGeometry (const RegistrationType *registration)
 Checks whether a registration can be used for geometry refinement. More...
 
MITKMATCHPOINTREGISTRATION_EXPORT bool canRefineGeometry (const MITKRegistrationType *registration)
 

Detailed Description

Namespace providing helper functions for mapping (resampling) MITK images using MatchPoint registrations.

See also
mitk::MAPRegistrationWrapper, mitk::ImageMappingInterpolator

Typedef Documentation

◆ InputImageType

Input image type for mapping operations.

Definition at line 61 of file mitkImageMappingHelper.h.

◆ MITKRegistrationType

MITK wrapper type for MatchPoint registrations.

Definition at line 56 of file mitkImageMappingHelper.h.

◆ RegistrationType

typedef ::map::core::RegistrationBase mitk::ImageMappingHelper::RegistrationType

MatchPoint registration base type.

Definition at line 54 of file mitkImageMappingHelper.h.

◆ ResultImageGeometryType

Geometry type used for the result image grid specification.

Definition at line 59 of file mitkImageMappingHelper.h.

◆ ResultImageType

Result image type returned by mapping operations.

Definition at line 63 of file mitkImageMappingHelper.h.

Function Documentation

◆ canRefineGeometry() [1/2]

MITKMATCHPOINTREGISTRATION_EXPORT bool mitk::ImageMappingHelper::canRefineGeometry ( const MITKRegistrationType *  registration)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ canRefineGeometry() [2/2]

MITKMATCHPOINTREGISTRATION_EXPORT bool mitk::ImageMappingHelper::canRefineGeometry ( const RegistrationType *  registration)

Checks whether a registration can be used for geometry refinement.

Parameters
[in]registrationThe registration to check.
Returns
True if the registration's direct kernel can be decomposed into an affine matrix.

◆ CreateResultTimeGeometry()

MITKMATCHPOINTREGISTRATION_EXPORT TimeGeometry::Pointer mitk::ImageMappingHelper::CreateResultTimeGeometry ( const mitk::BaseData *  input,
const mitk::ImageMappingHelper::ResultImageGeometryType *  resultGeometry 
)

Creates a TimeGeometry for the mapping result based on the input data and optional result geometry.

Parameters
[in]inputThe input data whose time geometry serves as the template.
[in]resultGeometryOptional pointer to the spatial geometry for the result. If nullptr, the input geometry is used.
Returns
A smart pointer to the created TimeGeometry.

◆ GenerateSuperSampledGeometry()

MITKMATCHPOINTREGISTRATION_EXPORT ResultImageGeometryType::Pointer mitk::ImageMappingHelper::GenerateSuperSampledGeometry ( const ResultImageGeometryType *  inputGeometry,
double  xScaling,
double  yScaling,
double  zScaling 
)

Generates a super-sampled geometry by scaling the spacing of an existing geometry.

Parameters
[in]inputGeometryThe geometry to super-sample.
[in]xScalingScaling factor for the X-axis spacing.
[in]yScalingScaling factor for the Y-axis spacing.
[in]zScalingScaling factor for the Z-axis spacing.
Returns
Smart pointer to the new geometry with adjusted spacing and size.

◆ map() [1/2]

MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer mitk::ImageMappingHelper::map ( const InputImageType *  input,
const MITKRegistrationType *  registration,
bool  throwOnOutOfInputAreaError = false,
const double &  paddingValue = 0,
const ResultImageGeometryType *  resultGeometry = nullptr,
bool  throwOnMappingError = true,
const double &  errorValue = 0,
mitk::ImageMappingInterpolator::Type  interpolatorType = mitk::ImageMappingInterpolator::Linear 
)

Maps (resamples) an input image using a MITK registration wrapper. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in]inputImage that should be mapped.
[in]registrationPointer to the MITK registration wrapper to use for mapping.
[in]throwOnOutOfInputAreaErrorIf true, throws on out-of-input-area errors.
[in]paddingValuePadding value for out-of-input-area voxels.
[in]resultGeometryPointer to the output grid geometry, or nullptr to use the input geometry.
[in]throwOnMappingErrorIf true, throws on mapping errors.
[in]errorValueValue for voxels where mapping fails.
[in]interpolatorTypeThe interpolation strategy to use.
Returns
Smart pointer to the resulting mapped image.
Precondition
input must be valid.
registration must be valid.
Dimensionality of the registration must match the input image.

◆ map() [2/2]

MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer mitk::ImageMappingHelper::map ( const InputImageType *  input,
const RegistrationType *  registration,
bool  throwOnOutOfInputAreaError = false,
const double &  paddingValue = 0,
const ResultImageGeometryType *  resultGeometry = nullptr,
bool  throwOnMappingError = true,
const double &  errorValue = 0,
mitk::ImageMappingInterpolator::Type  interpolatorType = mitk::ImageMappingInterpolator::Linear 
)

Maps (resamples) an input image using a MatchPoint registration.

Parameters
[in]inputImage that should be mapped.
[in]registrationPointer to the MatchPoint registration to use for mapping.
[in]throwOnOutOfInputAreaErrorIf true, throws an exception when the input image does not cover the entire requested result region. If false, uses paddingValue.
[in]paddingValueValue to use for voxels outside the input image area (when not throwing).
[in]resultGeometryPointer to the geometry defining the output grid. If nullptr, the input image geometry is used.
[in]throwOnMappingErrorIf true, throws an exception when the registration does not cover the requested region. If false, uses errorValue.
[in]errorValueValue to use for voxels where mapping fails (when not throwing).
[in]interpolatorTypeThe interpolation strategy to use.
Returns
Smart pointer to the resulting mapped image.
Precondition
input must be valid.
registration must be valid.
Dimensionality of the registration must match the input image.

◆ refineGeometry() [1/2]

MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer mitk::ImageMappingHelper::refineGeometry ( const InputImageType *  input,
const MITKRegistrationType *  registration,
bool  throwOnError = true 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ refineGeometry() [2/2]

MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer mitk::ImageMappingHelper::refineGeometry ( const InputImageType *  input,
const RegistrationType *  registration,
bool  throwOnError = true 
)

Refines the geometry of an image by applying an affine registration to its Geometry3D.

Instead of resampling the image voxels, this method clones the input image and transforms its geometry using the registration's direct mapping kernel. This only works if the kernel can be decomposed into an affine matrix transformation.

Parameters
[in]inputThe input image whose geometry should be refined.
[in]registrationThe MatchPoint registration to apply.
[in]throwOnErrorIf true, throws an exception when the registration cannot be decomposed into an affine transform. If false, returns nullptr instead.
Returns
Smart pointer to the result image with refined geometry, or nullptr on failure (when throwOnError is false).
Precondition
input must point to a valid instance.
registration must point to a valid instance.