Fraxinus  18.10
An IGT application
cxReconstructThreads.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXRECONSTRUCTTHREADS_H_
12 #define CXRECONSTRUCTTHREADS_H_
13 
14 #include "org_custusx_usreconstruction_Export.h"
15 
16 #include <QObject>
17 #include <QThread>
18 #include <math.h>
19 #include "cxForwardDeclarations.h"
21 
22 namespace cx
23 {
24 typedef boost::shared_ptr<class ReconstructPreprocessor> ReconstructPreprocessorPtr;
25 typedef boost::shared_ptr<class ReconstructCore> ReconstructCorePtr;
26 
34 typedef boost::shared_ptr<class ThreadedTimedReconstructer> ThreadedTimedReconstructerPtr;
35 typedef boost::shared_ptr<class ThreadedTimedReconstructPreprocessor> ThreadedTimedReconstructPreprocessorPtr;
36 typedef boost::shared_ptr<class ThreadedTimedReconstructCore> ThreadedTimedReconstructCorePtr;
37 
50 class org_custusx_usreconstruction_EXPORT ThreadedTimedReconstructPreprocessor: public cx::ThreadedTimedAlgorithm<void>
51 {
52 Q_OBJECT
53 public:
54  static ThreadedTimedReconstructPreprocessorPtr create(PatientModelServicePtr patientModelService, ReconstructPreprocessorPtr input, std::vector<ReconstructCorePtr> cores)
55  {
56  return ThreadedTimedReconstructPreprocessorPtr(new ThreadedTimedReconstructPreprocessor(patientModelService, input, cores));
57  }
58 
59  ThreadedTimedReconstructPreprocessor(PatientModelServicePtr patientModelService, ReconstructPreprocessorPtr input, std::vector<ReconstructCorePtr> cores);
61 
62 private slots:
63  virtual void preProcessingSlot();
64  virtual void postProcessingSlot();
65 
66 private:
67  virtual void calculate();
68  ReconstructPreprocessorPtr mInput;
69  std::vector<ReconstructCorePtr> mCores;
70  PatientModelServicePtr mPatientModelService;
71 };
72 
85 //template class org_custusx_usreconstruction_EXPORT ThreadedTimedAlgorithm<void>;
86 class org_custusx_usreconstruction_EXPORT ThreadedTimedReconstructCore: public cx::ThreadedTimedAlgorithm<void>
87 {
88 Q_OBJECT
89 public:
90  static ThreadedTimedReconstructCorePtr create(PatientModelServicePtr patientModelService, ViewServicePtr viewService, ReconstructCorePtr reconstructer)
91  {
92  return ThreadedTimedReconstructCorePtr(new ThreadedTimedReconstructCore(patientModelService, viewService, reconstructer));
93  }
94  ThreadedTimedReconstructCore(PatientModelServicePtr patientModelService, ViewServicePtr viewService, ReconstructCorePtr reconstructer);
96 
97 private slots:
98  virtual void preProcessingSlot();
99  virtual void postProcessingSlot();
100 
101 private:
102  virtual void calculate();
103  ReconstructCorePtr mReconstructer;
104  PatientModelServicePtr mPatientModelService;
105  ViewServicePtr mViewService;
106 };
107 
108 
112 }
113 
114 #endif // CXRECONSTRUCTTHREADS_H_
Base class for algorithms that wants to thread and time their execution. T is the return type of the ...
Threading adapter for the reconstruction algorithm.
boost::shared_ptr< class ThreadedTimedReconstructCore > ThreadedTimedReconstructCorePtr
Threading adapter for the reconstruction algorithm.
boost::shared_ptr< class ThreadedTimedReconstructPreprocessor > ThreadedTimedReconstructPreprocessorPtr
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class ThreadedTimedReconstructer > ThreadedTimedReconstructerPtr
static ThreadedTimedReconstructCorePtr create(PatientModelServicePtr patientModelService, ViewServicePtr viewService, ReconstructCorePtr reconstructer)
static ThreadedTimedReconstructPreprocessorPtr create(PatientModelServicePtr patientModelService, ReconstructPreprocessorPtr input, std::vector< ReconstructCorePtr > cores)
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
Namespace for all CustusX production code.