Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include "mitkNDITrackingDevice.h"
20 
21 namespace mitk
22 {
24  {
25  return "NDI Polaris";
26  }
28  {
29  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris (Old Model)", "NDIPolarisOldModel.stl", "0" };
30  return data;
31  }
33  {
34  //full hardware code of polaris spectra: 5-240000-153200-095000+057200+039800+056946+024303+029773+999999+99999924
35  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Spectra", "NDIPolarisSpectra.stl", "5-2" };
36  return data;
37  }
38 
40  {
41  //full hardware code of polaris spectra (extended pyramid): 5-300000-153200-095000+057200+039800+056946+024303+029773+999999+07350024
42  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Spectra (Extended Pyramid)", "NDIPolarisSpectraExtendedPyramid.stl", "5-3" };
43  return data;
44  }
46  {
47  TrackingDeviceData data = { NDIPolarisTypeInformation::GetTrackingDeviceName(), "Polaris Vicra", "NDIPolarisVicra.stl", "7" };
48  return data;
49  }
50 
52  {
58  }
59 
61  {
62  }
63 
65  mitk::TrackingDevice::Pointer trackingDevice,
67  std::string* errorMessage,
68  std::vector<int>* toolCorrespondencesInToolStorage)
69  {
71  mitk::NDITrackingDevice::Pointer thisDevice = dynamic_cast<mitk::NDITrackingDevice*>(trackingDevice.GetPointer());
72  *toolCorrespondencesInToolStorage = std::vector<int>();
73  //add the tools to the tracking device
74  for (int i = 0; i < navigationTools->GetToolCount(); i++)
75  {
76  mitk::NavigationTool::Pointer thisNavigationTool = navigationTools->GetTool(i);
77  toolCorrespondencesInToolStorage->push_back(i);
78  bool toolAddSuccess = thisDevice->AddTool(thisNavigationTool->GetToolName().c_str(), thisNavigationTool->GetCalibrationFile().c_str());
79  if (!toolAddSuccess)
80  {
81  //todo: error handling
82  errorMessage->append("Can't add tool, is the SROM-file valid?");
83  return NULL;
84  }
85  thisDevice->GetTool(i)->SetToolTip(thisNavigationTool->GetToolTipPosition(), thisNavigationTool->GetToolTipOrientation());
86  }
87  returnValue->SetTrackingDevice(thisDevice);
88  return returnValue;
89  }
90 }
itk::SmartPointer< Self > Pointer
virtual 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()