Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkDataGenerationJobBase.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 
14 #ifndef QmitkDataGenerationJobBase_h
15 #define QmitkDataGenerationJobBase_h
16 
17 
18 //QT
19 #include <QRunnable>
20 #include <QObject>
21 #include <QMetaType>
22 
23 //MITK
24 #include <mitkBaseData.h>
25 
27 
32 class MITKIMAGESTATISTICSUI_EXPORT QmitkDataGenerationJobBase : public QObject, public QRunnable
33 {
34  Q_OBJECT
35 
36 public:
39  using ResultMapType = std::map<std::string, mitk::BaseData::Pointer>;
40 
41  virtual ResultMapType GetResults() const = 0;
42 
44  void run() final;
45 
48  bool GetComputationSuccessFlag() const;
49 
50  std::string GetLastErrorMessage() const;
51 
52  bool IsRunning() const;
53 
54 signals:
55  void Error(QString err, const QmitkDataGenerationJobBase* job);
60  void ResultsAvailable(ResultMapType results, const QmitkDataGenerationJobBase* job);
61 
62 protected:
63  QmitkDataGenerationJobBase() = default;
64 
65  virtual ~QmitkDataGenerationJobBase() = default;
66 
68  virtual bool RunComputation() = 0;
69 
70  std::string m_LastErrorMessage;
71 
72 private:
73  bool m_ComputationSuccessful = false;
74  bool m_IsRunning = false;
75 };
76 
77 #endif
MitkImageStatisticsUIExports.h
MITKIMAGESTATISTICSUI_EXPORT
#define MITKIMAGESTATISTICSUI_EXPORT
Definition: MitkImageStatisticsUIExports.h:15
mitkBaseData.h
QmitkDataGenerationJobBase
QmitkDataGenerationJobBase Base class for generation jobs used by QmitkDataGenerationBase and derived...
Definition: QmitkDataGenerationJobBase.h:32
QmitkDataGenerationJobBase::ResultMapType
std::map< std::string, mitk::BaseData::Pointer > ResultMapType
Definition: QmitkDataGenerationJobBase.h:39