GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoVideoRecorder.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  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  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #ifndef __QGOVIDEORECORDER_H
36 #define __QGOVIDEORECORDER_H
37 
38 #include "ui_NewVideoRecorderDockWidget.h"
39 
40 #include <iostream>
41 #include <fstream>
42 #include <string>
43 
44 #include "QGoGUILibConfigure.h"
45 
46 #include "vtkSmartPointer.h"
47 #include "QGoDockWidget.h"
48 
49 class vtkRenderWindow;
51 
52 #ifdef ENABLEFFMPEG
54 #endif
55 
56 #ifdef ENABLEAVI
58 #endif
59 /*
60  * \brief QGoVideoRecorder to record videos to using AVI or FFMPEG
61  */
62 class QGOGUILIB_EXPORT QGoVideoRecorder:
63  public QGoDockWidget, private Ui::NewDockWidgetVideoRecorder
64 {
65  Q_OBJECT
66 public:
70  explicit QGoVideoRecorder(QWidget *parent = 0);
75 
80  void SetXMinAndMax(const int &, const int &);
81 
86  void SetYMinAndMax(const int &, const int &);
87 
92  void SetZMinAndMax(const int &, const int &);
93 
98  void SetTMinAndMax(const int &, const int &);
99 
103  void SetCurrentX(const int &);
104 
108  void SetCurrentY(const int &);
109 
113  void SetCurrentZ(const int &);
114 
118  void SetCurrentT(const int &);
119 
120  std::ofstream m_OutputVideoFile;
121 
123 
124  unsigned int m_FrameRate2;
125  unsigned int m_VideoQuality2;
127  // in tab "record video"
128  unsigned int m_WindowSelected;
129 
130  unsigned int m_XMinForVideo;
131  unsigned int m_XMaxForVideo;
132  unsigned int m_YMinForVideo;
133  unsigned int m_YMaxForVideo;
134  unsigned int m_ZMinForVideo;
135  unsigned int m_ZMaxForVideo;
136  unsigned int m_TMinForVideo;
137  unsigned int m_TMaxForVideo;
138 
140  unsigned int m_FrameCounter;
141 
143 
144  void SetMovieRecorder(vtkRenderWindowMovieRecorder *);
145 
146 public slots:
147  void SetSpecificParametersFrameRate(int iValue);
148 
149  void SetSpecificParametersQuality(int iValue);
150 
151 signals:
152  void XSliceChanged(int);
153 
154  void YSliceChanged(int);
155 
156  void ZSliceChanged(int);
157 
158  void TSliceChanged(int);
159 
160  void QualityChanged(int);
161 
162  void FrameRateChanged(int);
163 
164  void GetSliceView();
165 
166 protected:
167 #ifdef ENABLEFFMPEG
168  vtkFFMPEGRenderWindowRecorder * m_FFMPEGWriter;
169 #else
170  #ifdef ENABLEAVI
171  vtkAVIRenderWindowRecorder * m_AVIWriter;
172  #endif
173 #endif
174 private:
175 
176  // Video recorder
178 
179  // Min/Max value of X/Y/ZSlice to set up spin box
180  unsigned int m_XMin;
181  unsigned int m_XMax;
182  unsigned int m_YMin;
183  unsigned int m_YMax;
184  unsigned int m_ZMin;
185  unsigned int m_ZMax;
186  unsigned int m_TMin;
187  unsigned int m_TMax;
188 
189  unsigned int m_CurrentX;
190  unsigned int m_CurrentY;
191  unsigned int m_CurrentZ;
192  unsigned int m_CurrentT;
193 
197  void UpdateQSpinBoxFT(int);
198 
202  void AcquireWithPause(int);
203 
204  void emitChangeSliceSignal(const int &, const int &);
205 
206 private slots:
207 
208  // in tab "create video"
209  //Choose a slice T Fixed
213  void on_tSpinMin_2_valueChanged(int);
214 
218  void on_tSpinMax_2_valueChanged(int);
219 
220  //Video parameters
224  void on_createFile_clicked();
225 
229  void on_frameRate_valueChanged(int);
230 
234  void on_videoQuality_valueChanged(int);
235 
236  //Video parameters
240  void on_createFile_2_clicked();
241 
245  void on_frameRate_2_valueChanged(int);
246 
250  void on_videoQuality_2_valueChanged(int);
251 
255  void on_SliceFT_activated(int);
256 
260  void onStartVideoClicked();
261 
265  void onStartRecordClicked();
266 
270  void onEndRecordClicked();
271 
275  void timeout();
276 
280  void on_pauseVideo_clicked();
281 
285  void on_endVideo_clicked();
286 
287 public slots:
288  void SetRenderingWindow(vtkRenderWindow *);
289 };
290 
291 #endif
unsigned int m_CurrentX
unsigned int m_VideoQuality2
unsigned int m_TMax
unsigned int m_XMax
unsigned int m_CurrentT
unsigned int m_FrameRate2
unsigned int m_ZMinForVideo
unsigned int m_WindowSelected
unsigned int m_CurrentY
vtkRenderWindowMovieRecorder * m_VideoRecorder
unsigned int m_YMinForVideo
unsigned int m_FrameCounter
unsigned int m_YMin
unsigned int m_TMin
unsigned int m_ZMax
unsigned int m_XMaxForVideo
unsigned int m_XMinForVideo
unsigned int m_ZMaxForVideo
unsigned int m_XMin
unsigned int m_CurrentZ
unsigned int m_TMinForVideo
std::ofstream m_OutputVideoFile
unsigned int m_YMax
inherits from Qt QDockWidget.toggle action reimplemented in order the state is saved when changing ta...
Definition: QGoDockWidget.h:47
unsigned int m_YMaxForVideo
unsigned int m_TMaxForVideo
unsigned int m_ZMin