Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkIGTPlayerWidget Class Reference

GUI to access the IGT Player. User must specify the file name where the input xml-file is located. The NavigationDatas from the xml-file can be played in normal mode or in PointSet mode. More...

#include <QmitkIGTPlayerWidget.h>

Inheritance diagram for QmitkIGTPlayerWidget:
Collaboration diagram for QmitkIGTPlayerWidget:

Public Types

enum  PlaybackMode { RealTimeMode, SequentialMode }
 

Signals

void SignalPlayingStarted ()
 This signal is emitted when the player starts the playback. More...
 
void SignalPlayingResumed ()
 This signal is emitted when the player resumes after a pause. More...
 
void SignalPlayingStopped ()
 This signal is emitted when the player stops. More...
 
void SignalPlayingPaused ()
 This signal is emitted when the player is paused. More...
 
void SignalPlayingEnded ()
 This signal is emitted when the player reaches the end of the playback. More...
 
void SignalPlayerUpdated ()
 This signal is emitted every time the player updated the NavigationDatas. More...
 
void SignalInputFileChanged ()
 This signal is emitted if the input file for the replay was changed. More...
 
void SignalCurrentTrajectoryChanged (int index)
 This signal is emitted if the index of the current selected trajectory select combobox item changes. More...
 
void SignalSplineModeToggled (bool toggled)
 This signal is emitted if the spline mode checkbox is toggled or untoggled. More...
 

Public Member Functions

 QmitkIGTPlayerWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 default constructor More...
 
 ~QmitkIGTPlayerWidget ()
 default deconstructor More...
 
QTimer * GetPlayingTimer ()
 Sets the real time player for this player widget. More...
 
const std::vector< mitk::NavigationData::Pointer > GetNavigationDatas ()
 Returns the current playback NavigationDatas from the xml-file. More...
 
const mitk::PointSet::Pointer GetNavigationDatasPointSet ()
 Returns a PointSet of the current NavigationDatas for all recorded tools. More...
 
const mitk::PointSet::PointType GetNavigationDataPoint (unsigned int index)
 Returns a PointType of the current NavigationData for a specific tool with the given index. More...
 
void SetUpdateRate (unsigned int msecs)
 Sets the update rate of this widget's playing timer. More...
 
unsigned int GetNumberOfTools ()
 Returns the number of different tools from the current playing stream. More...
 
void StopPlaying ()
 Stops the playback. More...
 
void SetTrajectoryNames (const QStringList toolNames)
 Sets the given tool names list to the trajectory select combobox. More...
 
int GetResolution ()
 Returns the current resolution value from the resolution spinbox. More...
 
void ClearTrajectorySelectCombobox ()
 Clears all items in the trajectory selection combobox. More...
 
bool IsTrajectoryInSplineMode ()
 Returns whether spline mode checkbox is selected. More...
 
PlaybackMode GetCurrentPlaybackMode ()
 

Static Public Attributes

static const std::string VIEW_ID
 

Protected Slots

void OnPlayButtonClicked (bool toggled)
 Starts or pauses the playback. More...
 
void OnPlaying ()
 Updates the playback data. More...
 
void OnStopPlaying ()
 Stops the playback. More...
 
void OnOpenFileButtonPressed ()
 Opens file open dialog for searching the input file. More...
 
void OnGoToEnd ()
 Stops the playback. More...
 
void OnGoToBegin ()
 Stops the playback and resets the player to the beginning. More...
 
void OnSequencialModeToggled (bool toggled)
 Switches widget between realtime and sequential mode. More...
 
void OnSliderPressed ()
 Pauses playback when slider is pressed by user. More...
 
void OnSliderReleased ()
 Moves player position to the position selected with the slider. More...
 

Protected Member Functions

virtual void CreateConnections ()
 Creation of the connections. More...
 
bool CheckInputFileValid ()
 Checks if an imput file with the set filename exists. More...
 
void ResetLCDNumbers ()
 Sets all LCD numbers to 0. More...
 

Protected Attributes

Ui::QmitkIGTPlayerWidgetControls * m_Controls
 
mitk::NavigationDataPlayer::Pointer m_RealTimePlayer
 plays NDs from a XML file More...
 
mitk::NavigationDataSequentialPlayer::Pointer m_SequentialPlayer
 
QString m_CmpFilename
 filename of the input file More...
 
QTimer * m_PlayingTimer
 update timer More...
 
mitk::NavigationData::TimeStampType m_StartTime
 start time of playback needed for time display More...
 
unsigned int m_CurrentSequentialPointNumber
 current point number More...
 

Detailed Description

GUI to access the IGT Player. User must specify the file name where the input xml-file is located. The NavigationDatas from the xml-file can be played in normal mode or in PointSet mode.

Documentation: In normal mode the player updates the NavigationDatas every 100ms (can be changed in SetUpdateRate()) and returns them when GetNavigationDatas() is called. In PointSet mode the player generates a PointSet with all NavigationDatas from the xml-file. So the playback is performed on this ND PointSet.

Definition at line 47 of file QmitkIGTPlayerWidget.h.

Member Enumeration Documentation

Enumerator
RealTimeMode 

playback mode enum

SequentialMode 

Definition at line 134 of file QmitkIGTPlayerWidget.h.

Constructor & Destructor Documentation

QmitkIGTPlayerWidget::QmitkIGTPlayerWidget ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

default constructor

Definition at line 35 of file QmitkIGTPlayerWidget.cpp.

References CreateConnections(), m_Controls, m_PlayingTimer, and ResetLCDNumbers().

QmitkIGTPlayerWidget::~QmitkIGTPlayerWidget ( )

default deconstructor

Definition at line 53 of file QmitkIGTPlayerWidget.cpp.

References m_Controls, and m_PlayingTimer.

Member Function Documentation

bool QmitkIGTPlayerWidget::CheckInputFileValid ( )
protected

Checks if an imput file with the set filename exists.

Definition at line 83 of file QmitkIGTPlayerWidget.cpp.

References m_CmpFilename.

Referenced by OnPlayButtonClicked().

void QmitkIGTPlayerWidget::ClearTrajectorySelectCombobox ( )

Clears all items in the trajectory selection combobox.

Definition at line 528 of file QmitkIGTPlayerWidget.cpp.

References m_Controls, and SignalCurrentTrajectoryChanged().

Referenced by SetTrajectoryNames().

void QmitkIGTPlayerWidget::CreateConnections ( )
protectedvirtual
const mitk::PointSet::PointType QmitkIGTPlayerWidget::GetNavigationDataPoint ( unsigned int  index)

Returns a PointType of the current NavigationData for a specific tool with the given index.

Definition at line 405 of file QmitkIGTPlayerWidget.cpp.

References GetCurrentPlaybackMode(), GetNumberOfTools(), m_RealTimePlayer, m_SequentialPlayer, RealTimeMode, and SequentialMode.

const std::vector< mitk::NavigationData::Pointer > QmitkIGTPlayerWidget::GetNavigationDatas ( )

Returns the current playback NavigationDatas from the xml-file.

Definition at line 343 of file QmitkIGTPlayerWidget.cpp.

References GetCurrentPlaybackMode(), m_RealTimePlayer, m_SequentialPlayer, RealTimeMode, and SequentialMode.

const mitk::PointSet::Pointer QmitkIGTPlayerWidget::GetNavigationDatasPointSet ( )

Returns a PointSet of the current NavigationDatas for all recorded tools.

Definition at line 366 of file QmitkIGTPlayerWidget.cpp.

References GetCurrentPlaybackMode(), m_RealTimePlayer, m_SequentialPlayer, mitk::PointSet::New(), RealTimeMode, and SequentialMode.

unsigned int QmitkIGTPlayerWidget::GetNumberOfTools ( )

Returns the number of different tools from the current playing stream.

Retuns 0 if playback file is invalid.

Definition at line 97 of file QmitkIGTPlayerWidget.cpp.

References GetCurrentPlaybackMode(), m_RealTimePlayer, m_SequentialPlayer, RealTimeMode, and SequentialMode.

Referenced by GetNavigationDataPoint().

QTimer * QmitkIGTPlayerWidget::GetPlayingTimer ( )

Sets the real time player for this player widget.

Sets the sequential player for this player widget

Returns the playing timer of this widget

Definition at line 250 of file QmitkIGTPlayerWidget.cpp.

References m_PlayingTimer.

int QmitkIGTPlayerWidget::GetResolution ( )

Returns the current resolution value from the resolution spinbox.

Definition at line 523 of file QmitkIGTPlayerWidget.cpp.

References m_Controls.

bool QmitkIGTPlayerWidget::IsTrajectoryInSplineMode ( )

Returns whether spline mode checkbox is selected.

Definition at line 78 of file QmitkIGTPlayerWidget.cpp.

References m_Controls.

void QmitkIGTPlayerWidget::OnGoToBegin ( )
protectedslot

Stops the playback and resets the player to the beginning.

Definition at line 481 of file QmitkIGTPlayerWidget.cpp.

References GetCurrentPlaybackMode(), m_Controls, m_PlayingTimer, m_RealTimePlayer, m_StartTime, RealTimeMode, and ResetLCDNumbers().

Referenced by CreateConnections().

void QmitkIGTPlayerWidget::OnGoToEnd ( )
protectedslot

Stops the playback.

Definition at line 473 of file QmitkIGTPlayerWidget.cpp.

References ResetLCDNumbers(), and StopPlaying().

Referenced by CreateConnections(), and OnOpenFileButtonPressed().

void QmitkIGTPlayerWidget::OnOpenFileButtonPressed ( )
protectedslot

Opens file open dialog for searching the input file.

stops playing and resets lcd numbers

Definition at line 446 of file QmitkIGTPlayerWidget.cpp.

References filename, mitk::IOUtil::LoadBaseData(), m_CmpFilename, m_Controls, m_RealTimePlayer, m_SequentialPlayer, OnGoToEnd(), and SignalInputFileChanged().

Referenced by CreateConnections().

void QmitkIGTPlayerWidget::OnPlaying ( )
protectedslot
void QmitkIGTPlayerWidget::OnSequencialModeToggled ( bool  toggled)
protectedslot

Switches widget between realtime and sequential mode.

Definition at line 539 of file QmitkIGTPlayerWidget.cpp.

References m_Controls, and StopPlaying().

void QmitkIGTPlayerWidget::OnSliderPressed ( )
protectedslot

Pauses playback when slider is pressed by user.

Definition at line 569 of file QmitkIGTPlayerWidget.cpp.

References m_Controls.

Referenced by CreateConnections().

void QmitkIGTPlayerWidget::OnSliderReleased ( )
protectedslot

Moves player position to the position selected with the slider.

Definition at line 554 of file QmitkIGTPlayerWidget.cpp.

References m_Controls, m_CurrentSequentialPointNumber, and m_SequentialPlayer.

Referenced by CreateConnections().

void QmitkIGTPlayerWidget::OnStopPlaying ( )
protectedslot

Stops the playback.

Definition at line 255 of file QmitkIGTPlayerWidget.cpp.

References StopPlaying().

void QmitkIGTPlayerWidget::ResetLCDNumbers ( )
protected

Sets all LCD numbers to 0.

Definition at line 499 of file QmitkIGTPlayerWidget.cpp.

References m_Controls.

Referenced by OnGoToBegin(), OnGoToEnd(), QmitkIGTPlayerWidget(), and StopPlaying().

void QmitkIGTPlayerWidget::SetTrajectoryNames ( const QStringList  toolNames)

Sets the given tool names list to the trajectory select combobox.

Definition at line 506 of file QmitkIGTPlayerWidget.cpp.

References ClearTrajectorySelectCombobox(), m_Controls, and SignalCurrentTrajectoryChanged().

void QmitkIGTPlayerWidget::SetUpdateRate ( unsigned int  msecs)

Sets the update rate of this widget's playing timer.

Definition at line 117 of file QmitkIGTPlayerWidget.cpp.

References m_PlayingTimer.

void QmitkIGTPlayerWidget::SignalCurrentTrajectoryChanged ( int  index)
signal

This signal is emitted if the index of the current selected trajectory select combobox item changes.

Referenced by ClearTrajectorySelectCombobox(), CreateConnections(), and SetTrajectoryNames().

void QmitkIGTPlayerWidget::SignalInputFileChanged ( )
signal

This signal is emitted if the input file for the replay was changed.

Referenced by OnOpenFileButtonPressed().

void QmitkIGTPlayerWidget::SignalPlayerUpdated ( )
signal

This signal is emitted every time the player updated the NavigationDatas.

Referenced by OnPlaying().

void QmitkIGTPlayerWidget::SignalPlayingEnded ( )
signal

This signal is emitted when the player reaches the end of the playback.

void QmitkIGTPlayerWidget::SignalPlayingPaused ( )
signal

This signal is emitted when the player is paused.

Referenced by OnPlayButtonClicked().

void QmitkIGTPlayerWidget::SignalPlayingResumed ( )
signal

This signal is emitted when the player resumes after a pause.

Referenced by OnPlayButtonClicked().

void QmitkIGTPlayerWidget::SignalPlayingStarted ( )
signal

This signal is emitted when the player starts the playback.

Referenced by OnPlayButtonClicked().

void QmitkIGTPlayerWidget::SignalPlayingStopped ( )
signal

This signal is emitted when the player stops.

Referenced by StopPlaying().

void QmitkIGTPlayerWidget::SignalSplineModeToggled ( bool  toggled)
signal

This signal is emitted if the spline mode checkbox is toggled or untoggled.

Referenced by CreateConnections().

void QmitkIGTPlayerWidget::StopPlaying ( )

Member Data Documentation

QString QmitkIGTPlayerWidget::m_CmpFilename
protected

filename of the input file

Definition at line 246 of file QmitkIGTPlayerWidget.h.

Referenced by CheckInputFileValid(), OnOpenFileButtonPressed(), and OnPlayButtonClicked().

unsigned int QmitkIGTPlayerWidget::m_CurrentSequentialPointNumber
protected

current point number

Definition at line 250 of file QmitkIGTPlayerWidget.h.

Referenced by OnPlaying(), OnSliderReleased(), and StopPlaying().

QTimer* QmitkIGTPlayerWidget::m_PlayingTimer
protected
mitk::NavigationDataPlayer::Pointer QmitkIGTPlayerWidget::m_RealTimePlayer
protected
mitk::NavigationDataSequentialPlayer::Pointer QmitkIGTPlayerWidget::m_SequentialPlayer
protected
mitk::NavigationData::TimeStampType QmitkIGTPlayerWidget::m_StartTime
protected

start time of playback needed for time display

Definition at line 249 of file QmitkIGTPlayerWidget.h.

Referenced by OnGoToBegin(), OnPlaying(), and StopPlaying().

const std::string QmitkIGTPlayerWidget::VIEW_ID
static

Definition at line 52 of file QmitkIGTPlayerWidget.h.


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