Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOpenIGTLinkTypeInformation.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 "Open IGT Link Connection";
26  }
27 
29  TrackingDeviceData data = { OpenIGTLinkTypeInformation::GetTrackingDeviceName(), "OpenIGTLink Tracking Device", "cube", "X" };
30  return data;
31  }
32 
34  {
37  }
38 
40  {
41  }
42 
44  mitk::TrackingDevice::Pointer trackingDevice,
46  std::string* errorMessage,
47  std::vector<int>* /*toolCorrespondencesInToolStorage*/)
48  {
50  mitk::OpenIGTLinkTrackingDevice::Pointer thisDevice = dynamic_cast<mitk::OpenIGTLinkTrackingDevice*>(trackingDevice.GetPointer());
51  thisDevice->DiscoverTools();
52  if (thisDevice->GetToolCount() != navigationTools->GetToolCount())
53  {
54  errorMessage->append("The number of tools in the connected device differs from the tool storage, cannot add tools.");
55  return NULL;
56  }
57  returnValue->SetTrackingDevice(thisDevice);
58  return returnValue;
59  }
60 }
itk::SmartPointer< Self > Pointer
virtual TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice, mitk::NavigationToolStorage::Pointer navigationTools, std::string *errorMessage, std::vector< int > *) override
An object of this class represents the MicronTracker device. You can add tools to this device...
bool DiscoverTools(int WaitingTime=10000)
Discover the tools available from the connected OpenIGTLink device and adds these tools to this track...
DataCollection - Class to facilitate loading/accessing structured data.
static TrackingDeviceData GetDeviceDataOpenIGTLinkTrackingDeviceConnection()
std::vector< TrackingDeviceData > m_TrackingDeviceData