Medical Imaging Interaction Toolkit  2023.04.00
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);
46  ~QmitkRegistrationJob() override;
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
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;
87  // mapped image. May be null if m_MapEntity is false.
89 
90  ::itk::MemberCommand<QmitkRegistrationJob>::Pointer m_spCommand;
91  unsigned long m_ObserverID;
92  ::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm;
93 
94  // Helper functions
95  const mitk::Image *GetTargetDataAsImage() const;
96  const mitk::Image *GetMovingDataAsImage() const;
97 
98  void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
99 };
100 
101 #endif
QmitkRegistrationJob::m_ErrorOccured
bool m_ErrorOccured
Definition: QmitkRegistrationJob.h:71
QmitkRegistrationJob::m_spRegNode
mitk::DataNode::Pointer m_spRegNode
Definition: QmitkRegistrationJob.h:86
QmitkRegistrationJob::m_JobName
std::string m_JobName
Definition: QmitkRegistrationJob.h:72
QmitkRegistrationJob::IMultiResAlgorithm
::map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm
Definition: QmitkRegistrationJob.h:82
QmitkRegistrationJob::m_MovingMaskDataUID
mitk::NodeUIDType m_MovingMaskDataUID
Definition: QmitkRegistrationJob.h:76
mitkImage.h
QmitkRegistrationJob::m_spCommand
::itk::MemberCommand< QmitkRegistrationJob >::Pointer m_spCommand
Definition: QmitkRegistrationJob.h:90
QmitkRegistrationJob::m_spMovingMask
mitk::Image::ConstPointer m_spMovingMask
Definition: QmitkRegistrationJob.h:66
mitkUIDHelper.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
QmitkRegistrationJob::m_TargetMaskDataUID
mitk::NodeUIDType m_TargetMaskDataUID
Definition: QmitkRegistrationJob.h:75
QmitkRegistrationJob::m_ObserverID
unsigned long m_ObserverID
Definition: QmitkRegistrationJob.h:91
QmitkRegistrationJob::IIterativeAlgorithm
::map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm
Definition: QmitkRegistrationJob.h:81
QmitkRegistrationJob::m_spMappedImageNode
mitk::DataNode::Pointer m_spMappedImageNode
Definition: QmitkRegistrationJob.h:88
QmitkRegistrationJob::m_StoreReg
bool m_StoreReg
Definition: QmitkRegistrationJob.h:70
QmitkRegistrationJob::m_spTargetData
mitk::BaseData::ConstPointer m_spTargetData
Definition: QmitkRegistrationJob.h:62
QmitkRegistrationJob::m_spTargetMask
mitk::Image::ConstPointer m_spTargetMask
Definition: QmitkRegistrationJob.h:65
QmitkRegistrationJob::m_MovingDataUID
mitk::NodeUIDType m_MovingDataUID
Definition: QmitkRegistrationJob.h:74
QmitkRegistrationJob::m_TargetDataUID
mitk::NodeUIDType m_TargetDataUID
Definition: QmitkRegistrationJob.h:73
QmitkRegistrationJob::m_spLoadedAlgorithm
::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm
Definition: QmitkRegistrationJob.h:92
MITKMATCHPOINTREGISTRATIONUI_EXPORT
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
Definition: MitkMatchPointRegistrationUIExports.h:15
QmitkRegistrationJob::m_spResultRegistration
::map::core::RegistrationBase::Pointer m_spResultRegistration
Definition: QmitkRegistrationJob.h:85
mitkDataNode.h
QmitkRegistrationJob
Definition: QmitkRegistrationJob.h:38
QmitkRegistrationJob::m_MapEntity
bool m_MapEntity
Definition: QmitkRegistrationJob.h:69
mitk::NodeUIDType
std::string NodeUIDType
Definition: mitkUIDHelper.h:26
QmitkRegistrationJob::m_spMovingData
mitk::BaseData::ConstPointer m_spMovingData
Definition: QmitkRegistrationJob.h:63
MitkMatchPointRegistrationUIExports.h
mitkMAPRegistrationWrapper.h
mbilog::Error
@ Error
Definition: mbilogLoggingTypes.h:29