CustusX  15.4.0-beta
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxUSAcquisition.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 #ifndef CXUSACQUISITION_H_
33 #define CXUSACQUISITION_H_
34 
35 #include "org_custusx_acquisition_Export.h"
36 
37 #include <vector>
38 #include "cxForwardDeclarations.h"
39 
40 namespace cx
41 {
42 struct USReconstructInputData;
43 }
44 namespace cx
45 {
46 typedef boost::shared_ptr<class UsReconstructionFileMaker> UsReconstructionFileMakerPtr;
47 typedef boost::shared_ptr<class SavingVideoRecorder> SavingVideoRecorderPtr;
48 typedef boost::shared_ptr<class USSavingRecorder> USSavingRecorderPtr;
49 typedef boost::shared_ptr<class Acquisition> AcquisitionPtr;
50 typedef boost::shared_ptr<class UsReconstructionService> UsReconstructionServicePtr;
51 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
52 typedef boost::shared_ptr<class UsReconstructionService> UsReconstructionServicePtr;
53 typedef boost::shared_ptr<class VisServices> VisServicesPtr;
54 
55 
77 class org_custusx_acquisition_EXPORT USAcquisition : public QObject
78 {
79  Q_OBJECT
80 public:
81  USAcquisition(AcquisitionPtr base, QObject* parent = 0);
82  virtual ~USAcquisition();
83  int getNumberOfSavingThreads() const;
84  bool isReady() const { return mReady; }
85  QString getInfoText() const { return mInfoText; }
86 
87 signals:
88  void acquisitionDataReady();
89  void saveDataCompleted(QString mhdFilename);
90 
94  void readinessChanged();
95 
96 private slots:
97  void checkIfReadySlot();
98  void recordStarted();
99  void recordStopped();
100  void recordCancelled();
101 
102 private:
103  std::vector<VideoSourcePtr> getRecordingVideoSources(ToolPtr tool);
104  bool getWriteColor();
105  void sendAcquisitionDataToReconstructer();
106  void setReady(bool val, QString text);
107 
108  VisServicesPtr getServices();
109  UsReconstructionServicePtr getReconstructer();
110 
111  AcquisitionPtr mBase;
112  USSavingRecorderPtr mCore;
113  bool mReady;
114  QString mInfoText;
115 };
116 typedef boost::shared_ptr<USAcquisition> USAcquisitionPtr;
117 
121 }
122 
123 #endif /* CXUSACQUISITION_H_ */
boost::shared_ptr< class UsReconstructionService > UsReconstructionServicePtr
QString getInfoText() const
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:62
boost::shared_ptr< class USSavingRecorder > USSavingRecorderPtr
bool isReady() const
boost::shared_ptr< class SavingVideoRecorder > SavingVideoRecorderPtr
boost::shared_ptr< class Acquisition > AcquisitionPtr
boost::shared_ptr< class USAcquisition > USAcquisitionPtr
boost::shared_ptr< class UsReconstructionFileMaker > UsReconstructionFileMakerPtr
Handles the us acquisition process.The USAcquisition object attaches itself to an input Acquisition o...
boost::shared_ptr< class Tool > ToolPtr