Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes

QmitkIGTExampleView Class Reference
[Functionalities]

QmitkIGTExampleView. More...

#include <QmitkIGTExampleView.h>

Inheritance diagram for QmitkIGTExampleView:
Inheritance graph
[legend]
Collaboration diagram for QmitkIGTExampleView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QmitkIGTExampleView (QObject *parent=0, const char *name=0)
 default constructor
virtual ~QmitkIGTExampleView ()
 default destructor
virtual void CreateQtPartControl (QWidget *parent)
 method for creating the widget containing the application controls, like sliders, buttons etc.
virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget)
virtual void StdMultiWidgetNotAvailable ()
virtual void CreateConnections ()
 method for creating the connections of main and control widget
virtual void AddToFunctionalityOptionsList (mitk::PropertyList *p)
virtual void Activated ()
 method for creating an QAction object, i.e. button & menu entry
virtual void Deactivated ()
 method is called when the bundle is closed

Protected Slots

void OnTestTracking ()
 executes MITK-IGT-Tracking code
void OnTestNavigation ()
 executes MITK-IGT-Navigation code
void OnMeasure ()
 performs one measurement using the navigation pipeline
void OnMeasureContinuously ()
 performs continuous measurements using the navigation pipeline
void OnStop ()
 stops the navigation pipeline and perform clean up
void OnParametersChanged ()
 reads the filter parameters from the GUI after they were changed
void OnRecordingToggle (bool toggled)
 Starts recording of tracking data.
void OnPlayingToggle (bool toggled)
 Stops the recording of tracking data and starts the replay.
void OnRecording ()
 Timer update method for recording of tracking data.
void OnPlaying ()
 Timer update method for replaying of tracking data.
void OnShowErrorPlot ()
 Display a graph and progress bar that shows error values from the first navigation data.
void OnErrorValueChanged (mitk::NavigationData::CovarianceMatrixType v, unsigned int index)
 Callback method of the NavigationDataToMessageFilter.
void OnLoadTool ()
 Shows a file dialog for choosing tool description files.
void OnTrackingDeviceTextChanged (const QString &)
 Chooses the current tracking device.

Protected Member Functions

mitk::TrackingDevice::Pointer ConfigureTrackingDevice ()
 create the selected tracker object and configure it (using values from m_Controls)

Protected Attributes

QmitkStdMultiWidgetm_MultiWidget
 default render widget
Ui::QmitkIGTExampleControlsm_Controls
 GUI widget for this functionality.
mitk::TrackingDeviceSource::Pointer m_Source
 first filter in the pipeline
mitk::NavigationDataDisplacementFilter::Pointer m_Displacer
 displacement filter that adds an offset to NDs
mitk::NavigationDataToNavigationDataFilter::Pointer m_EndOfPipeline
mitk::NavigationDataRecorder::Pointer m_Recorder
 records NDs to a XML file
mitk::NavigationDataPlayer::Pointer m_Player
 plays a XML file
mitk::NavigationDataToPointSetFilter::Pointer m_PointSetFilter
 has a NDs as input and a PointSet as output
mitk::NavigationDataToMessageFilter::Pointer m_MessageFilter
 calls OnErrorValueChanged when the error value of its input changes
mitk::PointSet::Pointer m_PointSet
 stores the output of the pointsetfilter
QmitkPlotWidget::DataVector m_XValues
 X-Values of the error plot (timestamp of navigation data)
QmitkPlotWidget::DataVector m_YValues
 Y-Values of the error plot (error value of navigation data.
QTextEdit * out
 pointer to output widget
QTimer * m_Timer
 timer for continuous tracking update
QTimer * m_RecordingTimer
 timer for continuous recording
QTimer * m_PlayingTimer
 timer for continuous playing
QStringList m_ToolList
 list to the tool description files

Detailed Description

QmitkIGTExampleView.

Example functionality that shows the usage of the MITK-IGT component

See also:
QmitkFunctionality

Definition at line 47 of file QmitkIGTExampleView.h.


Constructor & Destructor Documentation

QmitkIGTExampleView::QmitkIGTExampleView ( QObject *  parent = 0,
const char *  name = 0 
)

default constructor

Definition at line 66 of file QmitkIGTExampleView.cpp.

References m_Controls, m_PlayingTimer, m_RecordingTimer, m_Timer, m_XValues, and m_YValues.

 : QmitkFunctionality()
{
  m_Timer = new QTimer(this);
  m_RecordingTimer = new QTimer(this);
  m_PlayingTimer = new QTimer(this);
  m_XValues.clear();
  m_YValues.clear();
  m_Controls = NULL;
}
QmitkIGTExampleView::~QmitkIGTExampleView (  ) [virtual]

default destructor

Definition at line 78 of file QmitkIGTExampleView.cpp.

References m_Player, m_PlayingTimer, m_Recorder, m_RecordingTimer, m_Timer, and OnStop().

{
  this->OnStop();  // cleanup IGT pipeline, if tracking is in progress
  m_Timer->stop();
  m_RecordingTimer->stop();
  m_PlayingTimer->stop();
  m_Recorder = NULL;
  m_Player = NULL;
  m_RecordingTimer = NULL;
  m_PlayingTimer = NULL;
}

Member Function Documentation

void QmitkIGTExampleView::Activated (  ) [virtual]

method for creating an QAction object, i.e. button & menu entry

Parameters:
parentthe parent QWidget

method is called when the bundle is started

Reimplemented from QmitkFunctionality.

Definition at line 150 of file QmitkIGTExampleView.cpp.

void QmitkIGTExampleView::AddToFunctionalityOptionsList ( mitk::PropertyList p ) [virtual]

Definition at line 494 of file QmitkIGTExampleView.cpp.

{
  //Due to porting to Qt4 this feature is not ported yet

  //QmitkFunctionality::AddToFunctionalityOptionsList(pl);  // let the super class add the properties


  //if (m_Controls != NULL)
  //{
  //  m_Controls->SetDisplacementFilterParameters(pl);  // update GUI
  //}
}
mitk::TrackingDevice::Pointer QmitkIGTExampleView::ConfigureTrackingDevice (  ) [protected]

create the selected tracker object and configure it (using values from m_Controls)

Definition at line 518 of file QmitkIGTExampleView.cpp.

References mitk::SerialCommunication::BaudRate115200, m_Controls, Ui_QmitkIGTExampleControls::m_Port, m_ToolList, Ui_QmitkIGTExampleControls::m_TrackingDevice, mitk::NDIAurora, mitk::NDIPolaris, mitk::VirtualTrackingDevice::New(), mitk::InternalTrackingTool::New(), mitk::MicroBirdTrackingDevice::New(), mitk::ClaronTrackingDevice::New(), mitk::NDITrackingDevice::New(), and out.

Referenced by OnRecordingToggle(), OnTestNavigation(), and OnTestTracking().

{
  mitk::TrackingDevice::Pointer tracker;
  QString selectedDevice = m_Controls->m_TrackingDevice->currentText().toLatin1();
  if ((selectedDevice == "NDI Polaris")
    || (selectedDevice == "NDI Aurora"))
  {
    mitk::NDITrackingDevice::Pointer trackerNDI = mitk::NDITrackingDevice::New();
    trackerNDI->SetDeviceName(m_Controls->m_Port->text().toStdString());
    trackerNDI->SetBaudRate(mitk::SerialCommunication::BaudRate115200);
    out->append(QString("creating NDI Tracker on ") + m_Controls->m_Port->text() + QString(" with 115200 Baud"));
    tracker = trackerNDI;

    if (selectedDevice == "NDI Polaris")
    {
      trackerNDI->SetType(mitk::NDIPolaris);
      QStringList::iterator it;
      unsigned int index = 0;
      for (it = m_ToolList.begin(); it != m_ToolList.end(); ++it )
      {
        trackerNDI->AddTool(QString("MyInstrument %1").arg(index++).toLatin1(), (*it).toLatin1());
        out->append(QString("adding tool 'MyInstrument' with rom file '") + (*it) + QString("'"));
      }
    }
    else if (selectedDevice == "NDI Aurora")
    {
      trackerNDI->SetType(mitk::NDIAurora);
    }
  }
  else if (selectedDevice == "Micron Tracker")
  {
    mitk::ClaronTrackingDevice::Pointer trackerMT = mitk::ClaronTrackingDevice::New();
    out->append("creating Micron Tracker");
    QStringList::iterator it;
    unsigned int index = 0;
    for (it = m_ToolList.begin(); it != m_ToolList.end(); ++it )
    {
      trackerMT->AddTool(QString("MyInstrument %1").arg(index++).toLatin1(), (*it).toLatin1()); // create tool with name and tool definition file
      out->append(QString("adding tool 'MyInstrument' with tool definition file '") + (*it) + QString("'"));
    }
    tracker = trackerMT;
  }
  else if (selectedDevice == "MicroBird")
  {
#ifdef MITK_USE_MICROBIRD_TRACKER
    mitk::MicroBirdTrackingDevice::Pointer trackerMB = mitk::MicroBirdTrackingDevice::New();
    mitk::InternalTrackingTool::Pointer toolMB = mitk::InternalTrackingTool::New();
    trackerMB->AddTool(toolMB);
    out->append("creating MicroBird tracking device with one tool");
#else
    out->append("MicroBird support not available in this version. Please select a different tracking device");
#endif // MITK_USE_MICROBIRD_TRACKER
  }
  else if (selectedDevice == "VirtualTrackingDevice")
  {
    mitk::VirtualTrackingDevice::Pointer trackerVirtual = mitk::VirtualTrackingDevice::New();
    trackerVirtual->AddTool("toolRandom1");
    trackerVirtual->AddTool("toolRandom2");
    tracker = trackerVirtual;
    out->append("creating virtual tracking device with two tools");
  }
  else
  {
    tracker = NULL;
  }
  return tracker;
}
void QmitkIGTExampleView::CreateConnections (  ) [virtual]

method for creating the connections of main and control widget

Definition at line 126 of file QmitkIGTExampleView.cpp.

References Ui_QmitkIGTExampleControls::m_ChangeOffset, m_Controls, Ui_QmitkIGTExampleControls::m_LoadToolBtn, Ui_QmitkIGTExampleControls::m_MeasureBtn, Ui_QmitkIGTExampleControls::m_MeasureContinuously, Ui_QmitkIGTExampleControls::m_PlayingButtonToggle, m_PlayingTimer, Ui_QmitkIGTExampleControls::m_RecordingButtonToggle, m_RecordingTimer, Ui_QmitkIGTExampleControls::m_ShowErrorPlotBtn, Ui_QmitkIGTExampleControls::m_StartNavigationButton, Ui_QmitkIGTExampleControls::m_StartTrackingButton, Ui_QmitkIGTExampleControls::m_StopBtn, m_Timer, Ui_QmitkIGTExampleControls::m_TrackingDevice, OnLoadTool(), OnMeasure(), OnMeasureContinuously(), OnParametersChanged(), OnPlaying(), OnPlayingToggle(), OnRecording(), OnRecordingToggle(), OnShowErrorPlot(), OnStop(), OnTestNavigation(), OnTestTracking(), and OnTrackingDeviceTextChanged().

Referenced by CreateQtPartControl().

{
  if ( m_Controls )
  {
    connect((QObject*)(m_Controls->m_ChangeOffset), SIGNAL(clicked()), (QObject*) this, SLOT(OnParametersChanged())); // update filter parameters with values from the GUI widget
    connect((QObject*)(m_Controls->m_TrackingDevice), SIGNAL(textChanged(QString)), (QObject*) this, SLOT(OnTrackingDeviceTextChanged(QString)));
    connect((QObject*)(m_Controls->m_TrackingDevice), SIGNAL(activated(QString)),(QObject*) this, SLOT(OnTrackingDeviceTextChanged(QString)));

    connect( (QObject*)(m_Controls->m_StartTrackingButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnTestTracking()));  // execute tracking test code
    connect( (QObject*)(m_Controls->m_LoadToolBtn), SIGNAL(clicked()),(QObject*) this, SLOT(OnLoadTool()));  // load tools for specific tracking devices
    connect( (QObject*)(m_Controls->m_StartNavigationButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnTestNavigation())); // build and initialize navigation filter pipeline
    connect( (QObject*)(m_Controls->m_MeasureBtn), SIGNAL(clicked()),(QObject*) this, SLOT(OnMeasure())); // execute navigation filter pipeline to read transformed tracking data
    connect( (QObject*)(m_Controls->m_MeasureContinuously), SIGNAL(clicked()),(QObject*) this, SLOT(OnMeasureContinuously())); // execute navigation filter pipeline to read transformed tracking data
    connect( (QObject*)(m_Controls->m_StopBtn), SIGNAL(clicked()),(QObject*) this, SLOT(OnStop())); // cleanup navigation filter pipeline
    //connect( (QObject*)(m_Controls), SIGNAL(ParametersChanged()),(QObject*) this, SLOT(OnParametersChanged()));  // update filter parameters with values from the GUI widget
    connect( m_Timer, SIGNAL(timeout()), this, SLOT(OnMeasure()) );
    connect( m_RecordingTimer, SIGNAL(timeout()), this, SLOT(OnRecording()) );
    connect( m_PlayingTimer, SIGNAL(timeout()), this, SLOT(OnPlaying()) );
    connect( (QObject*)(m_Controls->m_RecordingButtonToggle), SIGNAL(toggled(bool)),(QObject*) this, SLOT(OnRecordingToggle(bool)));  // execute tracking test code
    connect( (QObject*)(m_Controls->m_PlayingButtonToggle), SIGNAL(toggled(bool)),(QObject*) this, SLOT(OnPlayingToggle(bool)));  // execute tracking test code
    connect( (QObject*)(m_Controls->m_ShowErrorPlotBtn), SIGNAL(clicked()),(QObject*) this, SLOT(OnShowErrorPlot()));  // execute tracking test code
  }
}
void QmitkIGTExampleView::CreateQtPartControl ( QWidget *  parent ) [virtual]

method for creating the widget containing the application controls, like sliders, buttons etc.

Implements berry::QtViewPart.

Definition at line 90 of file QmitkIGTExampleView.cpp.

References CreateConnections(), m_Controls, Ui_QmitkIGTExampleControls::m_PlayingButtonToggle, Ui_QmitkIGTExampleControls::m_TextOutput, Ui_QmitkIGTExampleControls::m_X, Ui_QmitkIGTExampleControls::m_Y, Ui_QmitkIGTExampleControls::m_Z, out, and Ui_QmitkIGTExampleControls::setupUi().

{
  if (!m_Controls)
  {
    m_Controls = new Ui::QmitkIGTExampleControls;
    m_Controls->setupUi(parent);

    //m_Controls->m_TextOutput->setTextFormat(Qt::PlainText);
    out = m_Controls->m_TextOutput;
    
    CreateConnections();
    //mitk::Vector3D offset;

    //if (GetFunctionalityOptionsList()->GetPropertyValue<mitk::Vector3D>("NavigationDataDisplacementFilter_Offset", offset) == true)
    //{
      //m_Controls->SetDisplacementFilterParameters(GetFunctionalityOptionsList());
      //out->append("found offset value in persistence storage");
    //}

    m_Controls->m_X->setText("10");
    m_Controls->m_Y->setText("3");
    m_Controls->m_Z->setText("5");  

    m_Controls->m_PlayingButtonToggle->setEnabled(false);
  }
}
void QmitkIGTExampleView::Deactivated (  ) [virtual]

method is called when the bundle is closed

Reimplemented from QmitkFunctionality.

Definition at line 154 of file QmitkIGTExampleView.cpp.

void QmitkIGTExampleView::OnErrorValueChanged ( mitk::NavigationData::CovarianceMatrixType  v,
unsigned int  index 
) [protected, slot]

Callback method of the NavigationDataToMessageFilter.

Documentation This method will be called by NavigationDataToMessageFilter when the error value of its input navigation data object changes. The method calculates an overall error value and adds it both to an error plot widget and to a progress bar. If the error is above a hardcoded threshold, a warning is also displayed in the text output widget

Definition at line 783 of file QmitkIGTExampleView.cpp.

References m_Controls, Ui_QmitkIGTExampleControls::m_ErrorBar, Ui_QmitkIGTExampleControls::m_ErrorPlot, m_MessageFilter, m_XValues, m_YValues, QmitkPlotWidget::Replot(), and QmitkPlotWidget::SetCurveData().

Referenced by OnShowErrorPlot().

{
  /* calculate overall error (this should be replaced with a more meaningful implementation depending on the application requirements) */
  mitk::ScalarType errorValue = 0.0;
  for (unsigned int i = 0; i < v.ColumnDimensions; ++i)
    for (unsigned int j = 0; j < v.RowDimensions; ++j)
      errorValue += v(i, j);

  if ((m_MessageFilter.IsNotNull()) && (m_MessageFilter->GetOutput() != NULL))
  {
    mitk::ScalarType timeValue =  m_MessageFilter->GetOutput()->GetTimeStamp();
    m_XValues.push_back(timeValue);
    m_YValues.push_back(errorValue);

    m_Controls->m_ErrorPlot->SetCurveData( 0, m_XValues, m_YValues ); // hardcoded for curve id 0!
    m_Controls->m_ErrorPlot->Replot();
  }
  
  mitk::ScalarType progressClampError = (errorValue < 1.0) ? errorValue* 100 : 100;// use primitive mapping of error values to the progress bar range of 0..100. needs to be adjusted to meaningful values
  m_Controls->m_ErrorBar->setValue(progressClampError); 

}
void QmitkIGTExampleView::OnLoadTool (  ) [protected, slot]

Shows a file dialog for choosing tool description files.

Documentation This method is called when the m_ToolBtn is pressed and a tracking device was selected which needs tool description data.

Definition at line 508 of file QmitkIGTExampleView.cpp.

References m_Controls, QmitkFunctionality::m_Parent, Ui_QmitkIGTExampleControls::m_ToolFileName, and m_ToolList.

Referenced by CreateConnections().

{
  QStringList s = QFileDialog::getOpenFileNames(m_Parent, "Select one or more tool definition files",QDir::currentPath(), "NDI Tool Definition Files (*.rom);;All files (*.*)");
  if (s.empty() == false)
  { 
    m_Controls->m_ToolFileName->setText(s.front());
  }
  m_ToolList = s;
}
void QmitkIGTExampleView::OnMeasure (  ) [protected, slot]

performs one measurement using the navigation pipeline

Documentation This method uses the MITK-IGT pipeline that was set up by OnTestNavigation() before. it iterates over all outputs of the last filter in the pipeline, updates each and writes its transformed tracking data to the GUI.

Definition at line 380 of file QmitkIGTExampleView.cpp.

References mitk::NavigationData::GetCovErrorMatrix(), mitk::BaseRenderer::GetInstance(), mitk::NavigationData::GetOrientation(), mitk::NavigationData::GetPosition(), mitk::NavigationData::IsDataValid(), m_EndOfPipeline, m_MessageFilter, m_MultiWidget, m_PointSetFilter, QmitkStdMultiWidget::mitkWidget4, and out.

Referenced by CreateConnections().

{
  if (m_EndOfPipeline.IsNull())
  {
    out->append("Tracking Pipeline not ready.");
    return;
  }
  /* Get the output of the last filter with output and print it */
  for (unsigned int i = 0; i < m_EndOfPipeline->GetNumberOfOutputs(); ++i) // for all outputs of the filter
  {
    mitk::NavigationData* nd = m_EndOfPipeline->GetOutput(i);
    if (nd == NULL)
    {
      out->append("WARNING: Navigation Data is NULL");
      continue;
    }
    nd->Update();  // update the navigation data. this will read current tracking data from tracking device.
    // this will also update the visualization filter who causes a repainting of the scene

    std::stringstream output;
    output << "Navigation Data of Output " << i << ":" << std::endl;
    if (nd->IsDataValid() == true)
    {
      output << "  Position    = " << nd->GetPosition() << std::endl;
      output << "  Orientation = <" << nd->GetOrientation() << std::endl;
      output << "  Error       = " << nd->GetCovErrorMatrix() << std::endl;
    }
    else
      output << "  Data is invalid."<< std::endl;
    output << "--------------------------------------------" << std::endl;
    out->append(output.str().c_str()); // append string stream content to gui widget
  }
  if (m_PointSetFilter.IsNotNull()) // update tracjectory generation if it is in use
    m_PointSetFilter->Update();

  if (m_MessageFilter.IsNotNull()) // update error visualization if it is in use
    m_MessageFilter->Update();

  mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow())->RequestUpdate();  // update 3D render window
}
void QmitkIGTExampleView::OnMeasureContinuously (  ) [protected, slot]

performs continuous measurements using the navigation pipeline

Documentation This method calls the above OnMeasure()

Definition at line 422 of file QmitkIGTExampleView.cpp.

References m_Controls, Ui_QmitkIGTExampleControls::m_MeasureContinuously, and m_Timer.

Referenced by CreateConnections().

{
  if (m_Controls->m_MeasureContinuously->text()=="Start measure continuously")
  {
    m_Timer->start(100);
    m_Controls->m_MeasureContinuously->setText("Stop measure continuously");
  }
  else if (m_Controls->m_MeasureContinuously->text()=="Stop measure continuously")
  {
    m_Timer->stop();
    m_Controls->m_MeasureContinuously->setText("Start measure continuously");
  }
}
void QmitkIGTExampleView::OnParametersChanged (  ) [protected, slot]

reads the filter parameters from the GUI after they were changed

Documentation The Control widget will store all parameters of the displacement filter in a mitk::PropertyList. OnParametersChanged() gets called after the user changed the parameters. It will add that list to the functionality's own m_Options PropertyList, overwriting any properties that might exist with the same name (all MITK-IGT filters should use unique property names). OnTestNavigation() will use the functionality's m_Options list to initialize the DisplacementFilter.

Definition at line 474 of file QmitkIGTExampleView.cpp.

References m_Controls, m_Displacer, Ui_QmitkIGTExampleControls::m_X, Ui_QmitkIGTExampleControls::m_Y, Ui_QmitkIGTExampleControls::m_Z, mitk::Vector3DProperty::New(), and mitk::PropertyList::New().

Referenced by CreateConnections().

{
  mitk::Vector3D v;
  v[0] = m_Controls->m_X->text().toFloat();
  v[1] = m_Controls->m_Y->text().toFloat();
  v[2] = m_Controls->m_Z->text().toFloat();

  mitk::PropertyList::Pointer parameters = mitk::PropertyList::New();
  parameters->SetProperty("NavigationDataDisplacementFilter_Offset", mitk::Vector3DProperty::New(v));
  
  if(m_Displacer.IsNotNull())
  {
    m_Displacer->SetParameters(parameters.GetPointer());
  }
  else{
    QMessageBox::warning(NULL, "No navigation test started", "Please start a navigationtest first", QMessageBox::Ok, NULL);
  }
}
void QmitkIGTExampleView::OnPlaying (  ) [protected, slot]

Timer update method for replaying of tracking data.

Documentation updates the replay filter, rerenders the 3D render window and displays a message in the status bar

Definition at line 742 of file QmitkIGTExampleView.cpp.

References mitk::StatusBar::GetInstance(), mitk::BaseRenderer::GetInstance(), m_MultiWidget, m_PointSetFilter, and QmitkStdMultiWidget::mitkWidget4.

Referenced by CreateConnections().

{
  m_PointSetFilter->Update();
  mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow())->RequestUpdate();  // update only 3D render window
  mitk::StatusBar::GetInstance()->DisplayText("Replaying tracking data now", 75); // Display replay message for 75ms in status bar
}
void QmitkIGTExampleView::OnPlayingToggle ( bool  toggled ) [protected, slot]

Stops the recording of tracking data and starts the replay.

Documentation This method sets up a new pipeline that connects a NavigationDataPlayer with a NavigationDataToPointSetFilter as an example for an alternative visualization method and then starts a Replay timer that updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the Replay timer will be stopped.

Definition at line 671 of file QmitkIGTExampleView.cpp.

References QmitkFunctionality::GetDefaultDataStorage(), m_Controls, m_Player, Ui_QmitkIGTExampleControls::m_PlayingButtonToggle, m_PlayingTimer, m_PointSetFilter, m_Recorder, Ui_QmitkIGTExampleControls::m_RecordingButtonToggle, m_RecordingTimer, mitk::NavigationDataToPointSetFilter::Mode3D, mitk::FloatProperty::New(), mitk::ColorProperty::New(), mitk::DataNode::New(), mitk::NavigationDataToPointSetFilter::New(), mitk::NavigationDataPlayer::New(), and out.

Referenced by CreateConnections().

{
  if(m_Recorder->GetRecording())
  {
  /* Stop recording */
  m_RecordingTimer->stop();
  m_Recorder->StopRecording();
  out->append("Stopped recording");
  }


  if(!toggled)
  {
    out->append(QString("stopping replay"));
    m_Player->StopPlaying();
    m_PlayingTimer->stop();
    m_Controls->m_RecordingButtonToggle->setEnabled(true);
    m_Controls->m_PlayingButtonToggle->setText(QString("Start Replaying Test"));
  }
  
  else
  {

    m_Controls->m_RecordingButtonToggle->setEnabled(false);

  std::stringstream filename;
  //the .xml extension and an counter is added automatically
  filename << itksys::SystemTools::GetCurrentWorkingDirectory() << "/Test Output-0.xml";

  m_Player = mitk::NavigationDataPlayer::New();
  //this is first part of the file name the .xml extension and an counter is added automatically
  m_Player->SetFileName(filename.str()); 
  m_Player->StartPlaying(); //this starts the player 
  //this is necessary because we do not know how many outputs the player has

  out->append(QString("Starting replay from ") + QString(m_Player->GetFileName()));

  /* Visualize output of player using a mitk::PointSet */
  m_PointSetFilter = mitk::NavigationDataToPointSetFilter::New();
  m_PointSetFilter->SetOperationMode(mitk::NavigationDataToPointSetFilter::Mode3D);
  for (unsigned int i = 0; i < m_Player->GetNumberOfOutputs(); i++)
    m_PointSetFilter->SetInput(i, m_Player->GetOutput(i));  // connect the player with the pointset filter

  for (unsigned int i = 0; i < m_PointSetFilter->GetNumberOfOutputs(); i++)
  {
    mitk::PointSet::Pointer p = m_PointSetFilter->GetOutput(i);
    assert(p);

    mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
    pointSetNode->SetData(p);
    pointSetNode->SetName(QString("Trajectory of Output %1").arg(i).toLatin1());
    mitk::Color color;
    color.Set(0.25 * i, 1 - 0.25 * i, 0.5);
    pointSetNode->SetColor(color); //change color of points
    pointSetNode->SetProperty("contourcolor", mitk::ColorProperty::New(color)); // change color of trajectory line
    pointSetNode->SetProperty("pointsize", mitk::FloatProperty::New(10.0)); // enlarge visualization of points
    pointSetNode->SetProperty("contoursize", mitk::FloatProperty::New(5.0)); // enlarge visualization of trajectory line
    pointSetNode->SetBoolProperty("show contour", true);
    
    this->GetDefaultDataStorage()->Add(pointSetNode); //add it to the DataStorage
    out->append(QString("Creating Pointset %1 for replay visualization").arg(i));
  }

  m_PlayingTimer->start(100);  // start the playback timer
  out->append("starting replay");
  m_Controls->m_PlayingButtonToggle->setText(QString("Stop Replaying Test"));

  }
}
void QmitkIGTExampleView::OnRecording (  ) [protected, slot]

Timer update method for recording of tracking data.

Documentation updates the recording filter and displays a message in the status bar

Definition at line 664 of file QmitkIGTExampleView.cpp.

References mitk::StatusBar::GetInstance(), and m_Recorder.

Referenced by CreateConnections().

{
  m_Recorder->Update();
  mitk::StatusBar::GetInstance()->DisplayText("Recording tracking data now", 75); // Display recording message for 75ms in status bar
}
void QmitkIGTExampleView::OnRecordingToggle ( bool  toggled ) [protected, slot]

Starts recording of tracking data.

Documentation This method sets up a IGT pipeline that connects a tracking device with a NavigationDataRecorder filter and then starts a timer that updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the recorder will be stopped.

Definition at line 587 of file QmitkIGTExampleView.cpp.

References ConfigureTrackingDevice(), m_Controls, Ui_QmitkIGTExampleControls::m_PlayingButtonToggle, m_Recorder, Ui_QmitkIGTExampleControls::m_RecordingButtonToggle, m_RecordingTimer, m_Source, Ui_QmitkIGTExampleControls::m_TrackingDevice, mitk::NavigationDataRecorder::New(), mitk::TrackingDeviceSource::New(), and out.

Referenced by CreateConnections().

{
  try
  {

    mitk::TrackingDevice::Pointer tracker = this->ConfigureTrackingDevice();
    
    if (tracker.IsNull())
    {
      out->append("Error creating tracking device. Did you provide all parameters?");
      return;
    }
    
    else if(!toggled)
    {

    /* Stop recording */
    m_RecordingTimer->stop();
    m_Recorder->StopRecording();
    out->append(QString("Stopped recording"));
    m_Controls->m_RecordingButtonToggle->setText(QString("Start Recording Test"));
    m_Controls->m_PlayingButtonToggle->setEnabled(true);
    }

    else 
    {

    m_Controls->m_PlayingButtonToggle->setEnabled(false);
    m_Source = mitk::TrackingDeviceSource::New();
    m_Source->SetTrackingDevice(tracker); //here we set the device for the pipeline source

    m_Source->Connect();        //here we connect to the tracking system

    //we need the stringstream for building up our filename
    std::stringstream filename;

    //the .xml extension and an counter is added automatically
    filename << itksys::SystemTools::GetCurrentWorkingDirectory() << "/Test Output";

    m_Recorder = mitk::NavigationDataRecorder::New();
    m_Recorder->SetFileName(filename.str());

    //now every output of the displacer object is connected to the recorder object
    for (unsigned int i = 0; i < m_Source->GetNumberOfOutputs(); i++)
    {
      m_Recorder->AddNavigationData(m_Source->GetOutput(i));  // here we connect to the recorder
    }

    m_Source->StartTracking();  //start the tracking
    m_Recorder->StartRecording(); //after finishing the settings you can start the recording mechanism 

    out->append(QString("Starting Recording from ") + QString(m_Controls->m_TrackingDevice->currentText().toLatin1())
      + QString(" to file ") + QString(m_Recorder->GetFileName()) + QString(" now."));

    //now every update of the recorder stores one line into the file for 
    //each added NavigationData
    m_RecordingTimer->start(100);
    
    
    m_Controls->m_RecordingButtonToggle->setText(QString("Stop Recording Test"));
    //m_Controls->m_StartPlayingButton->setEnabled(true);

  }

  }
  catch (std::exception& e)
  {
    out->append(QString("An error occured: ") + QString(e.what()));
    m_Controls->m_PlayingButtonToggle->setEnabled(false);
  

  }

 
}
void QmitkIGTExampleView::OnShowErrorPlot (  ) [protected, slot]

Display a graph and progress bar that shows error values from the first navigation data.

Documentation This method is an example of how to use NavigationDataToMessageFilter to update GUI elements from a IGT pipeline. It creates a NavigationDataToMessageFilter, sets its input to the first output of the displacement filter and registers the OnErrorValueChanged() method as a callback whenever the error value of the input navigation data changes.

Definition at line 750 of file QmitkIGTExampleView.cpp.

References QmitkPlotWidget::InsertCurve(), m_Controls, m_Displacer, Ui_QmitkIGTExampleControls::m_ErrorBar, Ui_QmitkIGTExampleControls::m_ErrorPlot, m_MessageFilter, m_XValues, m_YValues, mitk::NavigationDataToMessageFilter::New(), OnErrorValueChanged(), out, QmitkPlotWidget::SetAxisTitle(), QmitkPlotWidget::SetCurvePen(), QmitkPlotWidget::SetPlotTitle(), QwtPlot::xBottom, and QwtPlot::yLeft.

Referenced by CreateConnections().

{
  if (m_Displacer.IsNull()) // only possible after tracking pipeline is initalized
  {
    out->append("You have to click on 'Start MITK-IGT-Navigation Test' first");
    return; 
  }
  /* Set up error display */
  m_Controls->m_ErrorPlot->SetPlotTitle("Error Values of tool 1");
  m_Controls->m_ErrorPlot->SetAxisTitle( QwtPlot::xBottom, "Timestamp" ); 
  m_Controls->m_ErrorPlot->SetAxisTitle( QwtPlot::yLeft, "Error" ); 
  int curveId = m_Controls->m_ErrorPlot->InsertCurve( "Error value of tool 1" ); 
  m_Controls->m_ErrorPlot->SetCurvePen( curveId, QPen( Qt::red ) ); 
  m_XValues.clear();
  m_YValues.clear();
  m_Controls->m_ErrorPlot->setEnabled(true);
  m_Controls->m_ErrorPlot->show();

  m_Controls->m_ErrorBar->setMinimum(0); // needs to be set to meaningful values depending on tracking device and application requirements
  m_Controls->m_ErrorBar->setMaximum(100);
  m_Controls->m_ErrorBar->setTextVisible (false);
  //m_Controls->m_ErrorBar->setStyle(new QWindowsStyle()); // to be able to use custom colors
  m_Controls->m_ErrorBar->reset();
  
  /*set up IGT pipeline -> GUI connection */
  m_MessageFilter = mitk::NavigationDataToMessageFilter::New();
  m_MessageFilter->SetInput(m_Displacer->GetOutput()); // connect with first output of Displacer 

  //this is just for the first tool 
  m_MessageFilter->AddErrorChangedListener(mitk::MessageDelegate2<QmitkIGTExampleView, mitk::NavigationData::CovarianceMatrixType, unsigned int>(this, &QmitkIGTExampleView::OnErrorValueChanged));  
}
void QmitkIGTExampleView::OnStop (  ) [protected, slot]

stops the navigation pipeline and perform clean up

Definition at line 437 of file QmitkIGTExampleView.cpp.

References QuadProgPP::exp(), m_Controls, m_Displacer, m_EndOfPipeline, Ui_QmitkIGTExampleControls::m_MeasureBtn, Ui_QmitkIGTExampleControls::m_MeasureContinuously, m_MessageFilter, m_PointSetFilter, m_Source, Ui_QmitkIGTExampleControls::m_StartNavigationButton, Ui_QmitkIGTExampleControls::m_StartTrackingButton, Ui_QmitkIGTExampleControls::m_StopBtn, out, QmitkFunctionality::WaitCursorOff(), and QmitkFunctionality::WaitCursorOn().

Referenced by CreateConnections(), and ~QmitkIGTExampleView().

{
  WaitCursorOn();
  m_Controls->m_MeasureBtn->hide();
  m_Controls->m_MeasureBtn->setEnabled(false);
  m_Controls->m_MeasureContinuously->hide();
  m_Controls->m_MeasureContinuously->setEnabled(false);
  m_Controls->m_StopBtn->hide();
  m_Controls->m_StopBtn->setEnabled(false);
  m_Controls->m_StartTrackingButton->setEnabled(true);
  m_Controls->m_StartNavigationButton->setEnabled(true);
  try
  {
    if (m_Source.IsNotNull())
    {
      m_Source->StopTracking();
      m_Source->Disconnect();
      m_Source = NULL;
    }
    m_EndOfPipeline = NULL;
    m_PointSetFilter = NULL;
    m_Displacer = NULL;
    m_MessageFilter = NULL;
    WaitCursorOff();
  }
  catch (std::exception& exp)
  {
    out->append(QString("ERROR during cleanup of filter pipeline: ") + QString(exp.what()));
    m_Source = NULL;
    WaitCursorOff();
    return;
  }
  out->append("Filter pipeline stopped and destroyed. Everything is back to normal.");
  WaitCursorOff();
}
void QmitkIGTExampleView::OnTestNavigation (  ) [protected, slot]

executes MITK-IGT-Navigation code

Documentation This method will create and initialize a mitk::NDITrackingDevice with one tool. Then it builds an example MITK-IGT filter pipeline:

  • TrackingDeviceSource filter initialized with the NDITrackingDevice as source of the pipeline
  • NavigationDataDisplacementFilter The Offset parameter of the displacement filter is searched in the functionality's options list. It can be written to that list either by the method OnParametersChanged() that gets called after the user changes the parameter in the GUI or by the persistence mechanism of MITK (the complete options list will be saved to disk on application exit and restored on the next application restart). if the Offset parameter is not found in the list, a default value is used. After building the filter pipeline, it is initialized and tracking is started, so that following calls to OnMeasure() can trigger pipeline updates and retrieve NavigationData objects.

Definition at line 252 of file QmitkIGTExampleView.cpp.

References ConfigureTrackingDevice(), QuadProgPP::exp(), QmitkFunctionality::GetDefaultDataStorage(), mitk::RenderingManager::GetInstance(), mitk::StatusBar::GetInstance(), m_Controls, m_Displacer, m_EndOfPipeline, Ui_QmitkIGTExampleControls::m_MeasureBtn, Ui_QmitkIGTExampleControls::m_MeasureContinuously, m_PointSetFilter, Ui_QmitkIGTExampleControls::m_ShowTrajectories, m_Source, Ui_QmitkIGTExampleControls::m_StartNavigationButton, Ui_QmitkIGTExampleControls::m_StartTrackingButton, Ui_QmitkIGTExampleControls::m_StopBtn, mitk::NavigationDataToPointSetFilter::Mode3D, mitk::FloatProperty::New(), mitk::ColorProperty::New(), mitk::NavigationDataToPointSetFilter::New(), mitk::DataNode::New(), mitk::Cone::New(), mitk::NavigationDataObjectVisualizationFilter::New(), mitk::NavigationDataDisplacementFilter::New(), mitk::TrackingDeviceSource::New(), out, QmitkFunctionality::WaitCursorOff(), and QmitkFunctionality::WaitCursorOn().

Referenced by CreateConnections().

{
  WaitCursorOn(); // always good to show the user that the application is processing and will not react to user input for a while
  mitk::StatusBar::GetInstance()->DisplayText("Executing test of the navigation component", 4000);  // tell the user what you are doing

  /* Create & set up tracking device with a tool */
  mitk::TrackingDevice::Pointer tracker = this->ConfigureTrackingDevice(); // configure selected tracking device

  /* Now set up pipeline */
  try
  {
    m_Source = mitk::TrackingDeviceSource::New();  // we need the filter objects to stay alive, therefore they must be members
    m_Source->SetTrackingDevice(tracker);
    out->append("created and initialized TrackingDeviceSource filter");

    //connect to tracking device
    out->append("connected filter pipeline");
    m_Source->Connect();

    m_Displacer = mitk::NavigationDataDisplacementFilter::New();
    mitk::Vector3D offset;
    /* check if there is a Offset parameter stored in our propertylist. If none is found, use hardcoded value */
    //if (GetFunctionalityOptionsList()->GetPropertyValue<mitk::Vector3D>("NavigationDataDisplacementFilter_Offset", offset) == false)  // search for Offset parameter
    //{
    mitk::FillVector3D(offset, 1.0, 1.0, 1800.0);  // nothing found, use default value
    // GetFunctionalityOptionsList()->SetProperty("NavigationDataDisplacementFilter_Offset", mitk::Vector3DProperty::New(offset));  // add the property to the list
    //}
    m_Displacer->SetOffset(offset);
    /* --> Instead, we could have just called m_Displacer->SetParameters(GetFunctionalityOptionsList()) to set all stored parameters at once.
    But then we would have to check, if the PropertyList contains the parameters ( they were stored in the list before by the
    persistence mechanism or by the GUI Event ParametersChanged that calls the OnParametersChanged() method)
    */

    out->append(QString("created and initialized NavigationDataDisplacementFilter filter using <%1, %2, %3> as offset").arg(offset[0]).arg(offset[1]).arg(offset[2]));
    unsigned int numberOfOutputs = m_Source->GetNumberOfOutputs();
    for (unsigned int i = 0; i < numberOfOutputs; i++)
      m_Displacer->SetInput(i , m_Source->GetOutput(i));  // connect filter

    //Now we create a visualization filter object to hang up the tools into the datatree and visualize them in the widgets.
    mitk::NavigationDataObjectVisualizationFilter::Pointer visualizer = mitk::NavigationDataObjectVisualizationFilter::New();
    for (unsigned int i = 0; i < m_Displacer->GetNumberOfOutputs(); i++)
      visualizer->SetInput(i, m_Displacer->GetOutput(i));

    //create new BaseData for each tool
    for (unsigned int i = 0; i < m_Displacer->GetNumberOfOutputs();i++)
    {
      mitk::Cone::Pointer mitkToolData = mitk::Cone::New();
      float scale[] = {20.0, 20.0, 20.0};
      mitkToolData->GetGeometry()->SetSpacing(scale);
      //create DataNode
      mitk::DataNode::Pointer toolNode = mitk::DataNode::New();
      toolNode->SetData(mitkToolData);
      toolNode->SetName(QString("MyInstrument %1").arg(i).toLatin1());
      toolNode->SetColor(0.2, 0.3 * i ,0.9 - 0.2 * i); //different colors
      toolNode->Modified();
      //add it to the DataStorage
      this->GetDefaultDataStorage()->Add(toolNode);
      visualizer->SetRepresentationObject(i, mitkToolData);
    }
    m_EndOfPipeline = visualizer;

    /* set up trajectories */
    if (m_Controls->m_ShowTrajectories->isChecked())
    {
      m_PointSetFilter = mitk::NavigationDataToPointSetFilter::New();
      m_PointSetFilter->SetOperationMode(mitk::NavigationDataToPointSetFilter::Mode3D);
      for (unsigned int i = 0; i < visualizer->GetNumberOfOutputs(); ++i)
        m_PointSetFilter->SetInput(i, visualizer->GetOutput(i));
      for (unsigned int i = 0; i < m_PointSetFilter->GetNumberOfOutputs(); i++)
      {
        mitk::PointSet* p = m_PointSetFilter->GetOutput(i);
        assert(p);

        mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
        pointSetNode->SetData(p);
        pointSetNode->SetName(QString("Trajectory of Output %1").arg(i).toLatin1());
        mitk::Color color;
        color.Set(0.2, 0.3 * i ,0.9 - 0.2 * i);
        pointSetNode->SetColor(color); //change color of points
        pointSetNode->SetProperty("contourcolor", mitk::ColorProperty::New(color)); // change color of trajectory line
        pointSetNode->SetProperty("pointsize", mitk::FloatProperty::New(2.0)); // enlarge visualization of points
        pointSetNode->SetProperty("contoursize", mitk::FloatProperty::New(1.0)); // enlarge visualization of trajectory line
        pointSetNode->SetBoolProperty("show contour", true);
        pointSetNode->SetBoolProperty("updateDataOnRender", false); // do not call Update() on the pointset during render (this would cause a execution of the pipeline that is still connected to the pointset)

        GetDefaultDataStorage()->Add(pointSetNode); //add it to the DataStorage
        out->append(QString("Creating Pointset %1 for trajectory visualization").arg(i));
      }
    }

    //start the tracking
    m_Source->StartTracking();
    out->append("started source filter. tracking is running now.");
  }
  catch (std::exception& exp)
  {
    out->append(QString("ERROR during instantiation and initialization of TrackingDeviceSource filter: ") + QString(exp.what()));
    m_Displacer = NULL;
    m_PointSetFilter = NULL;
    m_EndOfPipeline = NULL;
    if (m_Source.IsNotNull())
    {
      m_Source->StopTracking();
      m_Source->Disconnect();
      m_Source = NULL;
    }
    tracker = NULL;
    WaitCursorOff();
    return;
  }
  /* set up GUI, so that measurements can be done*/
  m_Controls->m_MeasureBtn->show();
  m_Controls->m_MeasureBtn->setEnabled(true);
  m_Controls->m_MeasureContinuously->show();
  m_Controls->m_MeasureContinuously->setEnabled(true);
  m_Controls->m_StopBtn->show();
  m_Controls->m_StopBtn->setEnabled(true);
  m_Controls->m_StartTrackingButton->setEnabled(false);
  m_Controls->m_StartNavigationButton->setEnabled(false);

  //Initialize the views if no data was loaded yet
  mitk::RenderingManager::GetInstance()->InitializeViews();

  out->append("Tracking Pipeline ready. Click on Measure! button to get most current navigation data");
  WaitCursorOff();  // restore normal mouse cursor after you finished
}
void QmitkIGTExampleView::OnTestTracking (  ) [protected, slot]

executes MITK-IGT-Tracking code

Documentation This method will create and initialize a mitk::NDITrackingDevice with one tool. It will start the tracking, read the tracking data from the tool 50 times and then clean up everything.

Definition at line 158 of file QmitkIGTExampleView.cpp.

References ConfigureTrackingDevice(), mitk::TrackingTool::GetErrorMessage(), mitk::StatusBar::GetInstance(), mitk::TrackingTool::GetOrientation(), mitk::TrackingTool::GetPosition(), mitk::TrackingTool::GetToolName(), mitk::TrackingTool::GetTrackingError(), mitk::TrackingTool::IsDataValid(), out, QuadProgPP::t(), QmitkFunctionality::WaitCursorOff(), and QmitkFunctionality::WaitCursorOn().

Referenced by CreateConnections().

{
  WaitCursorOn();
  mitk::StatusBar::GetInstance()->DisplayText("Executing test of the tracking component", 4000);

  /* Create & set up tracking device with a tool */
  mitk::TrackingDevice::Pointer tracker = this->ConfigureTrackingDevice();
  if (tracker.IsNull())
  {
    out->append("Error creating tracking device. Did you provide all parameters?");
    return;
  }

  /* open the connection, load tools that are connected (active Tools) and initialize them. */
  out->append("opening connection to tracking device");
  if (tracker->OpenConnection() == false)
  {
    out->append(QString("ERROR during OpenConnection(): ") + QString(tracker->GetErrorMessage()));
    tracker->CloseConnection();
    WaitCursorOff();
    return;
  }
  else
    out->append("successfully connected to tracking device.");

  /* Start tracking */
  if (tracker->StartTracking() == false)
  {
    out->append(QString("ERROR during StartTracking(): ") + QString(tracker->GetErrorMessage()));
    tracker->CloseConnection();
    WaitCursorOff();
    return;
  }
  else
    out->append("tracking device is tracking now.");

  /* read tracking data 50 times */
  out->append("Starting to read tracking data for all tools.");
  mitk::TrackingTool* t = NULL;
  mitk::Point3D pos;
  mitk::Quaternion quat;
  for(int i=0; i< 50; i++)  // 50x
  {
    for (unsigned int i = 0; i < tracker->GetToolCount(); i++) // each tool
    {
      std::stringstream output;
      t = tracker->GetTool(i);
      if (t == NULL)
        continue;
      output << "Tool " << t->GetToolName() << ":" << std::endl;
      if (t->IsDataValid() == true)
      {
        t->GetPosition(pos);
        output << "  Position      = <" << pos[0] << ", " << pos[1] << ", " << pos[2] << ">" << std::endl;
        t->GetOrientation(quat);
        output << "  Orientation   = <" << quat[0] << ", " << quat[1] << ", " << quat[2] << ", " << quat[3] << ">" << std::endl;
        output << "  TrackingError = " << t->GetTrackingError() << std::endl;
      }
      else
        output << "  Data is invalid. Error message: " << t->GetErrorMessage() << std::endl;
      output << "--------------------------------------------" << std::endl;
      out->append(output.str().c_str()); // append string stream content to gui widget
    }
    //wait a little to get the next coordinate
    itksys::SystemTools::Delay(100);
  }

  /* Stop tracking */
  out->append("Enough tracking data. Stopping tracking now.");
  if (tracker->StopTracking() == false)
  {
    out->append(QString("ERROR during StopTracking(): ") + QString(tracker->GetErrorMessage()));
    tracker->CloseConnection();
    WaitCursorOff();
    return;
  }
  else
    out->append("Tracking stopped.");

  /* Stop tracking */
  if (tracker->CloseConnection() == false)
  {
    out->append(QString("ERROR during CloseConnection(): ") + QString(tracker->GetErrorMessage()));
    WaitCursorOff();
    return;
  }
  else
    out->append("tracking stopped.");

  mitk::StatusBar::GetInstance()->DisplayText("test of the tracking component finished", 2000);
  WaitCursorOff();  // restore normal mouse cursor after you finished
}
void QmitkIGTExampleView::OnTrackingDeviceTextChanged ( const QString &   ) [protected, slot]

Chooses the current tracking device.

Documentation This method is called when the m_TrackingDevice selector changed.

Definition at line 807 of file QmitkIGTExampleView.cpp.

References m_Controls, Ui_QmitkIGTExampleControls::m_LoadToolBtn, Ui_QmitkIGTExampleControls::m_Port, Ui_QmitkIGTExampleControls::m_PortLabel, Ui_QmitkIGTExampleControls::m_ToolFileName, and Ui_QmitkIGTExampleControls::m_TrackingDevice.

Referenced by CreateConnections().

{
  if (m_Controls->m_TrackingDevice->currentText() == "NDI Polaris")
  {
    m_Controls->m_LoadToolBtn->setEnabled(true);
    m_Controls->m_ToolFileName->setEnabled(true);
    m_Controls->m_PortLabel->setEnabled(true);
    m_Controls->m_Port->setEnabled(true);
  }
  else if (m_Controls->m_TrackingDevice->currentText() == "NDI Aurora")
  {
    m_Controls->m_LoadToolBtn->setEnabled(false);
    m_Controls->m_ToolFileName->setEnabled(false);
    m_Controls->m_PortLabel->setEnabled(true);
    m_Controls->m_Port->setEnabled(true);
  }
  else if (m_Controls->m_TrackingDevice->currentText() == "Micron Tracker")
  {
    m_Controls->m_LoadToolBtn->setEnabled(true);
    m_Controls->m_ToolFileName->setEnabled(true);
    m_Controls->m_PortLabel->setEnabled(false);
    m_Controls->m_Port->setEnabled(false);
  }
  else
  {
    m_Controls->m_LoadToolBtn->setEnabled(false);
    m_Controls->m_ToolFileName->setEnabled(false);
    m_Controls->m_PortLabel->setEnabled(false);
    m_Controls->m_Port->setEnabled(false);
  }
}
void QmitkIGTExampleView::StdMultiWidgetAvailable ( QmitkStdMultiWidget stdMultiWidget ) [virtual]

Called when a StdMultiWidget is available. Should not be used anymore, see GetActiveStdMultiWidget()

See also:
GetActiveStdMultiWidget()

Reimplemented from QmitkFunctionality.

Definition at line 117 of file QmitkIGTExampleView.cpp.

References m_MultiWidget.

{
  m_MultiWidget = &stdMultiWidget;
}
void QmitkIGTExampleView::StdMultiWidgetNotAvailable (  ) [virtual]

Called when no StdMultiWidget is available anymore. Should not be used anymore, see GetActiveStdMultiWidget()

See also:
GetActiveStdMultiWidget()

Reimplemented from QmitkFunctionality.

Definition at line 122 of file QmitkIGTExampleView.cpp.

References m_MultiWidget.

{
  m_MultiWidget = NULL;
}

Member Data Documentation

displacement filter that adds an offset to NDs

Definition at line 240 of file QmitkIGTExampleView.h.

Referenced by OnParametersChanged(), OnShowErrorPlot(), OnStop(), and OnTestNavigation().

Definition at line 241 of file QmitkIGTExampleView.h.

Referenced by OnMeasure(), OnStop(), and OnTestNavigation().

calls OnErrorValueChanged when the error value of its input changes

Definition at line 245 of file QmitkIGTExampleView.h.

Referenced by OnErrorValueChanged(), OnMeasure(), OnShowErrorPlot(), and OnStop().

default render widget

Definition at line 236 of file QmitkIGTExampleView.h.

Referenced by OnMeasure(), OnPlaying(), StdMultiWidgetAvailable(), and StdMultiWidgetNotAvailable().

plays a XML file

Definition at line 243 of file QmitkIGTExampleView.h.

Referenced by OnPlayingToggle(), and ~QmitkIGTExampleView().

timer for continuous playing

Definition at line 254 of file QmitkIGTExampleView.h.

Referenced by CreateConnections(), OnPlayingToggle(), QmitkIGTExampleView(), and ~QmitkIGTExampleView().

stores the output of the pointsetfilter

Definition at line 246 of file QmitkIGTExampleView.h.

has a NDs as input and a PointSet as output

Definition at line 244 of file QmitkIGTExampleView.h.

Referenced by OnMeasure(), OnPlaying(), OnPlayingToggle(), OnStop(), and OnTestNavigation().

records NDs to a XML file

Definition at line 242 of file QmitkIGTExampleView.h.

Referenced by OnPlayingToggle(), OnRecording(), OnRecordingToggle(), and ~QmitkIGTExampleView().

timer for continuous recording

Definition at line 253 of file QmitkIGTExampleView.h.

Referenced by CreateConnections(), OnPlayingToggle(), OnRecordingToggle(), QmitkIGTExampleView(), and ~QmitkIGTExampleView().

first filter in the pipeline

Definition at line 239 of file QmitkIGTExampleView.h.

Referenced by OnRecordingToggle(), OnStop(), and OnTestNavigation().

QTimer* QmitkIGTExampleView::m_Timer [protected]

timer for continuous tracking update

Definition at line 252 of file QmitkIGTExampleView.h.

Referenced by CreateConnections(), OnMeasureContinuously(), QmitkIGTExampleView(), and ~QmitkIGTExampleView().

QStringList QmitkIGTExampleView::m_ToolList [protected]

list to the tool description files

Definition at line 256 of file QmitkIGTExampleView.h.

Referenced by ConfigureTrackingDevice(), and OnLoadTool().

X-Values of the error plot (timestamp of navigation data)

Definition at line 248 of file QmitkIGTExampleView.h.

Referenced by OnErrorValueChanged(), OnShowErrorPlot(), and QmitkIGTExampleView().

Y-Values of the error plot (error value of navigation data.

Definition at line 249 of file QmitkIGTExampleView.h.

Referenced by OnErrorValueChanged(), OnShowErrorPlot(), and QmitkIGTExampleView().

QTextEdit* QmitkIGTExampleView::out [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines