Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 (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 
16 
17 namespace mitk
18 {
20  {
21  return "Open IGT Link Connection";
22  }
23 
25  TrackingDeviceData data = { OpenIGTLinkTypeInformation::GetTrackingDeviceName(), "OpenIGTLink Tracking Device", "cube", "X" };
26  return data;
27  }
28 
30  {
33  }
34 
36  {
37  }
38 
39  mitk::TrackingDeviceSource::Pointer OpenIGTLinkTypeInformation::CreateTrackingDeviceSource(
40  mitk::TrackingDevice::Pointer trackingDevice,
41  mitk::NavigationToolStorage::Pointer navigationTools,
42  std::string* errorMessage,
43  std::vector<int>* /*toolCorrespondencesInToolStorage*/)
44  {
45  mitk::TrackingDeviceSource::Pointer returnValue = mitk::TrackingDeviceSource::New();
46  mitk::OpenIGTLinkTrackingDevice::Pointer thisDevice = dynamic_cast<mitk::OpenIGTLinkTrackingDevice*>(trackingDevice.GetPointer());
47  thisDevice->DiscoverTools();
48  if (thisDevice->GetToolCount() != navigationTools->GetToolCount())
49  {
50  errorMessage->append("The number of tools in the connected device differs from the tool storage, cannot add tools.");
51  return nullptr;
52  }
53  returnValue->SetTrackingDevice(thisDevice);
54  return returnValue;
55  }
56 }
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