GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoVideoRecorder.cxx
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 #include "QGoVideoRecorder.h"
36 
37 #include <QFileDialog>
38 #include <QTimer>
39 
40 #include "QGoImageView3D.h"
41 
42 #include "vtkRenderWindow.h"
44 
45 #ifdef ENABLEFFMPEG
47 #endif
48 
49 #ifdef ENABLEAVI
51 #endif
52 
53 //-------------------------------------------------------------------------
55  m_VideoName2(""), m_FrameRate2(10), m_VideoQuality2(2), m_SliceFT(0),
56  m_WindowSelected(0), m_XMinForVideo(0), m_XMaxForVideo(0),
57  m_YMinForVideo(0), m_YMaxForVideo(0), m_ZMinForVideo(0),
58  m_ZMaxForVideo(0), m_TMinForVideo(0), m_TMaxForVideo(0),
59  m_FrameCounter(0), m_RenderWindowSelected(false)
60 {
61  this->setupUi(this);
62 
63  QObject::connect( this->startVideo, SIGNAL( clicked() ),
64  this, SLOT( onStartVideoClicked() ) );
65  QObject::connect( this->startRecord, SIGNAL( clicked() ),
66  this, SLOT( onStartRecordClicked() ) );
67  QObject::connect( this->endRecord, SIGNAL( clicked() ),
68  this, SLOT( onEndRecordClicked() ) );
69 
70  QIcon videoIcon( QPixmap( QString::fromUtf8(":/fig/video.png") ) );
71  this->m_ToggleAction->setIcon(videoIcon);
72  this->m_ToggleAction
73  ->setStatusTip( tr("You have to be in full screen view to use the video recording") );
74  this->warning_1->hide();
75  this->warning_2->hide();
76 
77  // Tooltips to help the user
78  QString ttoolTip = "Start recording the video";
79  this->startVideo->setToolTip(ttoolTip);
80  ttoolTip = "First slice of the video";
81  this->tSpinMin_2->setToolTip(ttoolTip);
82  ttoolTip = "Last slice of the video";
83  this->tSpinMax_2->setToolTip(ttoolTip);
84  ttoolTip = "Location and name of the video";
85  this->createFile->setToolTip(ttoolTip);
86  ttoolTip = "Create video along this axe";
87  this->SliceFT->setToolTip(ttoolTip);
88  ttoolTip = "Continue creating video from selected time points";
89  this->pauseVideo->setToolTip(ttoolTip);
90  ttoolTip = "End the video";
91  this->endVideo->setToolTip(ttoolTip);
92  ttoolTip = "Create video without manual interaction (usefull in 2D)";
93  this->tabVideoMethod1->setToolTip(ttoolTip);
94  ttoolTip = "Create video with manual interaction (usefull in 3D)";
95  this->tabVideoMethod2->setToolTip(ttoolTip);
96  ttoolTip = "Quality of the output video (high=2, medium=1, low=0)";
97  this->videoQuality->setToolTip(ttoolTip);
98 
99  m_InternalTimer = new QTimer(this);
100 
102  this, SLOT( timeout() ) );
103 
104  //Initalize chrono with .00 (not 0)
105  QString value = "0.00";
106  this->videoLenght->display(value);
107  this->endRecord->setEnabled(false);
108 
109  this->tabVideoWidget->setEnabled(false);
110 
111 #ifdef ENABLEFFMPEG
112  m_FFMPEGWriter = vtkFFMPEGRenderWindowRecorder::New();
113  this->SetMovieRecorder(m_FFMPEGWriter);
114 #endif /* ENABLEFFMPEG */
115 
116 #ifdef ENABLEAVI
117  m_AVIWriter = vtkAVIRenderWindowRecorder::New();
118  this->SetMovieRecorder(m_AVIWriter);
119 #endif /* ENABLEAVI */
120 
121  QObject::connect( this, SIGNAL( FrameRateChanged(int) ),
122  this, SLOT( SetSpecificParametersFrameRate(int) ) );
123  QObject::connect( this, SIGNAL( QualityChanged(int) ),
124  this, SLOT( SetSpecificParametersQuality(int) ) );
125 }
126 
127 //-------------------------------------------------------------------------
128 
129 //-------------------------------------------------------------------------
132 {
133 #ifdef ENABLEFFMPEG
134  m_FFMPEGWriter->Delete();
135 #endif
136 
137 #ifdef ENABLEAVI
138  m_AVIWriter->Delete();
139 #endif
140 }
141 
142 //-------------------------------------------------------------------------
143 
144 //-------------------------------------------------------------------------
145 void
146 QGoVideoRecorder::SetXMinAndMax(const int & XMin, const int & XMax)
147 {
148  m_XMin = XMin;
149  m_XMax = XMax;
150 
151  m_XMinForVideo = XMin;
152  m_XMaxForVideo = XMax;
153 
154  //Initialization of the spinboxes
155  this->tSpinMin_2->setMinimum(m_XMin);
156  this->tSpinMin_2->setMaximum(m_XMax);
157  this->tSpinMin_2->setValue(m_XMin);
158 
159  this->tSpinMax_2->setMinimum(m_XMin);
160  this->tSpinMax_2->setMaximum(m_XMax);
161  this->tSpinMax_2->setValue(m_XMax);
162 }
163 
164 //-------------------------------------------------------------------------
165 
166 //-------------------------------------------------------------------------
167 void
168 QGoVideoRecorder::SetYMinAndMax(const int & YMin, const int & YMax)
169 {
170  m_YMin = YMin;
171  m_YMax = YMax;
172 
173  m_YMinForVideo = YMin;
174  m_YMaxForVideo = YMax;
175 }
176 
177 //-------------------------------------------------------------------------
178 
179 //-------------------------------------------------------------------------
180 void
181 QGoVideoRecorder::SetZMinAndMax(const int & ZMin, const int & ZMax)
182 {
183  m_ZMin = ZMin;
184  m_ZMax = ZMax;
185 
186  m_ZMinForVideo = ZMin;
187  m_ZMaxForVideo = ZMax;
188 }
189 
190 //-------------------------------------------------------------------------
191 
192 //-------------------------------------------------------------------------
193 void
194 QGoVideoRecorder::SetTMinAndMax(const int & TMin, const int & TMax)
195 {
196  m_TMin = TMin;
197  m_TMax = TMax;
198 
199  m_TMinForVideo = TMin;
200  m_TMaxForVideo = TMax;
201 }
202 
203 //-------------------------------------------------------------------------
204 
205 //-------------------------------------------------------------------------
206 void
208 {
209  m_CurrentX = X;
210 }
211 
212 //-------------------------------------------------------------------------
213 
214 //-------------------------------------------------------------------------
215 void
217 {
218  m_CurrentY = Y;
219 }
220 
221 //-------------------------------------------------------------------------
222 
223 //-------------------------------------------------------------------------
224 void
226 {
227  m_CurrentZ = Z;
228 }
229 
230 //-------------------------------------------------------------------------
231 
232 //-------------------------------------------------------------------------
233 void
235 {
236  m_CurrentT = T;
237 }
238 
239 //-------------------------------------------------------------------------
240 
241 //-------------------------------------------------------------------------
242 void
244 {
245  switch ( value )
246  {
247  case 0:
248  {
249  // X Slice
250  this->tSpinMin_2->setMinimum(m_XMin);
251  this->tSpinMin_2->setMaximum(m_XMax);
252  this->tSpinMin_2->setValue(m_XMin);
253 
254  this->tSpinMax_2->setMinimum(m_XMin);
255  this->tSpinMax_2->setMaximum(m_XMax);
256  this->tSpinMax_2->setValue(m_XMax);
257 
258  m_SliceFT = 0;
259  break;
260  }
261 
262  case 1:
263  {
264  // Y Slice
265  this->tSpinMin_2->setMinimum(m_YMin);
266  this->tSpinMin_2->setMaximum(m_YMax);
267  this->tSpinMin_2->setValue(m_YMin);
268 
269  this->tSpinMax_2->setMinimum(m_YMin);
270  this->tSpinMax_2->setMaximum(m_YMax);
271  this->tSpinMax_2->setValue(m_YMax);
272 
273  m_SliceFT = 1;
274  break;
275  }
276 
277  case 2:
278  {
279  // Z Slice
280  this->tSpinMin_2->setMinimum(m_ZMin);
281  this->tSpinMin_2->setMaximum(m_ZMax);
282  this->tSpinMin_2->setValue(m_ZMin);
283 
284  this->tSpinMax_2->setMinimum(m_ZMin);
285  this->tSpinMax_2->setMaximum(m_ZMax);
286  this->tSpinMax_2->setValue(m_ZMax);
287 
288  m_SliceFT = 2;
289  break;
290  }
291 
292  default:
293  case 3:
294  {
295  // Z Slice
296  this->tSpinMin_2->setMinimum(m_TMin);
297  this->tSpinMin_2->setMaximum(m_TMax);
298  this->tSpinMin_2->setValue(m_TMin);
299 
300  this->tSpinMax_2->setMinimum(m_TMin);
301  this->tSpinMax_2->setMaximum(m_TMax);
302  this->tSpinMax_2->setValue(m_TMax);
303 
304  m_SliceFT = 3;
305  break;
306  }
307  }
308 }
309 
310 //-------------------------------------------------------------------------
311 
312 //-------------------------------------------------------------------------
313 void
315 {
316  UpdateQSpinBoxFT(value);
317 }
318 
319 //-------------------------------------------------------------------------
320 
321 //-------------------------------------------------------------------------
322 void
324 {
325  switch ( m_SliceFT )
326  {
327  case 0:
328  {
329  // X Slice
330  m_XMinForVideo = value;
331  break;
332  }
333 
334  case 1:
335  {
336  // Y Slice
337  m_YMinForVideo = value;
338  break;
339  }
340 
341  case 2:
342  {
343  // Z Slice
344  m_ZMinForVideo = value;
345  break;
346  }
347 
348  default:
349  case 3:
350  {
351  // Z Slice
352  m_TMinForVideo = value;
353  break;
354  }
355  }
356 }
357 
358 //-------------------------------------------------------------------------
359 
360 //-------------------------------------------------------------------------
361 void
363 {
364  switch ( m_SliceFT )
365  {
366  case 0:
367  {
368  // X Slice
369  m_XMaxForVideo = value;
370  break;
371  }
372 
373  case 1:
374  {
375  // Y Slice
376  m_YMaxForVideo = value;
377  break;
378  }
379 
380  case 2:
381  {
382  // Y Slice
383  m_ZMaxForVideo = value;
384  break;
385  }
386 
387  default:
388  case 3:
389  {
390  // Y Slice
391  m_TMaxForVideo = value;
392  break;
393  }
394  }
395 }
396 
397 //-------------------------------------------------------------------------
398 
399 //-------------------------------------------------------------------------
400 void
402 {
404  tr("Folder to Save Video"), "fileName", 0);
405 
406  this->createFile->setStyleSheet("background-color: rgb(0, 255, 0); color: rgb(0, 0, 0)");
407  this->createFile_2->setStyleSheet("background-color: rgb(255, 165, 0); color: rgb(0, 0, 0)");
408 
409  QPalette plt;
410  plt.setColor(QPalette::WindowText, Qt::black);
411  this->label->setPalette(plt);
412  this->label_2->setPalette(plt);
413 }
414 
415 //-------------------------------------------------------------------------
416 
417 //-------------------------------------------------------------------------
418 void
420 {
421  if ( m_FrameRate2 != static_cast< unsigned int >( value ) )
422  {
423  m_FrameRate2 = static_cast< unsigned int >( value );
424  this->frameRate_2->setValue(value);
425  emit FrameRateChanged(value);
426  }
427 }
428 
429 //-------------------------------------------------------------------------
430 
431 //-------------------------------------------------------------------------
432 void
434 {
435  if ( m_VideoQuality2 != static_cast< unsigned int >( value ) )
436  {
437  m_VideoQuality2 = static_cast< unsigned int >( value );
438  this->videoQuality_2->setValue(value);
439  emit QualityChanged(value);
440  }
441 }
442 
443 //-------------------------------------------------------------------------
444 
445 //-------------------------------------------------------------------------
446 void
448 {
450  tr("Folder to Save Video"), "fileName", 0);
451 
452  this->createFile_2->setStyleSheet("background-color: rgb(0, 255, 0); color: rgb(0, 0, 0)");
453  this->createFile->setStyleSheet("background-color: rgb(255, 165, 0); color: rgb(0, 0, 0)");
454 
455  QPalette plt;
456  plt.setColor(QPalette::WindowText, Qt::black);
457  this->label->setPalette(plt);
458  this->label_2->setPalette(plt);
459 }
460 
461 //-------------------------------------------------------------------------
462 
463 //-------------------------------------------------------------------------
464 void
466 {
467  if ( m_FrameRate2 != static_cast< unsigned int >( value ) )
468  {
469  m_FrameRate2 = static_cast< unsigned int >( value );
470  this->frameRate->setValue(value);
471  emit FrameRateChanged(value);
472  }
473 }
474 
475 //-------------------------------------------------------------------------
476 
477 //-------------------------------------------------------------------------
478 void
480 {
481  if ( m_VideoQuality2 != static_cast< unsigned int >( value ) )
482  {
483  m_VideoQuality2 = static_cast< unsigned int >( value );
484  this->videoQuality->setValue(value);
485  emit QualityChanged(value);
486  }
487 }
488 
489 //-------------------------------------------------------------------------
490 
491 //-------------------------------------------------------------------------
492 void
494 {
495  //something to record first view
497  {
498  QPalette plt;
499  plt.setColor(QPalette::WindowText, Qt::red);
500  this->label->setPalette(plt);
501  this->label_2->setPalette(plt);
502 
503  this->createFile->setStyleSheet("background-color: rgb(255, 0, 0); color: rgb(0, 0, 0)");
504  this->createFile_2->setStyleSheet("background-color: rgb(255, 0, 0)");
505  }
506  else
507  {
508  QString fileName = m_VideoName2;
509  QString fileName2 = m_VideoName2;
510 
511  if ( !fileName.endsWith(".avi") )
512  {
513  fileName.insert( fileName.size(), QString(".avi") );
514  fileName2.insert( fileName.size(), QString(".txt") );
515  }
516  else
517  {
518  fileName2.replace( QString(".avi"), QString(".txt") );
519  }
520 
521  m_VideoRecorder->SetFileName( fileName.toStdString() );
523 
524  this->startVideo->setEnabled(false);
525 
526  m_OutputVideoFile.open( fileName2.toStdString().c_str() );
527  m_OutputVideoFile << "FrameRate: ";
529  m_OutputVideoFile << "\nVideoQuality: ";
531  m_OutputVideoFile << "\nX Y Z T ";
532 
534  }
535 }
536 
537 //-------------------------------------------------------------------------
538 
539 //-------------------------------------------------------------------------
540 void
542 {
543  if ( ( m_VideoName2 == NULL ) || ( !m_RenderWindowSelected ) )
544  {
545  QPalette plt;
546  plt.setColor(QPalette::WindowText, Qt::red);
547  this->label->setPalette(plt);
548  this->label_2->setPalette(plt);
549  this->createFile->setStyleSheet("background-color: rgb(255, 0, 0)");
550  this->createFile_2->setStyleSheet("background-color: rgb(255, 0, 0); color: rgb(0, 0, 0)");
551  }
552  else
553  {
554  this->createFile_2->setEnabled(false);
555  this->frameRate_2->setEnabled(false);
556  this->videoQuality_2->setEnabled(false);
557  this->startRecord->setEnabled(false);
558  this->tabVideoMethod1->setEnabled(false);
559  this->endRecord->setEnabled(true);
560 
561  QString fileName = m_VideoName2;
562 
563  if ( !fileName.endsWith(".avi") )
564  {
565  fileName.insert( fileName.size(), QString(".avi") );
566  }
567 
568  m_VideoRecorder->SetFileName( fileName.toStdString() );
569 
572  }
573 }
574 
575 //-------------------------------------------------------------------------
576 
577 //-------------------------------------------------------------------------
578 void
580 {
581  m_OutputVideoFile.close();
582 
585  m_FrameCounter = 0;
586 
587  this->createFile_2->setEnabled(true);
588  this->frameRate_2->setEnabled(true);
589  this->videoQuality_2->setEnabled(true);
590  this->startRecord->setEnabled(true);
591  this->tabVideoMethod1->setEnabled(true);
592  this->endRecord->setEnabled(false);
593 }
594 
595 //-------------------------------------------------------------------------
596 
597 //-------------------------------------------------------------------------
598 void
600 {
602  ++m_FrameCounter;
603 
604  // for a better visualisation, always show 2 decimal
605  double doubleCounter;
606  doubleCounter = (double)m_FrameCounter / (double)m_FrameRate2;
607 
608  int test = 100 * doubleCounter;
609  QString value = QString::number(test, 10);
610 
611  if ( test >= 10 )
612  {
613  value.insert( value.size() - 2, QString(".") );
614  }
615  else
616  {
617  value.insert( value.size() - 1, QString(".0") );
618  }
619 
620  if ( test < 100 )
621  {
622  value.insert( value.size() - 3, QString("0") );
623  }
624  this->videoLenght->display(value);
625 }
626 
627 //---------------------------------------------------------------------------
628 
629 //---------------------------------------------------------------------------
630 void
631 QGoVideoRecorder::SetRenderingWindow(vtkRenderWindow *iRenderingWindow)
632 {
633  m_RenderWindowSelected = iRenderingWindow;
634  this->tabVideoWidget->setEnabled(m_RenderWindowSelected);
635 
637  {
638  m_VideoRecorder->SetRenderingWindow(iRenderingWindow);
639  }
640 
641  //Tell the user to go in full screen mode
642  /* if( iRenderingWindow )
643  {
644  this->warning_1->hide();
645  this->warning_2->hide();
646  }
647  else
648  {
649  this->warning_1->show();
650  this->warning_2->show();
651  }*/
652 
656 }
657 
658 //-------------------------------------------------------------------------
659 
660 //-------------------------------------------------------------------------
661 void
663 {
664  m_VideoRecorder = Test;
665 }
666 
667 //-------------------------------------------------------------------------
668 
669 //-------------------------------------------------------------------------
670 void
672 {
673  unsigned int iMin;
674  unsigned int iMax;
675 
676  switch ( value )
677  {
678  case 0:
679  {
680  // X Slice
681  iMin = m_XMinForVideo;
682  iMax = m_XMaxForVideo;
683  break;
684  }
685  case 1:
686  {
687  // Y Slice
688  iMin = m_YMinForVideo;
689  iMax = m_YMaxForVideo;
690  break;
691  }
692 
693  case 2:
694  {
695  // Z Slice
696  iMin = m_ZMinForVideo;
697  iMax = m_ZMaxForVideo;
698  break;
699  }
700 
701  default:
702  case 3:
703  {
704  // T Slice
705  iMin = m_TMinForVideo;
706  iMax = m_TMaxForVideo;
707  break;
708  }
709  }
710 
711  for ( unsigned int i = iMin; i < iMax + 1; i++ )
712  {
713  //send signal to change slice
714  emitChangeSliceSignal(value, i);
715 
716  //send signal to know our position in the 3D volume
717  emit GetSliceView();
718  m_OutputVideoFile << "\n";
720  m_OutputVideoFile << " ";
722  m_OutputVideoFile << " ";
724  m_OutputVideoFile << " ";
726 
727  //capture screen
729  }
730  this->pauseVideo->setEnabled(true);
731  this->endVideo->setEnabled(true);
732 }
733 
734 //-------------------------------------------------------------------------
735 
736 //-------------------------------------------------------------------------
737 void
739 {
741 }
742 
743 //-------------------------------------------------------------------------
744 
745 //-------------------------------------------------------------------------
746 void
748 {
750 
751  this->endVideo->setEnabled(false);
752  this->pauseVideo->setEnabled(false);
753  this->startVideo->setEnabled(true);
754 }
755 
756 //-------------------------------------------------------------------------
757 
758 //-------------------------------------------------------------------------
759 void
760 QGoVideoRecorder::emitChangeSliceSignal(const int & iSlice, const int & iSlide)
761 {
762  switch ( iSlice )
763  {
764  case 0:
765  {
766  // X Slice
767  emit XSliceChanged(iSlide);
768  break;
769  }
770  case 1:
771  {
772  // Y Slice
773  emit YSliceChanged(iSlide);
774  break;
775  }
776  case 2:
777  {
778  // Z Slice
779  emit ZSliceChanged(iSlide);
780  break;
781  }
782 
783  default:
784  case 3:
785  {
786  // Z Slice
787  emit TSliceChanged(iSlide);
788  break;
789  }
790  }
791 }
792 
793 void
795 {
796  m_VideoRecorder->SetFrameRate(iValue);
798 }
799 
800 void
802 {
804  m_VideoRecorder->SetBitRate(iValue * 1024 * 1024 * 32);
806 }
std::string toStdString() const
unsigned int m_CurrentX
void onEndRecordClicked()
Function called when "End video" clicked in Record tab.
unsigned int m_VideoQuality2
void timeout()
Function called with the timer to take snapshots.
unsigned int m_TMax
void setupUi(QWidget *widget)
unsigned int m_XMax
void SetXMinAndMax(const int &, const int &)
Set value X Min and Max for a given image (useful for spin boxes) when image is loaded, to know boundaries of the spin box to be used.
void SetSpecificParametersFrameRate(int iValue)
void SetRenderingWindow(vtkRenderWindow *)
Set the rendering window to be observed.
void SetCurrentT(const int &)
Set current T value (useful for spin boxes)
void setColor(ColorGroup group, ColorRole role, const QColor &color)
unsigned int m_CurrentT
void EndCapture()
End the video acquisition.
unsigned int m_FrameRate2
void on_frameRate_valueChanged(int)
Function called when FrameRate changes.
unsigned int m_ZMinForVideo
void SetCurrentY(const int &)
Set current Y value (useful for spin boxes)
void setIcon(const QIcon &icon)
int size() const
void SetSpecificParametersQuality(int iValue)
~QGoVideoRecorder()
Destructor.
unsigned int m_CurrentY
vtkRenderWindowMovieRecorder * m_VideoRecorder
void on_frameRate_2_valueChanged(int)
Update value of frame rate.
void on_SliceFT_activated(int)
Update content of spin box depending of selected slice (X,Y,Z)
void SetTMinAndMax(const int &, const int &)
Set value T Min and Max for a given image (useful for spin boxes) when image is loaded, to know boundaries of the spin box to be used.
void XSliceChanged(int)
QString tr(const char *sourceText, const char *disambiguation, int n)
unsigned int m_YMinForVideo
bool isNull() const
unsigned int m_FrameCounter
void UpdateQSpinBoxFT(int)
Function to update spinbox extent according to selected slice.
void AcquireWithPause(int)
Function to create the video with "pauses".
void on_videoQuality_2_valueChanged(int)
Update value of video quality.
void on_tSpinMax_2_valueChanged(int)
Update ending slice for video (fixed time point)
QString number(int n, int base)
void onStartRecordClicked()
Function called when "Create video" clicked in Record tab.
QString fromUtf8(const char *str, int size)
unsigned int m_YMin
QString & insert(int position, QChar ch)
static vtkFFMPEGRenderWindowRecorder * New()
void emitChangeSliceSignal(const int &, const int &)
void on_videoQuality_valueChanged(int)
Function called when VideoQuality changes.
unsigned int m_TMin
void TSliceChanged(int)
void ZSliceChanged(int)
void TakeSnapshot()
Take a snapshot of the current rendering window.
bool isEmpty() const
void QualityChanged(int)
unsigned int m_ZMax
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
QAction * m_ToggleAction
Definition: QGoDockWidget.h:58
unsigned int m_XMaxForVideo
void on_endVideo_clicked()
Function called when we want to stop video while it is in pause.
void SetCurrentZ(const int &)
Set current Z value (useful for spin boxes)
void FrameRateChanged(int)
unsigned int m_XMinForVideo
void stop()
unsigned int m_ZMaxForVideo
void StartCapture()
Start the video acquisition.
void on_createFile_clicked()
Create the video from.
QString & replace(int position, int n, QChar after)
unsigned int m_XMin
void setStatusTip(const QString &statusTip)
unsigned int m_CurrentZ
void onStartVideoClicked()
Function called when "Create video" clicked in Create tab.
void SetFileName(const std::string &)
Set the name of the video.
void SetCurrentX(const int &)
Set current X value (useful for spin boxes)
void SetMovieRecorder(vtkRenderWindowMovieRecorder *)
void on_createFile_2_clicked()
Function called to choose name/path of output file.
unsigned int m_TMinForVideo
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
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
void SetRenderingWindow(vtkRenderWindow *)
QGoVideoRecorder(QWidget *parent=0)
Constructor.
void start(int msec)
unsigned int m_YMaxForVideo
void SetYMinAndMax(const int &, const int &)
Set value Y Min and Max for a given image (useful for spin boxes) when image is loaded, to know boundaries of the spin box to be used.
unsigned int m_TMaxForVideo
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void on_tSpinMin_2_valueChanged(int)
Update starting slice for video (fixed time point)
void SetZMinAndMax(const int &, const int &)
Set value Z Min and Max for a given image (useful for spin boxes) when image is loaded, to know boundaries of the spin box to be used.
void YSliceChanged(int)
static vtkAVIRenderWindowRecorder * New()
void on_pauseVideo_clicked()
Function called when we want to restart video while it is in pause.
virtual void SetSpecificParameters()=0
unsigned int m_ZMin