27 #include <mitkIGTException.h>
31 #include <qfiledialog.h>
32 #include <qmessagebox.h>
37 m_RealTimePlayer(
mitk::NavigationDataPlayer::
New()),
38 m_SequentialPlayer(
mitk::NavigationDataSequentialPlayer::
New()),
40 m_CurrentSequentialPointNumber(0),
41 m_Controls(new
Ui::QmitkIGTPlayerWidgetControls)
48 m_Controls->samplePositionHorizontalSlider->setVisible(
false);
65 connect( (QObject*) (
m_Controls->stopPushButton), SIGNAL(clicked()),
this, SLOT(
OnGoToEnd()) );
80 return m_Controls->splineModeCheckBox->isChecked();
90 QMessageBox::warning(NULL,
"IGTPlayer: Error",
"No valid input file was loaded. Please load input file first!");
99 unsigned int result = 0;
165 std::string errormessage =
"Error during start playing. Invalid or wrong file?";
166 QMessageBox::warning(NULL,
"IGTPlayer: Error", errormessage.c_str());
167 m_Controls->playPushButton->setChecked(
false);
182 std::string errormessage =
"Error during start playing. Invalid or wrong file?";
183 QMessageBox::warning(NULL,
"IGTPlayer: Error", errormessage.c_str());
184 m_Controls->playPushButton->setChecked(
false);
189 else if(isSequentialMode)
198 std::string errormessage =
"Error during start playing. Invalid or wrong file type?";
199 QMessageBox::warning(NULL,
"IGTPlayer: Error", errormessage.c_str());
200 m_Controls->playPushButton->setChecked(
false);
205 m_Controls->samplePositionHorizontalSlider->setMinimum(0);
209 m_Controls->samplePositionHorizontalSlider->setEnabled(
true);
238 m_Controls->playPushButton->setChecked(
false);
274 m_Controls->playPushButton->setChecked(
false);
299 msc = (msc - ms) / 1000;
301 int min = (msc-s) / 60;
321 if ( m_CurrentSequentialPointNumber < m_SequentialPlayer->GetNumberOfSnapshots() )
345 std::vector<mitk::NavigationData::Pointer> navDatas;
378 int numberOfOutputs = 0;
382 else if(isSequentialMode)
391 else if(isSequentialMode)
394 pointType[0] = position[0];
395 pointType[1] = position[1];
396 pointType[2] = position[2];
398 result->InsertPoint(i,pointType);
408 throw std::out_of_range(
"Tool Index out of range!");
423 else if(isSequentialMode)
426 result[0] = position[0];
427 result[1] = position[1];
428 result[2] = position[2];
448 QString
filename = QFileDialog::getOpenFileName(
this,
"Load tracking data", QDir::currentPath(),
"XML files (*.xml)");
449 QFile file(filename);
452 if ( filename.isEmpty() || ! file.exists() )
454 QMessageBox::warning(NULL,
"Warning", QString(
"Please enter valid path. Using previous path again."));
470 m_Controls->m_PlayerControlsGroupBox->setEnabled(
true);
495 m_Controls->playPushButton->setChecked(
false);
501 m_Controls->minLCDNumber->display(QString(
"00"));
502 m_Controls->secLCDNumber->display(QString(
"00"));
503 m_Controls->msecLCDNumber->display(QString(
"000"));
508 QComboBox* cBox =
m_Controls->trajectorySelectComboBox;
510 if(cBox->count() > 0)
516 if(!toolNames.isEmpty())
517 m_Controls->trajectorySelectComboBox->insertItems(0, toolNames);
525 return m_Controls->resolutionSpinBox->value();
533 m_Controls->trajectorySelectComboBox->clear();
545 m_Controls->samplePositionHorizontalSlider->setEnabled(
true);
549 m_Controls->samplePositionHorizontalSlider->setSliderPosition(0);
550 m_Controls->samplePositionHorizontalSlider->setDisabled(
true);
556 int currentSliderValue =
m_Controls->samplePositionHorizontalSlider->value();
560 unsigned int snapshotNumber = currentSliderValue;
563 m_Controls->sampleLCDNumber->display(currentSliderValue);
An object of this class represents an exception of the MITK-IGT module.
DataCollection - Class to facilitate loading/accessing structured data.
static mitk::BaseData::Pointer LoadBaseData(const std::string &path)
Create a BaseData object from the given file.
static const std::string filename
Data structure which stores streams of mitk::NavigationData for multiple tools.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.