Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
Medical Imaging Interaction Toolkit
mitkNDIPolarisTypeInformation.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include "mitkNDITrackingDevice.h"
16 
17 namespace mitk
18 {
20  {
21  return "NDI Polaris";
22  }
24  {
25  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris (Old Model)", "NDIPolarisOldModel.stl", "0" };
26  return data;
27  }
29  {
30  //full hardware code of polaris spectra: 5-240000-153200-095000+057200+039800+056946+024303+029773+999999+99999924
31  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Spectra", "NDIPolarisSpectra.stl", "5-2" };
32  return data;
33  }
34 
36  {
37  //full hardware code of polaris spectra (extended pyramid): 5-300000-153200-095000+057200+039800+056946+024303+029773+999999+07350024
38  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Spectra (Extended Pyramid)", "NDIPolarisSpectraExtendedPyramid.stl", "5-3" };
39  return data;
40  }
42  {
43  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Vicra", "NDIPolarisVicra.stl", "7" };
44  return data;
45  }
46 
48  {
54  }
55 
57  {
58  }
59 
60  mitk::TrackingDeviceSource::Pointer NDIPolarisTypeInformation::CreateTrackingDeviceSource(
61  mitk::TrackingDevice::Pointer trackingDevice,
62  mitk::NavigationToolStorage::Pointer navigationTools,
63  std::string* errorMessage,
64  std::vector<int>* toolCorrespondencesInToolStorage)
65  {
66  mitk::TrackingDeviceSource::Pointer returnValue = mitk::TrackingDeviceSource::New();
67  mitk::NDITrackingDevice::Pointer thisDevice = dynamic_cast<mitk::NDITrackingDevice*>(trackingDevice.GetPointer());
68  *toolCorrespondencesInToolStorage = std::vector<int>();
69  //add the tools to the tracking device
70  for (unsigned int i = 0; i < navigationTools->GetToolCount(); i++)
71  {
72  mitk::NavigationTool::Pointer thisNavigationTool = navigationTools->GetTool(i);
73  toolCorrespondencesInToolStorage->push_back(i);
74  bool toolAddSuccess = thisDevice->AddTool(thisNavigationTool->GetToolName().c_str(), thisNavigationTool->GetCalibrationFile().c_str());
75  if (!toolAddSuccess)
76  {
77  //todo: error handling
78  errorMessage->append("Can't add tool, is the SROM-file valid?");
79  return nullptr;
80  }
81  thisDevice->GetTool(i)->SetToolTipPosition(thisNavigationTool->GetToolTipPosition(), thisNavigationTool->GetToolAxisOrientation());
82  }
83  returnValue->SetTrackingDevice(thisDevice);
84  return returnValue;
85  }
86 }
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice, mitk::NavigationToolStorage::Pointer navigationTools, std::string *errorMessage, std::vector< int > *toolCorrespondencesInToolStorage) override
DataCollection - Class to facilitate loading/accessing structured data.
static TrackingDeviceData GetDeviceDataSpectraExtendedPyramid()
static TrackingDeviceData GetDeviceDataPolarisSpectra()
static TrackingDeviceData GetDeviceDataPolarisVicra()
std::vector< TrackingDeviceData > m_TrackingDeviceData
superclass for specific NDI tracking Devices that use serial communication.
static TrackingDeviceData GetDeviceDataPolarisOldModel()