CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxPipeline.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 CXPIPELINE_H
12 #define CXPIPELINE_H
13 
14 #include "cxResourceFilterExport.h"
15 
16 #include "cxFilter.h"
17 #include "cxFilterGroup.h"
18 #include "cxXmlOptionItem.h"
20 
21 namespace cx
22 {
23 typedef boost::shared_ptr<class TimedBaseAlgorithm> TimedAlgorithmPtr;
24 typedef boost::shared_ptr<class CompositeTimedAlgorithm> CompositeTimedAlgorithmPtr;
25 
26 typedef boost::shared_ptr<class StringPropertyFusedInputOutputSelectData> StringPropertyFusedInputOutputSelectDataPtr;
27 
37 {
38  Q_OBJECT
39 public:
41  static StringPropertyFusedInputOutputSelectDataPtr create(PatientModelServicePtr patientModelService, SelectDataStringPropertyBasePtr base, SelectDataStringPropertyBasePtr input);
42 
43 public: // basic methods
44  virtual QString getDisplayName() const;
45  virtual bool setValue(const QString& value);
46  virtual QString getValue() const;
47 
48 public: // optional methods
49  virtual QStringList getValueRange() const;
50  virtual QString convertInternal2Display(QString internal);
51  virtual QString getHelp() const;
52 
53 public: // interface extension
54  virtual DataPtr getData() const;
55  virtual void setValueName(const QString name);
56  virtual void setHelp(QString text);
57 
58 protected slots:
59  void inputDataChangedSlot();
60  void changedSlot();
61 
62 protected:
66  QString mValueName;
67 };
68 
69 
70 
78 class cxResourceFilter_EXPORT Pipeline : public QObject
79 {
80  Q_OBJECT
81 public:
82  explicit Pipeline(PatientModelServicePtr patientModelService, QObject *parent = 0);
86  void initialize(FilterGroupPtr filter);
90  FilterGroupPtr getFilters() const;
97  void setOption(QString valueName, QVariant value);
106  std::vector<SelectDataStringPropertyBasePtr> getNodes();
112  TimedAlgorithmPtr getTimedAlgorithm(QString uid);
119  TimedAlgorithmPtr getPipelineTimedAlgorithm();
129  void execute(QString uid = "");
130 
131 signals:
132 
133 public slots:
134  void nodeValueChanged(QString uid, int index);
135 
136 private:
137  void setOption(PropertyPtr adapter, QVariant value);
138  std::vector<SelectDataStringPropertyBasePtr> createNodes();
139 
140  FilterGroupPtr mFilters;
141  std::vector<SelectDataStringPropertyBasePtr> mNodes;
142  std::map<QString, TimedAlgorithmPtr> mTimedAlgorithm;
143  CompositeTimedAlgorithmPtr mCompositeTimedAlgorithm;
144  PatientModelServicePtr mPatientModelService;
145 };
146 typedef boost::shared_ptr<Pipeline> PipelinePtr;
147 
148 } // namespace cx
149 
150 #endif // CXPIPELINE_H
boost::shared_ptr< class CompositeTimedAlgorithm > CompositeTimedAlgorithmPtr
SelectDataStringPropertyBasePtr mInput
Definition: cxPipeline.h:64
boost::shared_ptr< class Data > DataPtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
boost::shared_ptr< class TimedBaseAlgorithm > TimedAlgorithmPtr
boost::shared_ptr< class Property > PropertyPtr
boost::shared_ptr< class StringPropertyFusedInputOutputSelectData > StringPropertyFusedInputOutputSelectDataPtr
Definition: cxPipeline.h:26
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< FilterGroup > FilterGroupPtr
Definition: cxFilterGroup.h:65
SelectDataStringPropertyBasePtr mBase
Definition: cxPipeline.h:65
Namespace for all CustusX production code.
boost::shared_ptr< Pipeline > PipelinePtr
Definition: cxPipeline.h:146