CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxUSSavingRecorder.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 CXUSSAVINGRECORDER_H
12 #define CXUSSAVINGRECORDER_H
13 
14 #include "org_custusx_acquisition_Export.h"
15 
16 #include <vector>
17 #include <QFutureWatcher>
18 #include "cxForwardDeclarations.h"
19 #include "cxTransform3D.h"
20 
21 namespace cx
22 {
23 struct USReconstructInputData;
24 }
25 namespace cx
26 {
27 typedef boost::shared_ptr<class UsReconstructionFileMaker> UsReconstructionFileMakerPtr;
28 typedef boost::shared_ptr<class SavingVideoRecorder> SavingVideoRecorderPtr;
29 typedef boost::shared_ptr<class RecordSession> RecordSessionPtr;
30 
56 class org_custusx_acquisition_EXPORT USSavingRecorder : public QObject
57 {
58  Q_OBJECT
59 public:
61  virtual ~USSavingRecorder();
65  void startRecord(RecordSessionPtr session, ToolPtr tool, ToolPtr reference, std::vector<VideoSourcePtr> video, FileManagerServicePtr filemanager);
66  void stopRecord();
67  void cancelRecord();
68 
69  void setWriteColor(bool on);
70  void set_rMpr(Transform3D rMpr);
74  USReconstructInputData getDataForStream(QString streamUid);
80  void startSaveData(QString baseFolder, bool compressImages);
81  size_t getNumberOfSavingThreads() const;
82  void clearRecording();
83 
84 signals:
85  void saveDataCompleted(QString mhdFilename);
86 
87 private slots:
88  void fileMakerWriteFinished();
89 private:
90 // std::map<double, Transform3D> getToolHistory(ToolPtr tool, RecordSessionPtr session);
91  void saveStreamSession(USReconstructInputData reconstructData, QString saveFolder, QString streamSessionName, bool compress);
92  USReconstructInputData getDataForStream(unsigned videoRecorderIndex);
93 
94  RecordSessionPtr mSession;
95  std::list<QFutureWatcher<QString>*> mSaveThreads;
96  // video and tool used at start of recording:
97  std::vector<SavingVideoRecorderPtr> mVideoRecorder;
98  ToolPtr mRecordingTool;
99  ToolPtr mReference;
100  bool mDoWriteColor;
101  Transform3D m_rMpr;
102 };
103 typedef boost::shared_ptr<USSavingRecorder> USSavingRecorderPtr;
104 
108 }
109 
110 #endif // CXUSSAVINGRECORDER_H
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class USSavingRecorder > USSavingRecorderPtr
Record and save ultrasound data.Use the start/stop pair to record video from the input streams during...
boost::shared_ptr< class SavingVideoRecorder > SavingVideoRecorderPtr
boost::shared_ptr< class RecordSession > RecordSessionPtr
boost::shared_ptr< class UsReconstructionFileMaker > UsReconstructionFileMakerPtr
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr