Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkVideoBackground Class Reference

#include <QmitkVideoBackground.h>

Inheritance diagram for QmitkVideoBackground:
Collaboration diagram for QmitkVideoBackground:

Classes

struct  VideoBackgroundVectorInfo
 

Public Slots

void UpdateVideo ()
 

Signals

void NewFrameAvailable (mitk::VideoSource *)
 
void EndOfVideoSourceReached (mitk::VideoSource *)
 

Public Member Functions

 QmitkVideoBackground (QObject *parent=nullptr)
 
 QmitkVideoBackground (mitk::VideoSource *v, int TimerDelay=25)
 
 ~QmitkVideoBackground () override
 
void AddRenderWindow (vtkRenderWindow *renderWindow)
 add a RenderWindow in which the video is displayed. -> must be initialized before enabling the background. if the renderwindow was previously inserted it will get re-inserted (restarted videobackground) ATTENTION: to size the renderwindow correctly GetImageWidth() of the video source will be called and if no size is returned: FetchFrame() on the video source will be called to get the first frame and the corresponding size More...
 
void RemoveRenderWindow (vtkRenderWindow *renderWindow)
 removes a renderwindow = disables video background there More...
 
bool IsRenderWindowIncluded (vtkRenderWindow *renderWindow)
 
void SetTimerDelay (int ms)
 sets the update rate of the video in milli seconds, by default 25. More...
 
void Enable ()
 
void Disable ()
 disables visualization of the video. More...
 
bool IsEnabled ()
 Checks, if the Video background is currently enabled (visible). More...
 
mitk::VideoSourceGetVideoSource ()
 
int GetTimerDelay ()
 
void Pause ()
 
void Resume ()
 
void SetVideoSource (mitk::VideoSource *videoSource)
 
void OnVideoSourceDelete (const itk::Object *caller, const itk::EventObject &event)
 

Static Public Member Functions

static void OnRenderWindowDelete (vtkObject *, unsigned long eid, void *clientdata, void *)
 

Protected Types

typedef std::vector< VideoBackgroundVectorInfoRenderWindowVectorInfoType
 

Protected Member Functions

void RemoveRenderWindow (vtkRenderWindow *renderWindow, bool removeObserver)
 
void ResetVideoBackground ()
 
void Modified ()
 

Protected Attributes

RenderWindowVectorInfoType m_renderWindowVectorInfo
 
QTimer * m_QTimer
 
mitk::VideoSourcem_VideoSource
 
unsigned long m_VideoSourceObserverTag
 

Detailed Description

Displays a 3-channel (!) video data in the background of one or more vtkRenderWindow(s). The video is provided by a mitkVideoSource / GetVideoTexture(). Caution: As the texture data is not being copied, the user is responsible for a valid pointer to the data. Also the image dimensions needs to be set correctly before enabling the background.

Definition at line 41 of file QmitkVideoBackground.h.

Member Typedef Documentation

◆ RenderWindowVectorInfoType

the class has to store a list of renderwindows

Definition at line 179 of file QmitkVideoBackground.h.

Constructor & Destructor Documentation

◆ QmitkVideoBackground() [1/2]

QmitkVideoBackground::QmitkVideoBackground ( QObject *  parent = nullptr)
explicit

default ctor, TimerDelay is 40 by default you must SetVideoSource() and AddRenderWindow() afterwards

◆ QmitkVideoBackground() [2/2]

QmitkVideoBackground::QmitkVideoBackground ( mitk::VideoSource v,
int  TimerDelay = 25 
)
explicit

constructs a video background with the given video source no parent is set here, dont forget to delete the object or call setParent() TimerDelay = refresh rate of video in ms (25 ms = 40 Hz). you must call AddRenderWindow() afterwards

◆ ~QmitkVideoBackground()

QmitkVideoBackground::~QmitkVideoBackground ( )
override

disables all video backgrounds

Member Function Documentation

◆ AddRenderWindow()

void QmitkVideoBackground::AddRenderWindow ( vtkRenderWindow *  renderWindow)

add a RenderWindow in which the video is displayed. -> must be initialized before enabling the background. if the renderwindow was previously inserted it will get re-inserted (restarted videobackground) ATTENTION: to size the renderwindow correctly GetImageWidth() of the video source will be called and if no size is returned: FetchFrame() on the video source will be called to get the first frame and the corresponding size

◆ Disable()

void QmitkVideoBackground::Disable ( )

disables visualization of the video.

◆ Enable()

void QmitkVideoBackground::Enable ( )

visualizes the video. Requires image dimensions and an active videosource to be set.

◆ EndOfVideoSourceReached

void QmitkVideoBackground::EndOfVideoSourceReached ( mitk::VideoSource )
signal

◆ GetTimerDelay()

int QmitkVideoBackground::GetTimerDelay ( )

Returns the timer delay

◆ GetVideoSource()

mitk::VideoSource* QmitkVideoBackground::GetVideoSource ( )

Returns the videosource attached to this background

◆ IsEnabled()

bool QmitkVideoBackground::IsEnabled ( )

Checks, if the Video background is currently enabled (visible).

◆ IsRenderWindowIncluded()

bool QmitkVideoBackground::IsRenderWindowIncluded ( vtkRenderWindow *  renderWindow)
Returns
true if "renderWindow" is currently connected to the video background or not

◆ Modified()

void QmitkVideoBackground::Modified ( )
protected

inits all renderwindows with default values, called before video rendering is started

◆ NewFrameAvailable

void QmitkVideoBackground::NewFrameAvailable ( mitk::VideoSource )
signal

emitted after all video backgrounds are filled with the new video frame

◆ OnRenderWindowDelete()

static void QmitkVideoBackground::OnRenderWindowDelete ( vtkObject *  ,
unsigned long  eid,
void *  clientdata,
void *   
)
static

receive renderwindow delete events

◆ OnVideoSourceDelete()

void QmitkVideoBackground::OnVideoSourceDelete ( const itk::Object *  caller,
const itk::EventObject &  event 
)

receive VideoSource delete event

◆ Pause()

void QmitkVideoBackground::Pause ( )

pauses the playback (stops the update timer)

◆ RemoveRenderWindow() [1/2]

void QmitkVideoBackground::RemoveRenderWindow ( vtkRenderWindow *  renderWindow)

removes a renderwindow = disables video background there

◆ RemoveRenderWindow() [2/2]

void QmitkVideoBackground::RemoveRenderWindow ( vtkRenderWindow *  renderWindow,
bool  removeObserver 
)
protected

removes the renderwindow and also removes the observer if the flag is set

◆ ResetVideoBackground()

void QmitkVideoBackground::ResetVideoBackground ( )
protected

reset all video backgrounds

◆ Resume()

void QmitkVideoBackground::Resume ( )

resumes the playback (restarts the update timer)

◆ SetTimerDelay()

void QmitkVideoBackground::SetTimerDelay ( int  ms)

sets the update rate of the video in milli seconds, by default 25.

◆ SetVideoSource()

void QmitkVideoBackground::SetVideoSource ( mitk::VideoSource videoSource)

sets a new video source (if previously enabled, this will stop the video background if it was previously enabled

◆ UpdateVideo

void QmitkVideoBackground::UpdateVideo ( )
slot

update all video backgrounds. (called by the timer or manually by the user)

Member Data Documentation

◆ m_QTimer

QTimer* QmitkVideoBackground::m_QTimer
protected

calls updatevideo repeateadly for framegrabbing

Definition at line 190 of file QmitkVideoBackground.h.

◆ m_renderWindowVectorInfo

RenderWindowVectorInfoType QmitkVideoBackground::m_renderWindowVectorInfo
protected

a list of renderwindows and associated renderers and actors and imageimporters

Definition at line 185 of file QmitkVideoBackground.h.

◆ m_VideoSource

mitk::VideoSource* QmitkVideoBackground::m_VideoSource
protected

must implement GetVideoTexture() correctly (must return an OpenGL texture)

Definition at line 195 of file QmitkVideoBackground.h.

◆ m_VideoSourceObserverTag

unsigned long QmitkVideoBackground::m_VideoSourceObserverTag
protected

the observer tag for the video source

Definition at line 200 of file QmitkVideoBackground.h.


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