CustusX  18.04
An IGT application
cxPlaybackUSAcquisitionVideo.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 CXPLAYBACKUSACQUISITIONVIDEO_H_
12 #define CXPLAYBACKUSACQUISITIONVIDEO_H_
13 
14 #include "org_custusx_core_video_Export.h"
15 
16 #include <QObject>
17 #include <QFuture>
18 #include <QFutureWatcher>
19 #include <vector>
20 #include "cxVideoSource.h"
22 #include "cxPlaybackTime.h"
23 #include "cxForwardDeclarations.h"
24 
25 namespace cx
26 {
27 typedef boost::shared_ptr<class BasicVideoSource> BasicVideoSourcePtr;
28 typedef boost::shared_ptr<class VideoServiceBackend> VideoServiceBackendPtr;
29 
44 class org_custusx_core_video_EXPORT USAcquisitionVideoPlayback : public QObject
45 {
46  Q_OBJECT
47 public:
48  explicit USAcquisitionVideoPlayback(VideoServiceBackendPtr backend, QString type);
49  virtual ~USAcquisitionVideoPlayback();
50  VideoSourcePtr getVideoSource();
51  void setRoot(const QString path);
52  void setTime(PlaybackTimePtr controller);
53  bool isActive() const;
54  std::vector<TimelineEvent> getEvents();
55 
56  QString getType() const;
57 
58 private slots:
59  void timerChangedSlot();
60  void usDataLoadFinishedSlot();
61 
62 private:
63  void updateFrame(QString filename);
64  void loadFullData(QString filename);
65  QStringList getAbsolutePathToFtsFiles(QString folder);
66  QString mRoot;
67  QString mType;
68  PlaybackTimePtr mTimer;
69  BasicVideoSourcePtr mVideoSource;
70  std::vector<TimelineEvent> mEvents;
71  const QString mVideoSourceUid;
72 
73  USReconstructInputData mCurrentData;
74  std::vector<double> mCurrentTimestamps; // copy of time frame timestamps from mCurrentData.
75 
76  UsReconstructionFileReaderPtr mUSImageDataReader;
77  QFuture<USReconstructInputData> mUSImageDataFutureResult;
78  QFutureWatcher<USReconstructInputData> mUSImageDataFutureWatcher;
79 
80  VideoServiceBackendPtr mBackend;
81 };
82 typedef boost::shared_ptr<USAcquisitionVideoPlayback> USAcquisitionVideoPlaybackPtr;
83 
84 
88 }
89 
90 #endif /* CXPLAYBACKUSACQUISITIONVIDEO_H_ */
Handler for playback of US image data from a US recording session.
boost::shared_ptr< class VideoServiceBackend > VideoServiceBackendPtr
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
boost::shared_ptr< class UsReconstructionFileReader > UsReconstructionFileReaderPtr
boost::shared_ptr< USAcquisitionVideoPlayback > USAcquisitionVideoPlaybackPtr
boost::shared_ptr< class VideoSource > VideoSourcePtr
boost::shared_ptr< class BasicVideoSource > BasicVideoSourcePtr
Namespace for all CustusX production code.