CustusX  16.5.0-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::VideoRecorderSaveThread Class Reference

#include <cxSavingVideoRecorder.h>

Inheritance diagram for cx::VideoRecorderSaveThread:

Classes

struct  DataType
 

Public Member Functions

 VideoRecorderSaveThread (QObject *parent, QString saveFolder, QString prefix, bool compressed, bool writeColor)
 
virtual ~VideoRecorderSaveThread ()
 
QString addData (TimeInfo timestamp, vtkImageDataPtr data)
 
void stop ()
 
void cancel ()
 

Protected Member Functions

virtual void run ()
 
void writeQueue ()
 
bool openTimestampsFile ()
 
bool closeTimestampsFile ()
 
void write (DataType data)
 
void writeTimeStampsFile (TimeInfo timeStamps)
 

Protected Attributes

QString mSaveFolder
 
QString mPrefix
 
int mImageIndex
 
std::list< DataTypemPendingData
 
QMutex mMutex
 protects the mPendingData More...
 
bool mStop
 
bool mCancel
 
QFile mTimestampsFile
 
bool mCompressed
 
bool mWriteColor
 

Detailed Description

Class that saves vtkImageData continously to file.

The data are saved as separate files in the saveSolder, using prefix as a common filename component:

A single file named <prefix>.fts containing N lines with timestamps is written. A sequence of N files named <prefix>_i.mhd (0<i<N) and corresponding .raw files are written.

If stop() is called, the thread will continue to write all remaining data, then close files and return from run().

Note: quit() will not work on this thread, use stop() instead.

Date
Dwc 2, 2012
Author
christiana

Definition at line 69 of file cxSavingVideoRecorder.h.

Constructor & Destructor Documentation

cx::VideoRecorderSaveThread::VideoRecorderSaveThread ( QObject *  parent,
QString  saveFolder,
QString  prefix,
bool  compressed,
bool  writeColor 
)

Create the thread object, set folder to save to.

Definition at line 56 of file cxSavingVideoRecorder.cpp.

cx::VideoRecorderSaveThread::~VideoRecorderSaveThread ( )
virtual

Definition at line 71 of file cxSavingVideoRecorder.cpp.

Member Function Documentation

QString cx::VideoRecorderSaveThread::addData ( TimeInfo  timestamp,
vtkImageDataPtr  data 
)

Add data to be saved.

Definition at line 75 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::cancel ( )

Definition at line 99 of file cxSavingVideoRecorder.cpp.

bool cx::VideoRecorderSaveThread::closeTimestampsFile ( )
protected

Definition at line 116 of file cxSavingVideoRecorder.cpp.

bool cx::VideoRecorderSaveThread::openTimestampsFile ( )
protected

Definition at line 105 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::run ( )
protectedvirtual

Save the images to disk

Definition at line 181 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::stop ( )

Definition at line 94 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::write ( VideoRecorderSaveThread::DataType  data)
protected

Definition at line 130 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::writeQueue ( )
protected

Write all pending images to file.

Definition at line 162 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::writeTimeStampsFile ( TimeInfo  timeStamps)
protected

Definition at line 152 of file cxSavingVideoRecorder.cpp.

Member Data Documentation

bool cx::VideoRecorderSaveThread::mCancel
protected

Definition at line 98 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mCompressed
protected

Definition at line 100 of file cxSavingVideoRecorder.h.

int cx::VideoRecorderSaveThread::mImageIndex
protected

Definition at line 94 of file cxSavingVideoRecorder.h.

QMutex cx::VideoRecorderSaveThread::mMutex
protected

protects the mPendingData

Definition at line 96 of file cxSavingVideoRecorder.h.

std::list<DataType> cx::VideoRecorderSaveThread::mPendingData
protected

Definition at line 95 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mPrefix
protected

Definition at line 93 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mSaveFolder
protected

Definition at line 92 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mStop
protected

Definition at line 97 of file cxSavingVideoRecorder.h.

QFile cx::VideoRecorderSaveThread::mTimestampsFile
protected

Definition at line 99 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mWriteColor
protected

Definition at line 101 of file cxSavingVideoRecorder.h.


The documentation for this class was generated from the following files: