VideoVis
0.9
Generates a volume visualisation of a video
|
This class loads video files and renders a volume visualisation using OpenGL 3.3. More...
#include <glwidget.h>
Public Member Functions | |
GLWidget (QWidget *parent=0) | |
This is the default constructor. More... | |
~GLWidget () | |
This is the default destructor. More... | |
QSize | minimumSizeHint () const |
QSize | sizeHint () const |
VFLResult | openVideoFile (const QString &videoFilePath, int *hRes, int *vRes) |
Opens a video file. More... | |
VFLResult | loadVideoFile (int startFrame, int stepSize, int endFrame) |
Loads the currently open video file and displays it. More... | |
int | getFrameCount () |
Returns the number of frames that have been loaded. More... | |
void | setFrameOffset (int frameOffset) |
Changes the offset of the displayed video. More... | |
void | setStyle (bool horseShoeView) |
Sets the style of the displayed video volume. More... | |
void | setBoxSize (int boxSize) |
Sets the scale factor of the volume box in z-Direction. More... | |
void | setStepSize (float stepSize) |
Sets the stepsize used by the ray casting algorithm. More... | |
void | setMetric (VVMetric metric) |
Sets the used metric. More... | |
void | setTransferFunction (GLfloat *tfArray, int arraySize) |
Sets the used transfer function. More... | |
Protected Member Functions | |
void | initializeGL () |
void | paintGL () |
void | resizeGL (int width, int height) |
void | mouseMoveEvent (QMouseEvent *event) |
void | mousePressEvent (QMouseEvent *event) |
void | mouseReleaseEvent (QMouseEvent *event) |
void | wheelEvent (QWheelEvent *event) |
Protected Attributes | |
PFNGLGENVERTEXARRAYSPROC | glGenVertexArrays |
PFNGLBINDVERTEXARRAYPROC | glBindVertexArray |
PFNGLTEXIMAGE3DPROC | glTexImage3D |
This class loads video files and renders a volume visualisation using OpenGL 3.3.
The volume visualisation is constructed using a ray casting algorithm written in GLSL. The result can be modiefied using the following methods. It is derived from QGLWidget and QOpenGLFunctions and should be inserted as a widget into a QT program.
Definition at line 36 of file glwidget.h.
GLWidget::GLWidget | ( | QWidget * | parent = 0 ) |
This is the default constructor.
QT uses this constructor of you put the widget into a Qt designer form
parent | a pointer to the parent widget |
Definition at line 9 of file glwidget.cpp.
GLWidget::~GLWidget | ( | ) |
This is the default destructor.
Definition at line 65 of file glwidget.cpp.
int GLWidget::getFrameCount | ( | ) |
Returns the number of frames that have been loaded.
Definition at line 418 of file glwidget.cpp.
|
protected |
Definition at line 84 of file glwidget.cpp.
VFLResult GLWidget::loadVideoFile | ( | int | startFrame, |
int | stepSize, | ||
int | endFrame | ||
) |
Loads the currently open video file and displays it.
The video file is loaded into a 3D Texture. This method can also be called to reload the file. When this method is called the old video data is deleted.
startFrame | integer that specifies the first frame to load (starting with 1) |
stepSize | integer that specifies the steps between frames (starting with 1) |
endFrame | integer that specifies the last frame, if 0 the method tries to load all frames in the file |
Definition at line 218 of file glwidget.cpp.
QSize GLWidget::minimumSizeHint | ( | ) | const |
Definition at line 76 of file glwidget.cpp.
|
protected |
Definition at line 638 of file glwidget.cpp.
|
protected |
Definition at line 611 of file glwidget.cpp.
|
protected |
Definition at line 622 of file glwidget.cpp.
VFLResult GLWidget::openVideoFile | ( | const QString & | videoFilePath, |
int * | hRes, | ||
int * | vRes | ||
) |
Opens a video file.
The video file should be in a format, that is readable by a codec installed on the target machine. The widget is using the custom CVideoFrameToTextureLoader class to open the video file. It can also be called to change to video file.
videoFilePath | a QString containing the path to the video file in windows format |
hRes | a pointer to an integer receiving the horizontal resolution of the loaded video |
vRes | a pointer to an integer receiving the vertical resolution of the loaded video |
Definition at line 194 of file glwidget.cpp.
|
protected |
Definition at line 151 of file glwidget.cpp.
|
protected |
Definition at line 184 of file glwidget.cpp.
void GLWidget::setBoxSize | ( | int | boxSize) |
Sets the scale factor of the volume box in z-Direction.
This value is saved regardless of the set style. When the box style is chosen, the change becomes visible. Nonetheless, the method initiates a redraw
boxSize | an integer specifying the scale factor |
Definition at line 702 of file glwidget.cpp.
void GLWidget::setFrameOffset | ( | int | frameOffset) |
Changes the offset of the displayed video.
The frame offset changes the first frame that is visible on the bounding value. All other frames are rotated accordingly. When the frame offset is set, a redraw is initiated.
frameOffset | integer that specifies the start frame (starts at 0) |
Definition at line 430 of file glwidget.cpp.
void GLWidget::setMetric | ( | VVMetric | metric) |
Sets the used metric.
The avaliable metrices are VV_METRIC_NONE, VV_METRIC_YDIF, VV_METRIC_YMSE, VV_METRIC_YNDIF, VV_METRIC_YNMSE or VV_METRIC_IQDIF. Depending on the metric and if it's shown first the method can take a long time to calculate the neccessary prerequisits for the volume visualisation. This method initiates a redraw.
metric | VVMetric value that specifies the desired metric |
Definition at line 709 of file glwidget.cpp.
void GLWidget::setStepSize | ( | float | stepSize) |
Sets the stepsize used by the ray casting algorithm.
Use this method with caution. Very small values can overtax the graphics card easyly. This method initiates a redraw.
stepSize | float value specifying the step size (0 < stepSize < 1) |
Definition at line 696 of file glwidget.cpp.
void GLWidget::setStyle | ( | bool | horseShoeView) |
Sets the style of the displayed video volume.
There are only two options. Horse show view or block view. When this method is called, a redraw is initiated.
horseShoeView | boolean that specifies the style; if true the horse shoe view is selected, block view is otherwise chosen |
Definition at line 437 of file glwidget.cpp.
void GLWidget::setTransferFunction | ( | GLfloat * | tfArray, |
int | arraySize | ||
) |
Sets the used transfer function.
This parameter has to be set to get any good result. The transfer function must be an evenly spaced aray of 4 component float vectors. The components are RGBA. The values are distributed over the luminace axis and specify, the opacity (A) over the complete range of the luminace. For all the metrics accept VV_METRIC_NONE the color values are also used to define the color of the voxels with this luminance. The vectors in between are interpolated.
tfArray | pointer to a float array |
arraySize | number of 4-component float vectors |
Definition at line 771 of file glwidget.cpp.
QSize GLWidget::sizeHint | ( | ) | const |
Definition at line 79 of file glwidget.cpp.
|
protected |
Definition at line 630 of file glwidget.cpp.
|
protected |
Definition at line 150 of file glwidget.h.
|
protected |
Definition at line 149 of file glwidget.h.
|
protected |
Definition at line 151 of file glwidget.h.