Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkRegistrationJob Class Reference

QRunnable job that performs image registration using a MatchPoint algorithm in a background thread. More...

#include <QmitkRegistrationJob.h>

Inheritance diagram for QmitkRegistrationJob:
Collaboration diagram for QmitkRegistrationJob:

Signals

void Finished ()
 Emitted when the job has completed (regardless of success or failure). More...
 
void Error (QString err)
 Emitted when an error occurs during registration. More...
 
void RegResultIsAvailable (mitk::MAPRegistrationWrapper::Pointer spResultRegistration, const QmitkRegistrationJob *pJob)
 Emitted when the registration result is available. More...
 
void AlgorithmIterated (QString info, bool hasIterationCount, unsigned long currentIteration)
 Emitted when the algorithm completes an iteration. More...
 
void LevelChanged (QString info, bool hasLevelCount, unsigned long currentLevel)
 Emitted when the algorithm changes its multi-resolution level. More...
 
void AlgorithmStatusChanged (QString info)
 Emitted when the algorithm status changes (e.g., initializing, starting, stopping). More...
 
void AlgorithmInfo (QString info)
 Emitted for general algorithm information messages. More...
 

Public Member Functions

 QmitkRegistrationJob (::map::algorithm::RegistrationAlgorithmBase *pAlgorithm)
 Constructs the registration job with the given algorithm. More...
 
 ~QmitkRegistrationJob () override
 Destructor. Removes the algorithm event observer. More...
 
void run () override
 Executes the registration algorithm. More...
 
const ::map::algorithm::RegistrationAlgorithmBase * GetLoadedAlgorithm () const
 Returns the registration algorithm used by this job. More...
 

Public Attributes

mitk::BaseData::ConstPointer m_spTargetData
 The target (fixed) data for the registration. More...
 
mitk::BaseData::ConstPointer m_spMovingData
 The moving data for the registration. More...
 
mitk::Image::ConstPointer m_spTargetMask
 Optional mask image for the target data. More...
 
mitk::Image::ConstPointer m_spMovingMask
 Optional mask image for the moving data. More...
 
bool m_MapEntity
 If true, the job also maps the moving entity using the computed registration. More...
 
bool m_StoreReg
 If true, the registration result is stored. More...
 
bool m_ErrorOccured
 Flag indicating whether an error occurred during execution. More...
 
std::string m_JobName
 Human-readable name for the registration job. More...
 
mitk::NodeUIDType m_TargetDataUID
 UID of the target data node for provenance tracking. More...
 
mitk::NodeUIDType m_MovingDataUID
 UID of the moving data node for provenance tracking. More...
 
mitk::NodeUIDType m_TargetMaskDataUID
 UID of the target mask data node for provenance tracking. More...
 
mitk::NodeUIDType m_MovingMaskDataUID
 UID of the moving mask data node for provenance tracking. More...
 

Protected Types

typedef ::map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm
 
typedef ::map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm
 

Protected Member Functions

const mitk::Image * GetTargetDataAsImage () const
 
const mitk::Image * GetMovingDataAsImage () const
 
void OnMapAlgorithmEvent (::itk::Object *, const itk::EventObject &event)
 

Protected Attributes

::map::core::RegistrationBase::Pointer m_spResultRegistration
 
mitk::DataNode::Pointer m_spRegNode
 
mitk::DataNode::Pointer m_spMappedImageNode
 
::itk::MemberCommand< QmitkRegistrationJob >::Pointer m_spCommand
 
unsigned long m_ObserverID
 
::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm
 

Detailed Description

QRunnable job that performs image registration using a MatchPoint algorithm in a background thread.

This job executes a MatchPoint registration algorithm on a pair of moving and target data sets (typically images) in a QThreadPool, keeping the GUI thread responsive. It observes algorithm events (iterations, level changes, status updates) and relays them as Qt signals for progress reporting.

Optional masks can be set for both moving and target data. On successful completion, the job emits RegResultIsAvailable with a mitk::MAPRegistrationWrapper containing the computed registration. The Finished signal is always emitted at the end.

See also
QmitkFramesRegistrationJob, QmitkMappingJob, mitk::MAPAlgorithmHelper

Definition at line 53 of file QmitkRegistrationJob.h.

Member Typedef Documentation

◆ IIterativeAlgorithm

typedef ::map::algorithm::facet::IterativeAlgorithmInterface QmitkRegistrationJob::IIterativeAlgorithm
protected

Definition at line 177 of file QmitkRegistrationJob.h.

◆ IMultiResAlgorithm

typedef ::map::algorithm::facet::MultiResRegistrationAlgorithmInterface QmitkRegistrationJob::IMultiResAlgorithm
protected

Definition at line 178 of file QmitkRegistrationJob.h.

Constructor & Destructor Documentation

◆ QmitkRegistrationJob()

QmitkRegistrationJob::QmitkRegistrationJob ( ::map::algorithm::RegistrationAlgorithmBase *  pAlgorithm)

Constructs the registration job with the given algorithm.

Registers an ITK observer on the algorithm to receive algorithm events and initializes default member values.

Parameters
[in]pAlgorithmPointer to the MatchPoint registration algorithm to use. The job takes shared ownership via a smart pointer.
Precondition
pAlgorithm must not be nullptr.

◆ ~QmitkRegistrationJob()

QmitkRegistrationJob::~QmitkRegistrationJob ( )
override

Destructor. Removes the algorithm event observer.

Member Function Documentation

◆ AlgorithmInfo

void QmitkRegistrationJob::AlgorithmInfo ( QString  info)
signal

Emitted for general algorithm information messages.

Parameters
[in]infoInformation message string.

◆ AlgorithmIterated

void QmitkRegistrationJob::AlgorithmIterated ( QString  info,
bool  hasIterationCount,
unsigned long  currentIteration 
)
signal

Emitted when the algorithm completes an iteration.

Parameters
[in]infoDescriptive text about the iteration.
[in]hasIterationCountTrue if the algorithm provides an iteration count.
[in]currentIterationThe current iteration number (valid only if hasIterationCount is true).

◆ AlgorithmStatusChanged

void QmitkRegistrationJob::AlgorithmStatusChanged ( QString  info)
signal

Emitted when the algorithm status changes (e.g., initializing, starting, stopping).

Parameters
[in]infoStatus description string.

◆ Error

void QmitkRegistrationJob::Error ( QString  err)
signal

Emitted when an error occurs during registration.

Parameters
[in]errDescription of the error.

◆ Finished

void QmitkRegistrationJob::Finished ( )
signal

Emitted when the job has completed (regardless of success or failure).

◆ GetLoadedAlgorithm()

const ::map::algorithm::RegistrationAlgorithmBase* QmitkRegistrationJob::GetLoadedAlgorithm ( ) const

Returns the registration algorithm used by this job.

Returns
Const pointer to the loaded MatchPoint registration algorithm.

◆ GetMovingDataAsImage()

const mitk::Image* QmitkRegistrationJob::GetMovingDataAsImage ( ) const
protected

◆ GetTargetDataAsImage()

const mitk::Image* QmitkRegistrationJob::GetTargetDataAsImage ( ) const
protected

◆ LevelChanged

void QmitkRegistrationJob::LevelChanged ( QString  info,
bool  hasLevelCount,
unsigned long  currentLevel 
)
signal

Emitted when the algorithm changes its multi-resolution level.

Parameters
[in]infoDescriptive text about the level change.
[in]hasLevelCountTrue if the algorithm provides a level count.
[in]currentLevelThe current level number (valid only if hasLevelCount is true).

◆ OnMapAlgorithmEvent()

void QmitkRegistrationJob::OnMapAlgorithmEvent ( ::itk::Object *  ,
const itk::EventObject &  event 
)
protected

◆ RegResultIsAvailable

void QmitkRegistrationJob::RegResultIsAvailable ( mitk::MAPRegistrationWrapper::Pointer  spResultRegistration,
const QmitkRegistrationJob *  pJob 
)
signal

Emitted when the registration result is available.

Parameters
[in]spResultRegistrationThe computed registration wrapped in a MAPRegistrationWrapper.
[in]pJobPointer to this job instance for context.

◆ run()

void QmitkRegistrationJob::run ( )
override

Executes the registration algorithm.

Sets moving and target data (and optional masks) on the algorithm via mitk::MAPAlgorithmHelper, runs the registration, and wraps the result in a mitk::MAPRegistrationWrapper. Emits RegResultIsAvailable on success or Error on failure. Always emits Finished.

Member Data Documentation

◆ m_ErrorOccured

bool QmitkRegistrationJob::m_ErrorOccured

Flag indicating whether an error occurred during execution.

Definition at line 153 of file QmitkRegistrationJob.h.

◆ m_JobName

std::string QmitkRegistrationJob::m_JobName

Human-readable name for the registration job.

Definition at line 156 of file QmitkRegistrationJob.h.

◆ m_MapEntity

bool QmitkRegistrationJob::m_MapEntity

If true, the job also maps the moving entity using the computed registration.

Definition at line 147 of file QmitkRegistrationJob.h.

◆ m_MovingDataUID

mitk::NodeUIDType QmitkRegistrationJob::m_MovingDataUID

UID of the moving data node for provenance tracking.

Definition at line 162 of file QmitkRegistrationJob.h.

◆ m_MovingMaskDataUID

mitk::NodeUIDType QmitkRegistrationJob::m_MovingMaskDataUID

UID of the moving mask data node for provenance tracking.

Definition at line 168 of file QmitkRegistrationJob.h.

◆ m_ObserverID

unsigned long QmitkRegistrationJob::m_ObserverID
protected

Definition at line 187 of file QmitkRegistrationJob.h.

◆ m_spCommand

::itk::MemberCommand<QmitkRegistrationJob>::Pointer QmitkRegistrationJob::m_spCommand
protected

Definition at line 186 of file QmitkRegistrationJob.h.

◆ m_spLoadedAlgorithm

::map::algorithm::RegistrationAlgorithmBase::Pointer QmitkRegistrationJob::m_spLoadedAlgorithm
protected

Definition at line 188 of file QmitkRegistrationJob.h.

◆ m_spMappedImageNode

mitk::DataNode::Pointer QmitkRegistrationJob::m_spMappedImageNode
protected

Definition at line 184 of file QmitkRegistrationJob.h.

◆ m_spMovingData

mitk::BaseData::ConstPointer QmitkRegistrationJob::m_spMovingData

The moving data for the registration.

Definition at line 138 of file QmitkRegistrationJob.h.

◆ m_spMovingMask

mitk::Image::ConstPointer QmitkRegistrationJob::m_spMovingMask

Optional mask image for the moving data.

Definition at line 144 of file QmitkRegistrationJob.h.

◆ m_spRegNode

mitk::DataNode::Pointer QmitkRegistrationJob::m_spRegNode
protected

Definition at line 182 of file QmitkRegistrationJob.h.

◆ m_spResultRegistration

::map::core::RegistrationBase::Pointer QmitkRegistrationJob::m_spResultRegistration
protected

Definition at line 181 of file QmitkRegistrationJob.h.

◆ m_spTargetData

mitk::BaseData::ConstPointer QmitkRegistrationJob::m_spTargetData

The target (fixed) data for the registration.

Definition at line 135 of file QmitkRegistrationJob.h.

◆ m_spTargetMask

mitk::Image::ConstPointer QmitkRegistrationJob::m_spTargetMask

Optional mask image for the target data.

Definition at line 141 of file QmitkRegistrationJob.h.

◆ m_StoreReg

bool QmitkRegistrationJob::m_StoreReg

If true, the registration result is stored.

Definition at line 150 of file QmitkRegistrationJob.h.

◆ m_TargetDataUID

mitk::NodeUIDType QmitkRegistrationJob::m_TargetDataUID

UID of the target data node for provenance tracking.

Definition at line 159 of file QmitkRegistrationJob.h.

◆ m_TargetMaskDataUID

mitk::NodeUIDType QmitkRegistrationJob::m_TargetMaskDataUID

UID of the target mask data node for provenance tracking.

Definition at line 165 of file QmitkRegistrationJob.h.


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