Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkNavigationToolStorageTestHelper.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  #include <mitkIOUtil.h>
22 
24  {
25  //create Tool Storage
27  //first tool
29  myTool1->SetIdentifier("001");
30  myStorage->AddTool(myTool1);
31  //second tool
33  myTool2->SetIdentifier("002");
34  myStorage->AddTool(myTool2);
35  //third tool
37  myTool3->SetIdentifier("003");
38  myStorage->AddTool(myTool3);
39 
40  return myStorage;
41  }
42 
44  {
45  //create Tool Storage
47 
48  //first tool
50  myTool1->SetIdentifier("001");
52  mitk::Point3D testPt1;
53  mitk::FillVector3D(testPt1,1,2,3);
54  CalLandmarks1->SetPoint(0,testPt1);
56  mitk::Point3D testPt2;
57  mitk::FillVector3D(testPt2,4,5,6);
58  RegLandmarks1->SetPoint(5,testPt2);
59  myTool1->SetToolCalibrationLandmarks(CalLandmarks1);
60  myTool1->SetToolRegistrationLandmarks(RegLandmarks1);
61  mitk::Point3D toolTipPos;
62  mitk::FillVector3D(toolTipPos,1.3423,2.323,4.332);
63  mitk::Quaternion toolTipRot = mitk::Quaternion(0.1,0.2,0.3,0.4);
64  myTool1->SetToolTipPosition(toolTipPos);
65  myTool1->SetToolTipOrientation(toolTipRot);
66  myStorage->AddTool(myTool1);
67 
68  return myStorage;
69  }
70 
71  mitk::NavigationToolStorage::Pointer mitk::NavigationToolStorageTestHelper::CreateTestData_ComplexStorage(std::string toolFilePath, std::string toolSurfacePath1, std::string toolSurfacePath2)
72  {
73  //create first tool
75  myNavigationTool->SetCalibrationFile(toolFilePath);
77  myNode->SetName("ClaronTool");
78  myNode->SetData(mitk::IOUtil::LoadSurface(toolSurfacePath1)); //load an stl File
79  myNavigationTool->SetDataNode(myNode);
80  myNavigationTool->SetIdentifier("ClaronTool#1");
81  myNavigationTool->SetSerialNumber("0815");
82  myNavigationTool->SetTrackingDeviceType(mitk::MicronTrackerTypeInformation::GetTrackingDeviceName());
83  myNavigationTool->SetType(mitk::NavigationTool::Fiducial);
84 
85  //create second tool
87  mitk::Surface::Pointer testSurface2;
88 
90  myNode2->SetName("AuroraTool");
91 
92  //load an stl File
93  testSurface2 = mitk::IOUtil::LoadSurface(toolSurfacePath2);
94  myNode2->SetData(testSurface2);
95 
96  myNavigationTool2->SetDataNode(myNode2);
97  myNavigationTool2->SetIdentifier("AuroraTool#1");
98  myNavigationTool2->SetSerialNumber("0816");
99  myNavigationTool2->SetTrackingDeviceType(mitk::NDIAuroraTypeInformation::GetTrackingDeviceName());
100  myNavigationTool2->SetType(mitk::NavigationTool::Instrument);
101 
102  //create navigation tool storage
104  myStorage->AddTool(myNavigationTool);
105  myStorage->AddTool(myNavigationTool2);
106 
107  return myStorage;
108  }
static mitk::NavigationToolStorage::Pointer CreateTestData_SimpleStorage()
static mitk::Surface::Pointer LoadSurface(const std::string &path)
LoadSurface Convenience method to load an arbitrary mitkSurface.
Definition: mitkIOUtil.cpp:608
itk::SmartPointer< Self > Pointer
static Pointer New()
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
Definition: mitkArray.h:110
static Pointer New()
static mitk::NavigationToolStorage::Pointer CreateTestData_ComplexStorage(std::string toolFilePath, std::string toolSurfacePath1, std::string toolSurfacePath2)
vnl_quaternion< ScalarType > Quaternion
static Pointer New()
Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have t...
static Pointer New()
static mitk::NavigationToolStorage::Pointer CreateTestData_StorageWithOneTool()