Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
QmitkRegistrationJob.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 QmitkRegistrationJob_h
14 #define QmitkRegistrationJob_h
15 
16 // QT
17 #include <QObject>
18 #include <QRunnable>
19 
20 // ITK
21 #include <itkCommand.h>
22 
23 // MITK
24 #include "mitkUIDHelper.h"
25 #include <mitkDataNode.h>
26 #include <mitkImage.h>
28 
29 // MatchPoint
30 #include <mapDeploymentDLLInfo.h>
31 #include <mapIterativeAlgorithmInterface.h>
32 #include <mapMultiResRegistrationAlgorithmInterface.h>
33 #include <mapRegistrationAlgorithmBase.h>
34 #include <mapRegistrationBase.h>
35 
37 
38 class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkRegistrationJob : public QObject, public QRunnable
39 {
40  // this is needed for all Qt objects that should have a Qt meta-object
41  // (everything that derives from QObject and wants to have signal/slots)
42  Q_OBJECT
43 
44 public:
45  QmitkRegistrationJob(::map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
47 
48  void run() override;
49 
50 signals:
51  void Finished();
52  void Error(QString err);
53  void RegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration,
54  const QmitkRegistrationJob *pJob);
55  void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
56  void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
57  void AlgorithmStatusChanged(QString info);
58  void AlgorithmInfo(QString info);
59 
60 public:
61  // Inputs
62  mitk::BaseData::ConstPointer m_spTargetData;
63  mitk::BaseData::ConstPointer m_spMovingData;
64 
67 
68  // job settings
70  bool m_StoreReg;
72  std::string m_JobName;
77 
78  const ::map::algorithm::RegistrationAlgorithmBase *GetLoadedAlgorithm() const;
79 
80 protected:
81  typedef ::map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
82  typedef ::map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
83 
84  // Result registration.
85  ::map::core::RegistrationBase::Pointer m_spResultRegistration;
86  mitk::DataNode::Pointer m_spRegNode;
87  // mapped image. May be null if m_MapEntity is false.
88  mitk::DataNode::Pointer m_spMappedImageNode;
89 
90  ::itk::MemberCommand<QmitkRegistrationJob>::Pointer m_spCommand;
91  unsigned long m_ObserverID;
92  ::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm;
93 
94  // Helper functions
97 
98  void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
99 };
100 
101 #endif
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
~QmitkRegistrationJob() override
mitk::NodeUIDType m_TargetDataUID
::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm
::map::core::RegistrationBase::Pointer m_spResultRegistration
void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel)
void run() override
void Error(QString err)
mitk::DataNode::Pointer m_spRegNode
mitk::BaseData::ConstPointer m_spTargetData
mitk::Image::ConstPointer m_spTargetMask
mitk::NodeUIDType m_MovingDataUID
void AlgorithmInfo(QString info)
mitk::NodeUIDType m_MovingMaskDataUID
void AlgorithmStatusChanged(QString info)
::itk::MemberCommand< QmitkRegistrationJob >::Pointer m_spCommand
::map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm
::map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm
void RegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration, const QmitkRegistrationJob *pJob)
void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration)
mitk::BaseData::ConstPointer m_spMovingData
const mitk::Image * GetMovingDataAsImage() const
void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event)
mitk::NodeUIDType m_TargetMaskDataUID
mitk::Image::ConstPointer m_spMovingMask
mitk::DataNode::Pointer m_spMappedImageNode
const mitk::Image * GetTargetDataAsImage() const
const ::map::algorithm::RegistrationAlgorithmBase * GetLoadedAlgorithm() const
QmitkRegistrationJob(::map::algorithm::RegistrationAlgorithmBase *pAlgorithm)
Image class for storing images.
Definition: mitkImage.h:70
std::string NodeUIDType
Definition: mitkUIDHelper.h:26