Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxReconstructionExecuter.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 
12 #ifndef CXRECONSTRUCTIONEXECUTER_H_
13 #define CXRECONSTRUCTIONEXECUTER_H_
14 
15 #include "org_custusx_usreconstruction_Export.h"
16 
17 #include "boost/shared_ptr.hpp"
18 #include <QObject>
19 #include <set>
20 
24 
25 namespace cx
26 {
27 typedef boost::shared_ptr<class TimedBaseAlgorithm> TimedAlgorithmPtr;
28 typedef boost::shared_ptr<class ReconstructionExecuter> ReconstructionExecuterPtr;
29 
33 class org_custusx_usreconstruction_EXPORT ReconstructionExecuter : public QObject
34 {
35  Q_OBJECT
36 public:
37  ReconstructionExecuter(PatientModelServicePtr patientModelService, ViewServicePtr viewService) :
38  mPatientModelService(patientModelService),
39  mViewService(viewService)
40  {}
41 
45  bool startReconstruction(ReconstructionMethodService* algo, ReconstructCore::InputParams par, USReconstructInputData fileData, bool createBModeWhenAngio);
46  std::vector<cx::ImagePtr> getResult(); // return latest reconstruct result (after reconstructFinished() emitted), empty during processing.
47  cx::TimedAlgorithmPtr getThread();
48  bool startNonThreadedReconstruction(ReconstructionMethodService* algo, ReconstructCore::InputParams par, USReconstructInputData fileData, bool createBModeWhenAngio);
49 
50 signals:
51  void reconstructAboutToStart();
52  void reconstructStarted();
53  void reconstructFinished();
54 
55 private:
67  std::vector<ReconstructCorePtr> createCores(ReconstructionMethodService* algo, ReconstructCore::InputParams par, bool createBModeWhenAngio);
68 
69  void launch(cx::TimedAlgorithmPtr thread);
72  cx::CompositeTimedAlgorithmPtr assembleReconstructionPipeline(std::vector<ReconstructCorePtr> cores, ReconstructCore::InputParams par, USReconstructInputData fileData);
73  bool canCoresRunInParallel(std::vector<ReconstructCorePtr> cores);
74 
75  std::vector<ReconstructCorePtr> mCores;
76  cx::TimedAlgorithmPtr mPipeline;
77  PatientModelServicePtr mPatientModelService;
78  ViewServicePtr mViewService;
79 };
80 
81 } /* namespace cx */
82 
83 #endif /* CXRECONSTRUCTIONEXECUTER_H_ */
boost::shared_ptr< class CompositeTimedAlgorithm > CompositeTimedAlgorithmPtr
boost::shared_ptr< class ReconstructionExecuter > ReconstructionExecuterPtr
Abstract interface for reconstruction algorithm.
boost::shared_ptr< class ViewService > ViewServicePtr
ReconstructionExecuter(PatientModelServicePtr patientModelService, ViewServicePtr viewService)
boost::shared_ptr< class TimedBaseAlgorithm > TimedAlgorithmPtr
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
Namespace for all CustusX production code.