Fraxinus  16.5.0-fx-rc1
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxUsReconstructionImplService.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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXUSRECONSTRUCTIONIMPLSERVICE_H
34 #define CXUSRECONSTRUCTIONIMPLSERVICE_H
35 
36 #include "org_custusx_usreconstruction_Export.h"
38 
42 
43 class ctkPluginContext;
44 
45 namespace cx
46 {
47 
48 
74 class org_custusx_usreconstruction_EXPORT UsReconstructionImplService : public UsReconstructionService
75 {
76  Q_OBJECT
77  Q_INTERFACES(cx::UsReconstructionService)
78 
79 public:
80  UsReconstructionImplService(ctkPluginContext* pluginContext, PatientModelServicePtr patientModelService, ViewServicePtr viewService, XmlOptionFile settings);
81  virtual ~UsReconstructionImplService();
82  virtual bool isNull();
83 
84  virtual void selectData(QString filename, QString calFilesPath = "");
85  virtual void selectData(USReconstructInputData data);
86 
87  virtual QString getSelectedFilename() const;
88  virtual USReconstructInputData getSelectedFileData();
89  virtual PropertyPtr getParam(QString uid);
90 
91  virtual std::vector<PropertyPtr> getAlgoOptions();
92  virtual XmlOptionFile getSettings();
93  virtual OutputVolumeParams getOutputVolumeParams() const;
94 
95  virtual void setOutputVolumeParams(const OutputVolumeParams& par);
96 
103  virtual void startReconstruction();
104  virtual std::set<cx::TimedAlgorithmPtr> getThreadedReconstruction();
105 
110  virtual ReconstructionMethodService* createAlgorithm();
111 
112  virtual ReconstructCore::InputParams createCoreParameters();
113 
114 public slots:
115  virtual void newDataOnDisk(QString mhdFilename);
116 
117 private slots:
118  void setSettings();
119  void reconstructFinishedSlot();
120 
121  void patientChangedSlot();
122 
123 private:
124  void clearAll();
125 
129  void updateFromOriginalFileData();
130 
131  void onServiceAdded(ReconstructionMethodService* service);
132  void onServiceModified(ReconstructionMethodService* service);
133  void onServiceRemoved(ReconstructionMethodService* service);
134 
135  ReconstructParamsPtr mParams;
136  std::vector<PropertyPtr> mAlgoOptions;
137  USReconstructInputData mOriginalFileData;
138 
139  OutputVolumeParams mOutputVolumeParams;
140  XmlOptionFile mSettings;
141  QString mShaderPath;
142 
143  boost::shared_ptr<ServiceTrackerListener<ReconstructionMethodService> > mServiceListener;
144  std::vector<ReconstructionExecuterPtr> mExecuters;
145 
146  PatientModelServicePtr mPatientModelService;
147  ViewServicePtr mViewService;
148 };
149 
153 }
154 
155 
156 
157 #endif // CXUSRECONSTRUCTIONIMPLSERVICE_H
Abstract interface for reconstruction algorithm.
boost::shared_ptr< class ViewService > ViewServicePtr
Helper struct for sending and controlling output volume properties.
boost::shared_ptr< class ReconstructParams > ReconstructParamsPtr
boost::shared_ptr< class Property > PropertyPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Manager for the us reconstruction process.
Settings * settings()
Shortcut for accessing the settings instance.
Definition: cxSettings.cpp:42
cxLogicManager_EXPORT ViewServicePtr viewService()
Helper class for xml files used to store ssc/cx data.