MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkOpenIGTLinkTypeInformation.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14
16
17namespace mitk
18{
20 {
21 return "Open IGT Link Connection";
22 }
23
28
34
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}
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...
static TrackingDeviceData GetDeviceDataOpenIGTLinkTrackingDeviceConnection()
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice, mitk::NavigationToolStorage::Pointer navigationTools, std::string *errorMessage, std::vector< int > *) override
std::vector< TrackingDeviceData > m_TrackingDeviceData
IGT Exceptions.