Medical Imaging Interaction Toolkit  2022.04.99-2e1e005b
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 signals:
53  void Error(QString err, const QmitkDataGenerationJobBase* job);
58  void ResultsAvailable(ResultMapType results, const QmitkDataGenerationJobBase* job);
59 
60 protected:
61  QmitkDataGenerationJobBase() = default;
62 
63  virtual ~QmitkDataGenerationJobBase() = default;
64 
66  virtual bool RunComputation() = 0;
67 
68  std::string m_LastErrorMessage;
69 
70 private:
71  bool m_ComputationSuccessful = false;
72 };
73 
74 #endif
#define MITKIMAGESTATISTICSUI_EXPORT
STL namespace.
std::map< std::string, mitk::BaseData::Pointer > ResultMapType
QmitkDataGenerationJobBase Base class for generation jobs used by QmitkDataGenerationBase and derived...