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
mitkMicronTrackerTypeInformation.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 
20 
21 namespace mitk
22 {
24  {
25  return "Claron Micron";
26  }
27 
29  {
30  TrackingDeviceData data = { MicronTrackerTypeInformation::GetTrackingDeviceName(), "Micron Tracker H40", "ClaronMicron.stl", "X" };
31  return data;
32  }
33 
35  {
38  }
39 
41  {
42  }
43 
45  mitk::TrackingDevice::Pointer trackingDevice,
47  std::string* errorMessage,
48  std::vector<int>* toolCorrespondencesInToolStorage)
49  {
51  mitk::ClaronTrackingDevice::Pointer thisDevice = dynamic_cast<mitk::ClaronTrackingDevice*>(trackingDevice.GetPointer());
52  *toolCorrespondencesInToolStorage = std::vector<int>();
53  //add the tools to the tracking device
54  for (int i = 0; i < navigationTools->GetToolCount(); i++)
55  {
56  mitk::NavigationTool::Pointer thisNavigationTool = navigationTools->GetTool(i);
57  toolCorrespondencesInToolStorage->push_back(i);
58  bool toolAddSuccess = thisDevice->AddTool(thisNavigationTool->GetToolName().c_str(), thisNavigationTool->GetCalibrationFile().c_str());
59  if (!toolAddSuccess)
60  {
61  //todo error handling
62  errorMessage->append("Can't add tool, is the toolfile valid?");
63  return NULL;
64  }
65  thisDevice->GetTool(i)->SetToolTip(thisNavigationTool->GetToolTipPosition(), thisNavigationTool->GetToolTipOrientation());
66  }
67  returnValue->SetTrackingDevice(thisDevice);
68  return returnValue;
69  }
70 }
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
virtual TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice, mitk::NavigationToolStorage::Pointer navigationTools, std::string *errorMessage, std::vector< int > *toolCorrespondencesInToolStorage) override
An object of this class represents the MicronTracker device. You can add tools to this device...
std::vector< TrackingDeviceData > m_TrackingDeviceData