Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkFramesRegistrationJob.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkFramesRegistrationJob_h
14 #define QmitkFramesRegistrationJob_h
15 
16 // QT
17 #include <QObject>
18 #include <QRunnable>
19 
20 // ITK
21 #include <itkCommand.h>
22 
23 // MITK
24 #include <QmitkMappingJob.h>
25 #include <mitkDataNode.h>
26 #include <mitkImage.h>
27 
28 // MatchPoint
29 #include <mapDeploymentDLLInfo.h>
30 #include <mapIterativeAlgorithmInterface.h>
31 #include <mapMultiResRegistrationAlgorithmInterface.h>
32 #include <mapRegistrationAlgorithmBase.h>
33 #include <mapRegistrationBase.h>
34 
35 // Map4CTK
36 #include <mitkUIDHelper.h>
38 
40 
57  public QRunnable,
59 {
60  // this is needed for all Qt objects that should have a Qt meta-object
61  // (everything that derives from QObject and wants to have signal/slots)
62  Q_OBJECT
63 
64 public:
74  QmitkFramesRegistrationJob(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
75 
80 
89  void run() override;
90 
91 signals:
93  void Finished();
94 
99  void Error(QString err);
100 
106  void ResultIsAvailable(mitk::Image::Pointer spResult, const QmitkFramesRegistrationJob *pJob);
107 
114  void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
115 
122  void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
123 
128  void AlgorithmStatusChanged(QString info);
129 
134  void AlgorithmInfo(QString info);
135 
140  void FrameProcessed(double progress);
141 
146  void FrameRegistered(double progress);
147 
152  void FrameMapped(double progress);
153 
154 public:
156  mitk::BaseData::ConstPointer m_spTargetData;
157 
159  mitk::Image::ConstPointer m_spTargetMask;
160 
163 
166 
169 
174  const map::algorithm::RegistrationAlgorithmBase *GetLoadedAlgorithm() const;
175 
176 private:
177  typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
178  typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
179 
180  mitk::Image::Pointer m_spMappedImageNode;
181 
182  ::itk::MemberCommand<QmitkFramesRegistrationJob>::Pointer m_spCommand;
183  unsigned long m_ObserverID;
184  map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm;
185 
186  mitk::TimeFramesRegistrationHelper::Pointer m_helper;
187 
188  // Helper functions
189  const mitk::Image *GetTargetDataAsImage() const;
190 
191  void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
192 };
193 
194 #endif
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
QRunnable job that performs frame-by-frame registration of a 4D image in a background thread.
const map::algorithm::RegistrationAlgorithmBase * GetLoadedAlgorithm() const
Returns the registration algorithm used by this job.
void AlgorithmInfo(QString info)
Emitted for general algorithm information messages.
mitk::Image::ConstPointer m_spTargetMask
Optional mask image applied to the target during registration.
mitk::TimeFramesRegistrationHelper::IgnoreListType m_IgnoreList
List of time frame indices to exclude from registration.
mitk::NodeUIDType m_TargetMaskDataUID
UID of the target mask data node for provenance tracking.
QmitkFramesRegistrationJob(map::algorithm::RegistrationAlgorithmBase *pAlgorithm)
Constructs the frames registration job with the given algorithm.
void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration)
Emitted when the algorithm completes an iteration.
void FrameProcessed(double progress)
Emitted during frame processing with overall progress.
void FrameMapped(double progress)
Emitted when a single frame has been mapped.
void AlgorithmStatusChanged(QString info)
Emitted when the algorithm status changes (e.g., initializing, starting, stopping).
void ResultIsAvailable(mitk::Image::Pointer spResult, const QmitkFramesRegistrationJob *pJob)
Emitted when the registered result image is available.
void Finished()
Emitted when the job has completed (regardless of success or failure).
void Error(QString err)
Emitted when an error occurs during registration.
mitk::NodeUIDType m_TargetDataUID
UID of the target data node for provenance tracking.
void FrameRegistered(double progress)
Emitted when a single frame has been registered.
~QmitkFramesRegistrationJob() override
Destructor. Removes the algorithm event observer.
void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel)
Emitted when the algorithm changes its multi-resolution level.
void run() override
Executes the frame-by-frame registration and mapping.
mitk::BaseData::ConstPointer m_spTargetData
The 4D target image data to be registered frame-by-frame.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
std::vector< mitk::TimeStepType > IgnoreListType
std::string NodeUIDType
Type alias for node/data UID strings.
Definition: mitkUIDHelper.h:34
Settings structure controlling the behavior of a mapping (image/point set transformation) job.