p,p'p)p!p~p{p]p^p/p(pM8Y6_p:pq,q'q)qd Gd!qOk~q{qfmv9]q^q/q(q_q:qr`b,r'r)r!r~r{r]r^r/r(r_r:rjKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr`r s.sSn+s@s#s$s%s&sv9^n*s=s@$-s;sh:>s,s'sil)s!s~s{s]s^s/s(s_s:st,t't)t!t~t{txr/i(i]t^t/t(ti=k=6sfq:l%__tP)k=:tq;i=HaB]&gXc",
+"R:7TtUtVtWtXtYtZt`tCq~t u6h.u&j+up6@ui=Qcypk=gq#uu*li=,uj&'u)uzf!u~uzew9{u+o]uZg2hMoT6^uKmZjVmWl/ujooaa35h(u_u:uwnv,v'v)v!p!v~v{v]vBt^v/v(v_v:vw,w'w(e)w!pi=K(!wO)vo@3%_k=i=;4~wk=%_8bK(~j",
+"{w]w^w/w(w;;^+4.'#g@9 _w:wykxLa9hVl[bbh,x'x>w)xws@v0qa3#kdv!x~xi=JuK({x]xJu_t#ui=M{^xtpi=fqdb",
+"/x(x_x:xycg,yZ6Fh'yLh=y@wvx2z*jLa,z)x)xP6]e'z u1sAOq,A'A)A!Atm'A~Avz{A]AYy)AqxFt1}^Aen/A(A@z_A6u:Agzzsw-y*B=B-B;B>Bds,BM{xa'BcyGz)B8spp!B*l",
+". . . . . . . . . . . + * = { 5.9 S {+L%A ~B{B@!(3>_]B^BMz/B8ply(B22_B:B=8+OB&.d.;6PBV3QBRBiySBTB_zUB 1VBWBXBYBZB`B C.C+C@C#C$C%CC,C'C)C!C~C{C]C^C/C(C_C:C+L%pCd.^zqC(3L;KzrCsCtCuCvCwCxC(ByCXBzCACM5m5[z}zq*BCi5CCDCECwAFCGCHCICJCKC54LCMC3zNCSrOCPCQCRCSCTCpu`u}wVlzz;j>A{AUCVCWCOAXCXyYCZC`CXy DYvnmFrwg5yYkDx.DN6rvkt+Dit>z@D#D$D%D&Di=*DKB=D-D;DIz&nqp>D",
+". . . . . . . . . . . . . . . . . . . . . . . . @ . . . . . . @ * = ~ H 9 Q P {+F k j d.^zqCkAV3N2rC,D'D)D!DS5qA~DyC{D]DRzFAEIl;E_p>iRa/r!^S+,E'E2q)E!5!E~E{E",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ . . . . . . . . . . . . . . . . . . @ + * { ~ ) H a+a+R F ^.&.e.iA^z@!kAP/N2]E^E/E(E/B_EOzPz:EF+A.^._.3F;6^zjA4FP/QB5F70,D6FTB_E%67F 1N_nyXBn5;F}E+gF 1hFiFjF^.J . . @ @ @ @ . . . . . . . . . . . . . . . . . . . . . . . @ = = = J 5.9 9 Q R >+^.&.e.e.oDjA@!ZEP/N2RBLz*6'DjyTBeF_E%6S5pD",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ~ lykF<'lFmFnFoFpFqFQB@ @ . @ . . . . . . . . . . . . . . . @ . . . @ . @ . @ . . . . . . . . @ @ + { { ~ J H I a+a+>+1+F j 3Fd.oD^zrFjAg3kAP/",
+". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J ,DsFtFuFvFwFxF
+#include
+
+// Qmitk
+#include "QmitkIGTTrackingSemiAutomaticMeasurementView.h"
+#include "QmitkStdMultiWidget.h"
+
+// Qt
+#include
+#include
+#include
+#include
+
+// MITK
+#include
+#include
+#include
+
+// POCO
+#include
+#include
+
+const std::string QmitkIGTTrackingSemiAutomaticMeasurementView::VIEW_ID = "org.mitk.views.igttrackingsemiautomaticmeasurement";
+
+QmitkIGTTrackingSemiAutomaticMeasurementView::QmitkIGTTrackingSemiAutomaticMeasurementView()
+ : QmitkFunctionality()
+ , m_Controls(0)
+ , m_MultiWidget(NULL)
+{
+ m_NextFile = 0;
+ m_FilenameVector = std::vector();
+ m_Timer = new QTimer(this);
+ m_logging = false;
+ m_referenceValid = true;
+ m_tracking = false;
+ m_EvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
+}
+
+QmitkIGTTrackingSemiAutomaticMeasurementView::~QmitkIGTTrackingSemiAutomaticMeasurementView()
+{
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::CreateResults()
+{
+ QString LogFileName = m_Controls->m_OutputPath->text() + "_results.log";
+ mitk::LoggingBackend::Unregister();
+ mitk::LoggingBackend::SetLogFile(LogFileName.toStdString().c_str());
+ mitk::LoggingBackend::Register();
+
+ double RMSmean = 0;
+ for (int i = 0; i < m_RMSValues.size(); i++)
+ {
+ MITK_INFO << "RMS at " << this->m_FilenameVector.at(i) << ": " << m_RMSValues.at(i);
+ RMSmean += m_RMSValues.at(i);
+ }
+ RMSmean /= m_RMSValues.size();
+ MITK_INFO << "RMS mean over " << m_RMSValues.size() << " values: " << RMSmean;
+
+ mitk::DataNode::Pointer newNode = mitk::DataNode::New();
+ newNode->SetName("Tracking Results");
+ newNode->SetData(this->m_MeanPoints);
+ this->GetDataStorage()->Add(newNode);
+
+ if (m_MeanPoints->GetSize() == 12)
+ {
+ MITK_INFO << "Computing distance error for Compact FG...";
+ std::vector distances;
+ mitk::Point3D test;
+ //row 1
+ distances.push_back(m_MeanPoints->GetPoint(0).EuclideanDistanceTo(m_MeanPoints->GetPoint(1))); //0
+ distances.push_back(m_MeanPoints->GetPoint(1).EuclideanDistanceTo(m_MeanPoints->GetPoint(2))); //1
+ distances.push_back(m_MeanPoints->GetPoint(2).EuclideanDistanceTo(m_MeanPoints->GetPoint(3))); //2
+ //row 2
+ distances.push_back(m_MeanPoints->GetPoint(4).EuclideanDistanceTo(m_MeanPoints->GetPoint(5))); //3
+ distances.push_back(m_MeanPoints->GetPoint(5).EuclideanDistanceTo(m_MeanPoints->GetPoint(6))); //4
+ distances.push_back(m_MeanPoints->GetPoint(6).EuclideanDistanceTo(m_MeanPoints->GetPoint(7))); //5
+ //row 3
+ distances.push_back(m_MeanPoints->GetPoint(8).EuclideanDistanceTo(m_MeanPoints->GetPoint(9))); //6
+ distances.push_back(m_MeanPoints->GetPoint(9).EuclideanDistanceTo(m_MeanPoints->GetPoint(10))); //7
+ distances.push_back(m_MeanPoints->GetPoint(10).EuclideanDistanceTo(m_MeanPoints->GetPoint(11))); //8
+ //column 1
+ distances.push_back(m_MeanPoints->GetPoint(0).EuclideanDistanceTo(m_MeanPoints->GetPoint(4))); //9
+ distances.push_back(m_MeanPoints->GetPoint(4).EuclideanDistanceTo(m_MeanPoints->GetPoint(8))); //10
+ //column 2
+ distances.push_back(m_MeanPoints->GetPoint(1).EuclideanDistanceTo(m_MeanPoints->GetPoint(5))); //11
+ distances.push_back(m_MeanPoints->GetPoint(5).EuclideanDistanceTo(m_MeanPoints->GetPoint(9))); //12
+ //column 3
+ distances.push_back(m_MeanPoints->GetPoint(2).EuclideanDistanceTo(m_MeanPoints->GetPoint(6))); //13
+ distances.push_back(m_MeanPoints->GetPoint(6).EuclideanDistanceTo(m_MeanPoints->GetPoint(10))); //14
+ //column 4
+ distances.push_back(m_MeanPoints->GetPoint(3).EuclideanDistanceTo(m_MeanPoints->GetPoint(7))); //15
+ distances.push_back(m_MeanPoints->GetPoint(7).EuclideanDistanceTo(m_MeanPoints->GetPoint(11))); //16
+
+ std::vector errors;
+ double meanError = 0;
+ for (int i = 0; i < distances.size(); i++)
+ {
+ double currentError = distances.at(i) - (double)50.0;
+ errors.push_back(currentError);
+ meanError += currentError;
+ MITK_INFO << "Error" << i << " : " << currentError;
+ }
+ meanError /= distances.size();
+ MITK_INFO << "Mean error : " << meanError;
+ }
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::CreateQtPartControl(QWidget *parent)
+{
+ // build up qt view, unless already done
+ if (!m_Controls)
+ {
+ // create GUI widgets from the Qt Designer's .ui file
+ m_Controls = new Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls;
+ m_Controls->setupUi(parent);
+
+ //buttons
+ connect(m_Controls->m_LoadMeasurementToolStorage, SIGNAL(clicked()), this, SLOT(OnLoadMeasurementStorage()));
+ connect(m_Controls->m_LoadReferenceToolStorage, SIGNAL(clicked()), this, SLOT(OnLoadReferenceStorage()));
+ connect(m_Controls->m_StartTracking, SIGNAL(clicked()), this, SLOT(OnStartTracking()));
+ connect(m_Controls->m_LoadList, SIGNAL(clicked()), this, SLOT(OnMeasurementLoadFile()));
+ connect(m_Controls->m_StartNextMeasurement, SIGNAL(clicked()), this, SLOT(StartNextMeasurement()));
+ connect(m_Controls->m_ReapeatLastMeasurement, SIGNAL(clicked()), this, SLOT(RepeatLastMeasurement()));
+ connect(m_Controls->m_SetReference, SIGNAL(clicked()), this, SLOT(OnSetReference()));
+ connect(m_Controls->m_UseReferenceTrackingSystem, SIGNAL(toggled(bool)), this, SLOT(OnUseReferenceToggled(bool)));
+ connect(m_Controls->m_CreateResults, SIGNAL(clicked()), this, SLOT(CreateResults()));
+
+ //event filter
+ qApp->installEventFilter(this);
+
+ //timers
+ connect(m_Timer, SIGNAL(timeout()), this, SLOT(UpdateTimer()));
+ }
+
+ //initialize some view
+ m_Controls->m_StopTracking->setEnabled(false);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::StdMultiWidgetAvailable(QmitkStdMultiWidget &stdMultiWidget)
+{
+ m_MultiWidget = &stdMultiWidget;
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnUseReferenceToggled(bool state)
+{
+ if (state)
+ {
+ m_Controls->m_ReferenceBox->setEnabled(true);
+ m_Controls->m_SetReference->setEnabled(true);
+ }
+
+ else
+ {
+ m_Controls->m_ReferenceBox->setEnabled(false);
+ m_Controls->m_SetReference->setEnabled(false);
+ }
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::StdMultiWidgetNotAvailable()
+{
+ m_MultiWidget = NULL;
+}
+
+mitk::NavigationToolStorage::Pointer QmitkIGTTrackingSemiAutomaticMeasurementView::ReadStorage(std::string file)
+{
+ mitk::NavigationToolStorage::Pointer returnValue;
+
+ //initialize tool storage
+ returnValue = mitk::NavigationToolStorage::New();
+
+ //read tool storage from disk
+ mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(GetDataStorage());
+ returnValue = myDeserializer->Deserialize(file);
+ if (returnValue.IsNull())
+ {
+ QMessageBox msgBox;
+ msgBox.setText(myDeserializer->GetErrorMessage().c_str());
+ msgBox.exec();
+
+ returnValue = NULL;
+ }
+
+ return returnValue;
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnSetReference()
+{
+ //initialize reference
+ m_ReferenceStartPositions = std::vector();
+ m_ReferenceTrackingDeviceSource->Update();
+ QString Label = "Positions At Start: ";
+ for (int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); i++)
+ {
+ mitk::Point3D position = m_ReferenceTrackingDeviceSource->GetOutput(i)->GetPosition();
+ Label = Label + "Tool" + QString::number(i) + ":[" + QString::number(position[0]) + ":" + QString::number(position[1]) + ":" + QString::number(position[1]) + "] ";
+ m_ReferenceStartPositions.push_back(position);
+ }
+ m_Controls->m_ReferencePosAtStart->setText(Label);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnLoadMeasurementStorage()
+{
+ //read in filename
+ QString filename = QFileDialog::getOpenFileName(NULL, tr("Open Toolfile"), "/", tr("All Files (*.*)"));
+ if (filename.isNull()) return;
+
+ m_MeasurementStorage = ReadStorage(filename.toStdString());
+
+ //update label
+ Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to seperate filename from path
+ QString toolLabel = QString("Tool Storage: ") + QString::number(m_MeasurementStorage->GetToolCount()) + " Tools from " + myPath.getFileName().c_str();
+ m_Controls->m_MeasurementToolStorageLabel->setText(toolLabel);
+
+ //update status widget
+ m_Controls->m_ToolStatusWidget->RemoveStatusLabels();
+ m_Controls->m_ToolStatusWidget->PreShowTools(m_MeasurementStorage);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnLoadReferenceStorage()
+{
+ //read in filename
+ static QString oldFile;
+ if (oldFile.isNull()) oldFile = "/";
+ QString filename = QFileDialog::getOpenFileName(NULL, tr("Open Toolfile"), oldFile, tr("All Files (*.*)"));
+ if (filename.isNull()) return;
+ oldFile = filename;
+
+ m_ReferenceStorage = ReadStorage(filename.toStdString());
+
+ //update label
+ Poco::Path myPath = Poco::Path(filename.toStdString()); //use this to seperate filename from path
+ QString toolLabel = QString("Tool Storage: ") + QString::number(m_ReferenceStorage->GetToolCount()) + " Tools from " + myPath.getFileName().c_str();
+ m_Controls->m_ReferenceToolStorageLabel->setText(toolLabel);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnStartTracking()
+{
+ //check if everything is ready to start tracking
+ if (m_MeasurementStorage.IsNull())
+ {
+ MessageBox("Error: No measurement tools loaded yet!");
+ return;
+ }
+ else if (m_ReferenceStorage.IsNull() && m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ MessageBox("Error: No refernce tools loaded yet!");
+ return;
+ }
+ else if (m_MeasurementStorage->GetToolCount() == 0)
+ {
+ MessageBox("Error: No way to track without tools!");
+ return;
+ }
+ else if (m_Controls->m_UseReferenceTrackingSystem->isChecked() && (m_ReferenceStorage->GetToolCount() == 0))
+ {
+ MessageBox("Error: No way to track without tools!");
+ return;
+ }
+
+ //build the first IGT pipeline (MEASUREMENT)
+ mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory1 = mitk::TrackingDeviceSourceConfigurator::New(this->m_MeasurementStorage, this->m_Controls->m_MeasurementTrackingDeviceConfigurationWidget->GetTrackingDevice());
+ m_MeasurementTrackingDeviceSource = myTrackingDeviceSourceFactory1->CreateTrackingDeviceSource(this->m_MeasurementToolVisualizationFilter);
+ if (m_MeasurementTrackingDeviceSource.IsNull())
+ {
+ MessageBox(myTrackingDeviceSourceFactory1->GetErrorMessage());
+ return;
+ }
+ //connect the tool visualization widget
+ for (int i = 0; i < m_MeasurementTrackingDeviceSource->GetNumberOfOutputs(); i++)
+ {
+ m_Controls->m_ToolStatusWidget->AddNavigationData(m_MeasurementTrackingDeviceSource->GetOutput(i));
+ m_EvaluationFilter->SetInput(i, m_MeasurementTrackingDeviceSource->GetOutput(i));
+ }
+ m_Controls->m_ToolStatusWidget->ShowStatusLabels();
+ m_Controls->m_ToolStatusWidget->SetShowPositions(true);
+ m_Controls->m_ToolStatusWidget->SetShowQuaternions(true);
+
+ //build the second IGT pipeline (REFERENCE)
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ mitk::TrackingDeviceSourceConfigurator::Pointer myTrackingDeviceSourceFactory2 = mitk::TrackingDeviceSourceConfigurator::New(this->m_ReferenceStorage, this->m_Controls->m_ReferenceDeviceConfigurationWidget->GetTrackingDevice());
+ m_ReferenceTrackingDeviceSource = myTrackingDeviceSourceFactory2->CreateTrackingDeviceSource();
+ if (m_ReferenceTrackingDeviceSource.IsNull())
+ {
+ MessageBox(myTrackingDeviceSourceFactory2->GetErrorMessage());
+ return;
+ }
+ }
+
+ //initialize tracking
+ try
+ {
+ m_MeasurementTrackingDeviceSource->Connect();
+ m_MeasurementTrackingDeviceSource->StartTracking();
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceTrackingDeviceSource->Connect();
+ m_ReferenceTrackingDeviceSource->StartTracking();
+ }
+ }
+ catch (...)
+ {
+ MessageBox("Error while starting the tracking device!");
+ return;
+ }
+
+ //set reference
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked()) OnSetReference();
+
+ //start timer
+ m_Timer->start(1000 / (m_Controls->m_SamplingRate->value()));
+
+ m_Controls->m_StartTracking->setEnabled(false);
+ m_Controls->m_StartTracking->setEnabled(true);
+
+ m_tracking = true;
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnStopTracking()
+{
+ if (this->m_logging) FinishMeasurement();
+ m_MeasurementTrackingDeviceSource->Disconnect();
+ m_MeasurementTrackingDeviceSource->StopTracking();
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceTrackingDeviceSource->Disconnect();
+ m_ReferenceTrackingDeviceSource->StopTracking();
+ }
+ m_Timer->stop();
+ m_Controls->m_StartTracking->setEnabled(true);
+ m_Controls->m_StartTracking->setEnabled(false);
+ m_tracking = false;
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::OnMeasurementLoadFile()
+{
+ m_FilenameVector = std::vector();
+ m_FilenameVector.clear();
+ m_NextFile = 0;
+
+ //read in filename
+ QString filename = QFileDialog::getOpenFileName(NULL, tr("Open Measurement Filename List"), "/", tr("All Files (*.*)"));
+ if (filename.isNull()) return;
+
+ //save old locale
+ char * oldLocale;
+ oldLocale = setlocale(LC_ALL, 0);
+
+ //define own locale
+ std::locale C("C");
+ setlocale(LC_ALL, "C");
+
+ //read file
+ std::ifstream file;
+ file.open(filename.toStdString().c_str(), std::ios::in);
+ if (file.good())
+ {
+ //read out file
+ file.seekg(0L, std::ios::beg); // move to begin of file
+ while (!file.eof())
+ {
+ std::string buffer;
+ std::getline(file, buffer); // read out file line by line
+ if (buffer.size() > 0) m_FilenameVector.push_back(buffer);
+ }
+ }
+
+ //fill list at GUI
+ m_Controls->m_MeasurementList->clear();
+ for (unsigned int i = 0; i < m_FilenameVector.size(); i++) { new QListWidgetItem(tr(m_FilenameVector.at(i).c_str()), m_Controls->m_MeasurementList); }
+
+ //update label next measurement
+ std::stringstream label;
+ label << "Next Measurement: " << m_FilenameVector.at(0);
+ m_Controls->m_NextMeasurement->setText(label.str().c_str());
+
+ //reset results files
+ m_MeanPoints = mitk::PointSet::New();
+ m_RMSValues = std::vector();
+ m_EvaluationFilter = mitk::NavigationDataEvaluationFilter::New();
+ if (m_MeasurementToolVisualizationFilter.IsNotNull()) m_EvaluationFilter->SetInput(0, m_MeasurementToolVisualizationFilter->GetOutput(0));
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::UpdateTimer()
+{
+ if (m_EvaluationFilter.IsNotNull() && m_logging) m_EvaluationFilter->Update();
+ else m_MeasurementToolVisualizationFilter->Update();
+
+ m_Controls->m_ToolStatusWidget->Refresh();
+
+ //update reference
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceTrackingDeviceSource->Update();
+ QString Label = "Current Positions: ";
+ bool distanceThresholdExceeded = false;
+ for (int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); i++)
+ {
+ mitk::Point3D position = m_ReferenceTrackingDeviceSource->GetOutput(i)->GetPosition();
+ Label = Label + "Tool" + QString::number(i) + ":[" + QString::number(position[0]) + ":" + QString::number(position[1]) + ":" + QString::number(position[1]) + "] ";
+ if (position.EuclideanDistanceTo(m_ReferenceStartPositions.at(i)) > m_Controls->m_ReferenceThreshold->value()) distanceThresholdExceeded = true;
+ }
+ m_Controls->m_ReferenceCurrentPos->setText(Label);
+ if (distanceThresholdExceeded)
+ {
+ m_Controls->m_ReferenceOK->setText("NOT OK!");
+ m_referenceValid = false;
+ }
+ else
+ {
+ m_Controls->m_ReferenceOK->setText("OK");
+ m_referenceValid = true;
+ }
+ }
+
+ //update logging
+ if (m_logging)
+ {
+ //check for missing objects
+ if (m_MeasurementLoggingFilterXML.IsNull() ||
+ m_MeasurementLoggingFilterCSV.IsNull()
+ )
+ {
+ return;
+ }
+
+ //log/measure
+ m_MeasurementLoggingFilterXML->Update();
+ m_MeasurementLoggingFilterCSV->Update();
+
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked() &&
+ m_ReferenceLoggingFilterXML.IsNotNull() &&
+ m_ReferenceLoggingFilterCSV.IsNotNull())
+ {
+ m_ReferenceLoggingFilterXML->Update();
+ m_ReferenceLoggingFilterCSV->Update();
+ }
+ m_loggedFrames++;
+ LogAdditionalCSVFile();
+
+ //check if all frames are logged ... if yes finish the measurement
+ if (m_loggedFrames > m_Controls->m_SamplesPerMeasurement->value()) { FinishMeasurement(); }
+
+ //update logging label
+ QString loggingLabel = "Collected Samples: " + QString::number(m_loggedFrames);
+ m_Controls->m_CollectedSamples->setText(loggingLabel);
+ }
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::StartNextMeasurement()
+{
+ if (this->m_NextFile >= m_FilenameVector.size())
+ {
+ MessageBox("Last Measurement reached!");
+ return;
+ }
+
+ m_loggedFrames = 0;
+ m_logging = true;
+
+ //check if directory exists, if not create one
+ Poco::File myPath(std::string(m_Controls->m_OutputPath->text().toUtf8()).c_str());
+ if (!myPath.exists()) myPath.createDirectory();
+
+ QString LogFileName = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".log";
+ mitk::LoggingBackend::Unregister();
+ mitk::LoggingBackend::SetLogFile(LogFileName.toStdString().c_str());
+ mitk::LoggingBackend::Register();
+
+ //initialize logging filters
+ m_MeasurementLoggingFilterXML = mitk::NavigationDataRecorderDeprecated::New();
+ m_MeasurementLoggingFilterXML->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
+ m_MeasurementLoggingFilterCSV = mitk::NavigationDataRecorderDeprecated::New();
+ m_MeasurementLoggingFilterCSV->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
+ m_MeasurementLoggingFilterXML->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::xml);
+ m_MeasurementLoggingFilterCSV->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::csv);
+ QString MeasurementFilenameXML = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".xml";
+ QString MeasurementFilenameCSV = m_Controls->m_OutputPath->text() + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".csv";
+ m_MeasurementLoggingFilterXML->SetFileName(MeasurementFilenameXML.toStdString());
+ m_MeasurementLoggingFilterCSV->SetFileName(MeasurementFilenameCSV.toStdString());
+ m_MeasurementLoggingFilterXML->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
+ m_MeasurementLoggingFilterCSV->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
+
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceLoggingFilterXML = mitk::NavigationDataRecorderDeprecated::New();
+ m_ReferenceLoggingFilterXML->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
+ m_ReferenceLoggingFilterCSV = mitk::NavigationDataRecorderDeprecated::New();
+ m_ReferenceLoggingFilterCSV->SetRecordingMode(mitk::NavigationDataRecorderDeprecated::NormalFile);
+ m_ReferenceLoggingFilterXML->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::xml);
+ m_ReferenceLoggingFilterCSV->SetOutputFormat(mitk::NavigationDataRecorderDeprecated::csv);
+ QString ReferenceFilenameXML = m_Controls->m_OutputPath->text() + "Reference_" + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".xml";
+ QString ReferenceFilenameCSV = m_Controls->m_OutputPath->text() + "Reference_" + QString(m_FilenameVector.at(m_NextFile).c_str()) + ".csv";
+ m_ReferenceLoggingFilterXML->SetFileName(ReferenceFilenameXML.toStdString());
+ m_ReferenceLoggingFilterCSV->SetFileName(ReferenceFilenameCSV.toStdString());
+ m_ReferenceLoggingFilterXML->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
+ m_ReferenceLoggingFilterCSV->SetRecordCountLimit(m_Controls->m_SamplesPerMeasurement->value());
+ }
+
+ //start additional csv logging
+ StartLoggingAdditionalCSVFile(m_FilenameVector.at(m_NextFile));
+
+ //connect filter
+ for (int i = 0; i < m_MeasurementToolVisualizationFilter->GetNumberOfOutputs(); i++)
+ {
+ m_MeasurementLoggingFilterXML->AddNavigationData(m_MeasurementToolVisualizationFilter->GetOutput(i));
+ m_MeasurementLoggingFilterCSV->AddNavigationData(m_MeasurementToolVisualizationFilter->GetOutput(i));
+ }
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked()) for (int i = 0; i < m_ReferenceTrackingDeviceSource->GetNumberOfOutputs(); i++)
+ {
+ m_ReferenceLoggingFilterXML->AddNavigationData(m_ReferenceTrackingDeviceSource->GetOutput(i));
+ m_ReferenceLoggingFilterCSV->AddNavigationData(m_ReferenceTrackingDeviceSource->GetOutput(i));
+ }
+
+ //start filter
+ m_MeasurementLoggingFilterXML->StartRecording();
+ m_MeasurementLoggingFilterCSV->StartRecording();
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceLoggingFilterXML->StartRecording();
+ m_ReferenceLoggingFilterCSV->StartRecording();
+ }
+
+ //disable all buttons
+ DisableAllButtons();
+
+ //update label next measurement
+ std::stringstream label;
+ if ((m_NextFile + 1) >= m_FilenameVector.size()) label << "Next Measurement: ";
+ else label << "Next Measurement: " << m_FilenameVector.at(m_NextFile + 1);
+ m_Controls->m_NextMeasurement->setText(label.str().c_str());
+
+ //update label last measurement
+ std::stringstream label2;
+ label2 << "Last Measurement: " << m_FilenameVector.at(m_NextFile);
+ m_Controls->m_LastMeasurement->setText(label2.str().c_str());
+
+ m_NextFile++;
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::RepeatLastMeasurement()
+{
+ m_NextFile--;
+ StartNextMeasurement();
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::MessageBox(std::string s)
+{
+ QMessageBox msgBox;
+ msgBox.setText(s.c_str());
+ msgBox.exec();
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::DisableAllButtons()
+{
+ m_Controls->m_LoadList->setEnabled(false);
+ m_Controls->m_StartNextMeasurement->setEnabled(false);
+ m_Controls->m_ReapeatLastMeasurement->setEnabled(false);
+ m_Controls->m_SamplingRate->setEnabled(false);
+ m_Controls->m_SamplesPerMeasurement->setEnabled(false);
+ m_Controls->m_ReferenceThreshold->setEnabled(false);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::EnableAllButtons()
+{
+ m_Controls->m_LoadList->setEnabled(true);
+ m_Controls->m_StartNextMeasurement->setEnabled(true);
+ m_Controls->m_ReapeatLastMeasurement->setEnabled(true);
+ m_Controls->m_SamplingRate->setEnabled(true);
+ m_Controls->m_SamplesPerMeasurement->setEnabled(true);
+ m_Controls->m_ReferenceThreshold->setEnabled(true);
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::FinishMeasurement()
+{
+ m_logging = false;
+
+ m_MeasurementLoggingFilterXML->StopRecording();
+ m_MeasurementLoggingFilterCSV->StopRecording();
+ if (m_Controls->m_UseReferenceTrackingSystem->isChecked())
+ {
+ m_ReferenceLoggingFilterXML->StopRecording();
+ m_ReferenceLoggingFilterCSV->StopRecording();
+ }
+ StopLoggingAdditionalCSVFile();
+
+ int id = m_NextFile - 1;
+ mitk::Point3D positionMean = m_EvaluationFilter->GetPositionMean(0);
+ MITK_INFO << "Evaluated " << m_EvaluationFilter->GetNumberOfAnalysedNavigationData(0) << " samples.";
+ double rms = m_EvaluationFilter->GetPositionErrorRMS(0);
+ MITK_INFO << "RMS: " << rms;
+ MITK_INFO << "Position Mean: " << positionMean;
+ m_MeanPoints->SetPoint(id, positionMean);
+ if (m_RMSValues.size() <= id) m_RMSValues.push_back(rms);
+ else m_RMSValues[id] = rms;
+
+ m_EvaluationFilter->ResetStatistic();
+
+ EnableAllButtons();
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::StartLoggingAdditionalCSVFile(std::string filePostfix)
+{
+ //write logfile header
+ QString header = "Nr;MITK_Time;Valid_Reference;";
+ QString tool = QString("MeasureTool_") + QString(m_MeasurementTrackingDeviceSource->GetOutput(0)->GetName());
+ header = header + tool + "[x];" + tool + "[y];" + tool + "[z];" + tool + "[qx];" + tool + "[qy];" + tool + "[qz];" + tool + "[qr]\n";
+
+ //open logfile and write header
+ m_logFileCSV.open(std::string(m_Controls->m_OutputPath->text().toUtf8()).append("/LogFileCombined").append(filePostfix.c_str()).append(".csv").c_str(), std::ios::out);
+ m_logFileCSV << header.toStdString().c_str();
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::LogAdditionalCSVFile()
+{
+ mitk::Point3D pos = m_MeasurementTrackingDeviceSource->GetOutput(0)->GetPosition();
+ mitk::Quaternion rot = m_MeasurementTrackingDeviceSource->GetOutput(0)->GetOrientation();
+ std::string valid = "";
+ if (m_referenceValid) valid = "true";
+ else valid = "false";
+ std::stringstream timestamp;
+ timestamp << m_MeasurementTrackingDeviceSource->GetOutput(0)->GetTimeStamp();
+ QString dataSet = QString::number(m_loggedFrames) + ";" + QString(timestamp.str().c_str()) + ";" + QString(valid.c_str()) + ";" + QString::number(pos[0]) + ";" + QString::number(pos[1]) + ";" + QString::number(pos[2]) + ";" + QString::number(rot.x()) + ";" + QString::number(rot.y()) + ";" + QString::number(rot.z()) + ";" + QString::number(rot.r()) + "\n";
+ m_logFileCSV << dataSet.toStdString();
+}
+
+void QmitkIGTTrackingSemiAutomaticMeasurementView::StopLoggingAdditionalCSVFile()
+{
+ m_logFileCSV.close();
+}
+
+bool QmitkIGTTrackingSemiAutomaticMeasurementView::eventFilter(QObject *obj, QEvent *ev)
+{
+ if (ev->type() == QEvent::KeyPress)
+ {
+ QKeyEvent *k = (QKeyEvent *)ev;
+ bool up = false;
+ bool down = false;
+ if (k->key() == 16777238) up = true; //page up
+ else if (k->key() == 16777239) down = true; //page down
+
+ if (down && m_tracking && !m_logging)
+ {
+ StartNextMeasurement();
+ }
+ }
+
+ return false;
+}
diff --git a/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
new file mode 100644
index 0000000000..85fe08d498
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
@@ -0,0 +1,133 @@
+/*=========================================================================
+
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+#ifndef QmitkIGTTrackingSemiAutomaticMeasurementView_h
+#define QmitkIGTTrackingSemiAutomaticMeasurementView_h
+
+#include
+
+#include
+
+//QT
+#include
+
+//MITK
+#include
+#include
+#include
+#include
+#include
+
+#include "ui_QmitkIGTTrackingSemiAutomaticMeasurementViewControls.h"
+
+/*!
+ \brief QmitkIGTTrackingSemiAutomaticMeasurementView
+
+ \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
+
+ \sa QmitkFunctionality
+ \ingroup Functionalities
+ */
+class QmitkIGTTrackingSemiAutomaticMeasurementView : public QmitkFunctionality
+{
+ // this is needed for all Qt objects that should have a Qt meta-object
+ // (everything that derives from QObject and wants to have signal/slots)
+ Q_OBJECT
+
+public:
+
+ static const std::string VIEW_ID;
+
+ QmitkIGTTrackingSemiAutomaticMeasurementView();
+ virtual ~QmitkIGTTrackingSemiAutomaticMeasurementView();
+
+ virtual void CreateQtPartControl(QWidget *parent);
+
+ virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget &stdMultiWidget);
+ virtual void StdMultiWidgetNotAvailable();
+
+ protected slots:
+
+ void OnLoadMeasurementStorage();
+ void OnLoadReferenceStorage();
+ void OnStartTracking();
+ void OnStopTracking();
+ void OnMeasurementLoadFile();
+ void OnSetReference();
+ void StartNextMeasurement();
+ void RepeatLastMeasurement();
+ void UpdateTimer();
+ void CreateResults();
+ void OnUseReferenceToggled(bool state);
+
+protected:
+
+ Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls* m_Controls;
+
+ QmitkStdMultiWidget* m_MultiWidget;
+
+ //the tool storages
+ mitk::NavigationToolStorage::Pointer m_MeasurementStorage;
+ mitk::NavigationToolStorage::Pointer m_ReferenceStorage;
+
+ //members for the filter pipeline
+ mitk::TrackingDeviceSource::Pointer m_MeasurementTrackingDeviceSource;
+ mitk::NavigationDataObjectVisualizationFilter::Pointer m_MeasurementToolVisualizationFilter;
+ mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterXML;
+ mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterCSV;
+ mitk::TrackingDeviceSource::Pointer m_ReferenceTrackingDeviceSource;
+ mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterXML;
+ mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterCSV;
+
+ //members for file name list
+ std::vector m_FilenameVector;
+ int m_NextFile;
+
+ //help methods
+ mitk::NavigationToolStorage::Pointer ReadStorage(std::string file);
+ void MessageBox(std::string s);
+ void DisableAllButtons();
+ void EnableAllButtons();
+ void FinishMeasurement();
+ void StartLoggingAdditionalCSVFile(std::string filePostfix);
+ void LogAdditionalCSVFile();
+ void StopLoggingAdditionalCSVFile();
+
+ //timer
+ QTimer* m_Timer;
+
+ //memebers for reference checking
+ std::vector m_ReferenceStartPositions;
+ bool m_referenceValid;
+
+ //logging members
+ int m_loggedFrames;
+ bool m_logging;
+ std::fstream m_logFileCSV;
+
+ //event filter for key presses
+ bool eventFilter(QObject *obj, QEvent *ev);
+
+ //results members
+ mitk::PointSet::Pointer m_MeanPoints;
+ std::vector m_RMSValues;
+ mitk::NavigationDataEvaluationFilter::Pointer m_EvaluationFilter;
+
+ bool m_tracking;
+};
+
+#endif // _QMITKIGTTRACKINGSEMIAUTOMATICMEASUREMENTVIEW_H_INCLUDED
diff --git a/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui
new file mode 100644
index 0000000000..50168cb767
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementViewControls.ui
@@ -0,0 +1,555 @@
+
+
+ QmitkIGTTrackingSemiAutomaticMeasurementViewControls
+
+
+
+ 0
+ 0
+ 419
+ 931
+
+
+
+
+ 0
+ 0
+
+
+
+ QmitkTemplate
+
+
+ -
+
+
+ 0
+
+
+
+ Tracking Initialization
+
+
+
-
+
+
+ Measurement Tracking System
+
+
+
-
+
+
+ -
+
+
-
+
+
+ Tool Storage: <none>
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Load Tool Storage
+
+
+
+
+
+
+
+
+ -
+
+
+ Reference Trackingsystem
+
+
+
-
+
+
+ -
+
+
-
+
+
+ Tool Storage: <none>
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Load Tool Storage
+
+
+
+
+
+
+
+
+ -
+
+
+ Start Tracking
+
+
+
+ -
+
+
+ Stop Tracking
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+ Measurement
+
+
+ -
+
+
+ Measurement List:
+
+
+
+ -
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Load List
+
+
+
+
+
+ -
+
+
-
+
+
+ Output Path:
+
+
+
+ -
+
+
+ C:/temp/
+
+
+
+
+
+ -
+
+
+ Last Measurement: <none>
+
+
+
+ -
+
+
+ Next Measurement: <none>
+
+
+
+ -
+
+
+ Collected Samples: <none>
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 200
+ 0
+
+
+
+ Start Next Measurement
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 200
+ 0
+
+
+
+ Repeat Last Measurement
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 200
+ 0
+
+
+
+ Create Results
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 281
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600; text-decoration: underline;">Measurement Sensors:</span></p></body></html>
+
+
+
+ -
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600; text-decoration: underline;">Reference Sensors:</span></p></body></html>
+
+
+
+ -
+
+
+ Set Reference
+
+
+
+ -
+
+
+ Reference Postion: <none>
+
+
+
+ -
+
+
+ Current Positions: <none>
+
+
+
+ -
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:28pt; font-weight:600;">OK</span></p></body></html>
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+ Settings
+
+
+ -
+
+
-
+
+
+ Sampling Rate (Times Per Second):
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 999.000000000000000
+
+
+ 15.000000000000000
+
+
+
+
+
+ -
+
+
-
+
+
+ Samples Per Measurement:
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 1000
+
+
+ 150
+
+
+
+
+
+ -
+
+
-
+
+
+ Threshold For Reference Tools:
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 1.000000000000000
+
+
+
+
+
+ -
+
+
+ Use Reference Tracking System
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
+
+
+
+
+ QmitkToolTrackingStatusWidget
+ QWidget
+ QmitkToolTrackingStatusWidget.h
+ 1
+
+
+ QmitkTrackingDeviceConfigurationWidget
+ QWidget
+ QmitkTrackingDeviceConfigurationWidget.h
+ 1
+
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.cpp
new file mode 100644
index 0000000000..b1ca328364
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.cpp
@@ -0,0 +1,38 @@
+/*=========================================================================
+
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+#include "mitkPluginActivator.h"
+
+#include
+
+#include "QmitkIGTTrackingSemiAutomaticMeasurementView.h"
+
+namespace mitk {
+ void PluginActivator::start(ctkPluginContext* context)
+ {
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkIGTTrackingSemiAutomaticMeasurementView, context)
+ }
+
+ void PluginActivator::stop(ctkPluginContext* context)
+ {
+ Q_UNUSED(context)
+ }
+}
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+Q_EXPORT_PLUGIN2(org_mitk_gui_qt_igttrackingsemiautomaticmeasurement, mitk::PluginActivator)
+#endif
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.h
new file mode 100644
index 0000000000..f1bb717002
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.igttrackingsemiautomaticmeasurement/src/internal/mitkPluginActivator.h
@@ -0,0 +1,44 @@
+/*=========================================================================
+
+Program: Medical Imaging & Interaction Toolkit
+Language: C++
+Date: $Date$
+Version: $Revision$
+
+Copyright (c) German Cancer Research Center, Division of Medical and
+Biological Informatics. All rights reserved.
+See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
+
+This software is distributed WITHOUT ANY WARRANTY; without even
+the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+
+
+#ifndef MITKPLUGINACTIVATOR_H
+#define MITKPLUGINACTIVATOR_H
+
+#include
+
+namespace mitk {
+
+class PluginActivator :
+ public QObject, public ctkPluginActivator
+{
+ Q_OBJECT
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_igttrackingsemiautomaticmeasurement")
+ #endif
+ Q_INTERFACES(ctkPluginActivator)
+
+public:
+
+ void start(ctkPluginContext* context);
+ void stop(ctkPluginContext* context);
+
+}; // PluginActivator
+
+}
+
+#endif // MITKPLUGINACTIVATOR_H