CustusX  2023.01.05-dev+develop.0da12
An IGT application
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 48 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 35 of file cxSavingVideoRecorder.cpp.

cx::VideoRecorderSaveThread::~VideoRecorderSaveThread ( )
virtual

Definition at line 50 of file cxSavingVideoRecorder.cpp.

Member Function Documentation

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

Add data to be saved.

Definition at line 54 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::cancel ( )

Definition at line 78 of file cxSavingVideoRecorder.cpp.

bool cx::VideoRecorderSaveThread::closeTimestampsFile ( )
protected

Definition at line 95 of file cxSavingVideoRecorder.cpp.

bool cx::VideoRecorderSaveThread::openTimestampsFile ( )
protected

Definition at line 84 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::run ( )
protectedvirtual

Save the images to disk

Definition at line 160 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::stop ( )

Definition at line 73 of file cxSavingVideoRecorder.cpp.

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

Definition at line 109 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::writeQueue ( )
protected

Write all pending images to file.

Definition at line 141 of file cxSavingVideoRecorder.cpp.

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

Definition at line 131 of file cxSavingVideoRecorder.cpp.

Member Data Documentation

bool cx::VideoRecorderSaveThread::mCancel
protected

Definition at line 77 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mCompressed
protected

Definition at line 79 of file cxSavingVideoRecorder.h.

int cx::VideoRecorderSaveThread::mImageIndex
protected

Definition at line 73 of file cxSavingVideoRecorder.h.

QMutex cx::VideoRecorderSaveThread::mMutex
protected

protects the mPendingData

Definition at line 75 of file cxSavingVideoRecorder.h.

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

Definition at line 74 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mPrefix
protected

Definition at line 72 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mSaveFolder
protected

Definition at line 71 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mStop
protected

Definition at line 76 of file cxSavingVideoRecorder.h.

QFile cx::VideoRecorderSaveThread::mTimestampsFile
protected

Definition at line 78 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mWriteColor
protected

Definition at line 80 of file cxSavingVideoRecorder.h.


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