NorMIT-nav  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_ */
cx::ReconstructPreprocessorPtr
boost::shared_ptr< class ReconstructPreprocessor > ReconstructPreprocessorPtr
Definition: cxReconstructPreprocessor.h:24
cxReconstructPreprocessor.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::ReconstructCorePtr
boost::shared_ptr< class ReconstructCore > ReconstructCorePtr
Definition: cxReconstructCore.h:23
cx::ReconstructionExecuter
Definition: cxReconstructionExecuter.h:33
cx::ReconstructionMethodService
Abstract interface for reconstruction algorithm.
Definition: cxReconstructionMethodService.h:54
cx::TimedAlgorithmPtr
boost::shared_ptr< class TimedBaseAlgorithm > TimedAlgorithmPtr
Definition: cxReconstructionExecuter.h:27
cxCompositeTimedAlgorithm.h
cx::ReconstructCore::InputParams
Definition: cxReconstructCore.h:41
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ViewServicePtr
boost::shared_ptr< class ViewService > ViewServicePtr
Definition: cxLogicManager.h:28
cx::ReconstructionExecuterPtr
boost::shared_ptr< class ReconstructionExecuter > ReconstructionExecuterPtr
Definition: cxReconstructionExecuter.h:28
cxReconstructionMethodService.h
cx::CompositeTimedAlgorithmPtr
boost::shared_ptr< class CompositeTimedAlgorithm > CompositeTimedAlgorithmPtr
Definition: cxUsReconstructionService.h:34
cx::USReconstructInputData
Definition: cxUSReconstructInputData.h:48
cx::ReconstructionExecuter::ReconstructionExecuter
ReconstructionExecuter(PatientModelServicePtr patientModelService, ViewServicePtr viewService)
Definition: cxReconstructionExecuter.h:37