CustusX  2021.04.22-dev+develop.337f9
An IGT application
cx::VideoRecorderSaveThread Class Reference

#include <cxSavingVideoRecorder.h>

Inheritance diagram for cx::VideoRecorderSaveThread:


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.

Dwc 2, 2012

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 ( )

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 ( )

Definition at line 95 of file cxSavingVideoRecorder.cpp.

bool cx::VideoRecorderSaveThread::openTimestampsFile ( )

Definition at line 84 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::run ( )

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)

Definition at line 109 of file cxSavingVideoRecorder.cpp.

void cx::VideoRecorderSaveThread::writeQueue ( )

Write all pending images to file.

Definition at line 141 of file cxSavingVideoRecorder.cpp.

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

Definition at line 131 of file cxSavingVideoRecorder.cpp.

Member Data Documentation

bool cx::VideoRecorderSaveThread::mCancel

Definition at line 77 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mCompressed

Definition at line 79 of file cxSavingVideoRecorder.h.

int cx::VideoRecorderSaveThread::mImageIndex

Definition at line 73 of file cxSavingVideoRecorder.h.

QMutex cx::VideoRecorderSaveThread::mMutex

protects the mPendingData

Definition at line 75 of file cxSavingVideoRecorder.h.

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

Definition at line 74 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mPrefix

Definition at line 72 of file cxSavingVideoRecorder.h.

QString cx::VideoRecorderSaveThread::mSaveFolder

Definition at line 71 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mStop

Definition at line 76 of file cxSavingVideoRecorder.h.

QFile cx::VideoRecorderSaveThread::mTimestampsFile

Definition at line 78 of file cxSavingVideoRecorder.h.

bool cx::VideoRecorderSaveThread::mWriteColor

Definition at line 80 of file cxSavingVideoRecorder.h.

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