diff --git a/Modules/IGT/Documentation/doxygen/IGTTutorialStep1.dox b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1.dox index 235ded774f..d752512557 100644 --- a/Modules/IGT/Documentation/doxygen/IGTTutorialStep1.dox +++ b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1.dox @@ -1,64 +1,70 @@ /** \page IGTTutorialStepFilterPipeline IGT filter pipeline The IGT tutorial consists of four main parts for construction of a small navigation pipeline using a virtual tracking device. The virtual tracking device produces random tool data (position and orientation) so no additional hardware is required. +The full code of this small navigation pipeline included in this tutorial can be found in MITK-Source/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp. +At the very end of this page, you can find build instructions on how to run this example on your computer. \snippet mitkIGTTutorialStep1.cpp What we will do -\section sec1 In Tracking Layer +\section sec1 Tracking Layer Firstly a new object "tracker" of the type mitk::VirtualTrackingDevice is created, then two tools, named "tool1" and "tool2", -are added to this "tracker". Since, the tracking device "tracker" is treated as a virtual tracking -device "tool1" and "tool2" are just added to the object by method AddTool(name). +are added to this tracker. Since the tracking device "tracker" is treated as a virtual tracking +device, tool1 and tool2 are just added to the object by method AddTool(name) and don't need further specification (e.g. real tools might need a calibration file). \snippet mitkIGTTutorialStep1.cpp Part I Basic 1 -\section sec2 In Navigation Layer +\section sec2 Navigation Layer \imageMacro{IGTTutorialStep1.png,"",15.90} Secondly, a new source of the type mitk::TrackingDeviceSource has to be created with outputs for each single tool of a tracker. The source sets the following tracking device by using method SetTrackingDevice as shown below. So now, the source is initialized with the virtual tracking device. Next, the source is connected and tracking is started. \snippet mitkIGTTutorialStep1.cpp Part I Basic 2 In part II, a displacemt filter (object "displacer") is constructed to change the positions of the filtered NavigationData objects -with an offset for each direction (X,Y,Z). The given filter has inputs and outputs for each tool, in this example we have 2 tools, hence there exists two inputs and outputs. Every output of the displacement filter object is connected to the recorder object in the next part. +with an offset for each direction (X,Y,Z). The given filter has inputs and outputs for each tool, in this example we have two tools. Hence, there exist two inputs and outputs. Every output of the displacement filter object is connected to the recorder object in the next part. -\snippet mitkIGTTutorialStep1.cpp Part II: Create a NavigationDataToNavigationDataFilter +\snippet mitkIGTTutorialStep1.cpp Part II + +\section sec3 Record Navigation Data In part III, all the NavigationData is recorded with the NavigationDataRecorder. In order to record, we simply create an object "recorder" of the type mitk::NavigationDataRecorder and set the appropriate file to it. Now the displacer object is connected to the -recorder object for every output by using a for-loop in the code, the method StartRecording() is called on the next line. Afterwards, +recorder object, the method StartRecording() is called on the next line. Afterwards, the recorder has to be updated a couple of times. In this example the recorder is updating 100 times through -the second for-loop statement in part III. This can also be seen as a simulation of a timer by using a for-loop. +a for-loop statement. This can also be seen as a simulation of a timer by using a for-loop. \snippet mitkIGTTutorialStep1.cpp Part III: Record the data with the NavigationDataRecorder -Part IV explains how the recoded file can be played for further use. After the object "player" of a type mitk::NavigationDataPlayer +\section sec4 Play Navigation Data + +Part IV explains how the recoded file can be played for further use. After the object "player" of a type mitk::NavigationDataSequentialPlayer is created, the required file has to be set to the player and playing has to be started. Here, there exists a new pipeline which functions by reading the recorded file from the harddisc and plays it by using the player as source. During the play, the for-loop makes the file update as in part III. \imageMacro{IGTTutorialStep1-2.png,"",9.53} \snippet mitkIGTTutorialStep1.cpp Part IV: Play the data with the NavigationDataPlayer -The full code of small navigation pipeline is shown below and can be found in MITK-Source/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp. +\section IGTTutStep1Build IGT Example Build Instructions -This tutorial is an extra target which can be build separately. +This tutorial is an extra target which can be build separately. Make sure, you selected the Navigation option in cmake during your superbuild (set MITK_BUILD_CONFIGURATION to mitkNavigation modules) or select the MITK_BUILD_org.mitk.gui.qt.igtexamples on your MITK-build and make sure that all dependencies are build. - Visual Studio: Right click in your solution explorer on MITKIGTTutorialStep1 --> Set as start up project --> build & Start without debugging + Visual Studio: Right click in your solution explorer on MITKIGTTutorialStep1 --> Set as start up project --> build & Start without debugging. A new window will open. +\imageMacro{IGTTutorialStep1_buildInstrWindows.png,"",5} + Qt creator: Select MITKIGTTutorialStep1 as Project (see screenshot below) and build and run the project. The output can be found in the QT creator console. +\imageMacro{IGTTutorialStep1_buildInstrLinux.png,"",5} Your output should look similar to this: \imageMacro{IGTTutorialStep1_output.png,"",9.53} - - - \ref Return to the \ref IGTTutorialOverview "[IGT Tutorial Overview]" */ \ No newline at end of file diff --git a/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrLinux.png b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrLinux.png new file mode 100644 index 0000000000..74f9aded61 Binary files /dev/null and b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrLinux.png differ diff --git a/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrWindows.png b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrWindows.png new file mode 100644 index 0000000000..9fabf55312 Binary files /dev/null and b/Modules/IGT/Documentation/doxygen/IGTTutorialStep1_buildInstrWindows.png differ diff --git a/Modules/IGT/Documentation/doxygen/IGTTutorialStep2.dox b/Modules/IGT/Documentation/doxygen/IGTTutorialStep2.dox index 4f5fd6532a..2e6dd9ac2d 100644 --- a/Modules/IGT/Documentation/doxygen/IGTTutorialStep2.dox +++ b/Modules/IGT/Documentation/doxygen/IGTTutorialStep2.dox @@ -1,11 +1,9 @@ /** \page IGTTutorialStepVisualization IGT Visualization Filter and MITK Concepts The following code shows how to insert IGT tracking data into an mitk::DataStorage and render the data with the mitk::NavigationDataObjectVisualizationFilter in an mitk::RenderWindow. The full code is shown below and can be found in MITK-Source/Modules/IGT/Tutorial/mitkIGTTutorialStep2.cpp. -This tutorial is an extra target which can be build separately. - -\include mitkIGTTutorialStep2.cpp +This tutorial is an extra target which can be build separately (see \ref IGTTutStep1Build). \ref Return to the \ref IGTTutorialOverview "[IGT Tutorial Overview]" */ \ No newline at end of file diff --git a/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp b/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp index 8065f8392f..7e0470901e 100644 --- a/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp +++ b/Modules/IGT/Tutorial/mitkIGTTutorialStep1.cpp @@ -1,204 +1,204 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include "mitkNavigationDataDisplacementFilter.h" #include #include #include //##Documentation //## \brief A small console tutorial about MITK-IGT int main(int /*argc*/, char* /*argv*/[]) { + //The next line starts a snippet to display this code in the documentation. If you don't revise the documentation, don't remove it! //! [What we will do] //************************************************************************* // What we will do... //************************************************************************* //In this tutorial we build up a small navigation pipeline with a virtual tracking device //which produce random positions and orientation so no additional hardware is required. + // //The source of the pipeline is a TrackingDeviceSource object. This we connect to a simple //filter which just displaces the positions with an offset. After that we use a recorder - //to store this new positions and other information to disc in a XML file. After that we use + //to store this new positions and other information to disc in a XML file. After that, we use //another source (NavigationDataPlayer) to replay the recorded data. //! [What we will do] - //! [Part I Basic 1] //************************************************************************* // Part I: Basic initialization of the source and tracking device //************************************************************************* //First of all create a tracking device object and two tools for this "device". //Here we take the VirtualTrackingDevice. This is not a real tracking device it just delivers random //positions and orientations. You can use other/real tracking devices if you replace the following //code with different tracking devices, e.g. mitk::NDITrackingDevice. The tools represent the //sensors of the tracking device. The TrackingDevice fills the tools with data. std::cout << "Generating TrackingDevice ..." << std::endl; mitk::VirtualTrackingDevice::Pointer tracker = mitk::VirtualTrackingDevice::New(); tracker->AddTool("tool1"); tracker->AddTool("tool2"); //! [Part I Basic 1] //! [Part I Basic 2] //The tracking device object is used for the physical connection to the device. To use the //data inside of our tracking pipeline we need a source. This source encapsulate the tracking device //and provides objects of the type mitk::NavigationData as output. The NavigationData objects stores //position, orientation, if the data is valid or not and special error informations in a covariance //matrix. // //Typically the start of our pipeline is a TrackingDeviceSource. To work correct we have to set a //TrackingDevice object. Attention you have to set the tools before you set the whole TrackingDevice //object to the TrackingDeviceSource because the source need to know how many outputs should be //generated. std::cout << "Generating Source ..." << std::endl; mitk::TrackingDeviceSource::Pointer source = mitk::TrackingDeviceSource::New(); source->SetTrackingDevice(tracker); //here we set the device for the pipeline source source->Connect(); //here we connect to the tracking system //Note we do not call this on the TrackingDevice object source->StartTracking(); //start the tracking //Now the source generates outputs. //! [Part I Basic 2] - //! [Part II: Create a NavigationDataToNavigationDataFilter] + //! [Part II] //************************************************************************* // Part II: Create a NavigationDataToNavigationDataFilter //************************************************************************* //The next thing we do is using a NavigationDataToNavigationDataFilter. One of these filter is the //very simple NavigationDataDisplacementFilter. This filter just changes the positions of the input //NavigationData objects with an offset for each direction (X,Y,Z). The input of this filter is the //source and the output of this filter is the "displaced" input. std::cout << "Generating DisplacementFilter ..." << std::endl; mitk::NavigationDataDisplacementFilter::Pointer displacer = mitk::NavigationDataDisplacementFilter::New(); mitk::Vector3D offset; mitk::FillVector3D(offset, 10.0, 100.0, 1.0); //initialize the offset displacer->SetOffset(offset); //now set the offset in the NavigationDataDisplacementFilter object //Connect the two filters. You can use the ConnectTo method to automatically connect all outputs from one filter // to inputs from another filter. displacer->ConnectTo(source.GetPointer()); // Alternatively, you can manually connect inputs and outputs. // The code below shows what the ConnectTo Methods does internally: // //for (unsigned int i = 0; i < source->GetNumberOfOutputs(); i++) //{ // displacer->SetInput(i, source->GetOutput(i)); //here we connect to the displacement filter //} - //! [Part II: Create a NavigationDataToNavigationDataFilter] + //! [Part II] //! [Part III: Record the data with the NavigationDataRecorder] //************************************************************************* // Part III: Record the data with the NavigationDataRecorder //************************************************************************* //The next part of our pipeline is the recorder. The input of the recorder is the output of the displacement filter //and the output is a XML file with the name "Test Output-0.xml", which is written with a NavigationDataSetWriter. std::cout << "Start Recording ..." << std::endl; //we need the stringstream for building up our filename std::stringstream filename; - //the .xml extension and an counter is NOT added automatically anymore -- that was the case in an earlier version + //the .xml extension and an counter is NOT added automatically anymore -- that was the case in an earlier version filename << itksys::SystemTools::GetCurrentWorkingDirectory() << "/Test Output-0.xml"; std::cout << "Record to file: " << filename.str() << " ..." << std::endl; mitk::NavigationDataRecorder::Pointer recorder = mitk::NavigationDataRecorder::New(); //now the output of the displacer object is connected to the recorder object recorder->ConnectTo(displacer); recorder->StartRecording(); //after finishing the settings you can start the recording mechanism //now every update of the recorder stores one line into the file for //each added NavigationData for (unsigned int x = 0; x < 100; x++) //write 100 datasets { recorder->Update(); //the update causes one line in the XML file for every tool //in this case two lines itksys::SystemTools::Delay(100); //sleep a little } recorder->StopRecording(); //to get proper XML files you should stop recording //if your application crashes during recording no data //will be lost it is all stored to disc //The IO-System needs a filename. Otherwise the output //is redirected to the console. See MITK-Concepts page for more details on IO in MITK mitk::IOUtil::SaveBaseData(recorder->GetNavigationDataSet(), filename.str()); - //! [Part III: Record the data with the NavigationDataRecorder] //! [Part IV: Play the data with the NavigationDataPlayer] //************************************************************************* - // Part IV: Play the data with the NavigationDataPlayer + // Part IV: Play the data with the NavigationDataSequentialPlayer //************************************************************************* //The recording is finished now so now we can play the data. The NavigationDataPlayer is similar //to the TrackingDevice source. It also derives from NavigationDataSource. So you can use a player //instead of a TrackingDeviceSource. The input of this player is a NavigationDataSet, which we //read with a NavigationDataReader. std::cout << "Start playing from file: " << filename.str() << " ..." << std::endl; mitk::NavigationDataSequentialPlayer::Pointer player = mitk::NavigationDataSequentialPlayer::New(); mitk::NavigationDataSet::Pointer naviDataSet = dynamic_cast (mitk::IOUtil::LoadBaseData(filename.str()).GetPointer()); player->SetNavigationDataSet(naviDataSet); - //From now on the player provides NavigationDatas in a sequential order. The next position is given, as soon as "update" is called, so this player is not in real time. + //From now on, the player provides NavigationDatas in a sequential order. The next position is given, as soon as "update" is called, so this player is not in real time. //If you need the correct time of your tracking Data, use the NavigationDataPlayer instead and call "StartPlaying" and "StopPlaying". //this connects the outputs of the player to the NavigationData objects mitk::NavigationData::Pointer nd = player->GetOutput(); mitk::NavigationData::Pointer nd2 = player->GetOutput(1); - for (unsigned int x=0; x<100; x++) + for (unsigned int x = 0; x < 100; x++) { if (nd.IsNotNull()) //check if the output is not null { //With this call, we go to the next recorded data set. player->GoToNextSnapshot(); MITK_INFO << "Time Step " << x; - MITK_INFO<< "Tool 1:" << nd->GetPosition(); - MITK_INFO << "Tool 2:" << nd2->GetPosition() ; + MITK_INFO << "Tool 1:" << nd->GetPosition(); + MITK_INFO << "Tool 2:" << nd2->GetPosition(); itksys::SystemTools::Delay(100); //sleep a little like in the recorder part, just for nice reading... } } itksys::SystemTools::Delay(2000); std::cout << "finished" << std::endl; //! [Part IV: Play the data with the NavigationDataPlayer] -} +} \ No newline at end of file diff --git a/Modules/IGT/Tutorial/mitkIGTTutorialStep2.cpp b/Modules/IGT/Tutorial/mitkIGTTutorialStep2.cpp index b6f66b8059..d42d86a99c 100644 --- a/Modules/IGT/Tutorial/mitkIGTTutorialStep2.cpp +++ b/Modules/IGT/Tutorial/mitkIGTTutorialStep2.cpp @@ -1,152 +1,159 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include #include #include #include #include -/** - * \brief This tutorial shows how to compose navigation datas. Therefore we render two objects. - * The first object is a cone that is tracked. The second object is a cylinder at a fixed position - * relative to the cone. At the end of the tracking, the cylinder is moved to its new relative position - * according to the last output of the tracking device. - * In addition to IGT tutorial step 1, the objects are added to a datastorage. Furthermore, a renderwindow - * is used for visual output. - */ + +//The next line starts a snippet to display this code in the documentation. If you don't revise the documentation, don't remove it! +//! [What we will do] + +//************************************************************************* +// What we will do... +//************************************************************************* +// This tutorial shows how to compose navigation datas. Therefore we render two objects. +//The first object is a cone that is tracked. The second object is a cylinder at a fixed position +//relative to the cone. At the end of the tracking, the cylinder is moved to its new relative position +//according to the last output of the tracking device. +//In addition to IGT tutorial step 1, the objects are added to a datastorage. Furthermore, a renderwindow +//is used for visual output. + +//! [What we will do] int main(int argc, char* argv[]) { //General code rendering the data in a renderwindow. See MITK Tutorial Step1 for more details. mitk::StandaloneDataStorage::Pointer dataStorage = mitk::StandaloneDataStorage::New(); mitk::RenderWindow::Pointer renderWindow = mitk::RenderWindow::New(); mitk::DataNode::Pointer dataNode = mitk::DataNode::New(); //Here, we want a 3D renderwindow renderWindow->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D); - renderWindow->GetVtkRenderWindow()->SetSize( 500, 500 ); - renderWindow->GetRenderer()->Resize( 500, 500); + renderWindow->GetVtkRenderWindow()->SetSize(500, 500); + renderWindow->GetRenderer()->Resize(500, 500); //Connect datastorage and renderwindow renderWindow->GetRenderer()->SetDataStorage(dataStorage); // --------------begin of moving object code -------------------------- // //Virtual tracking device to generate random positions mitk::VirtualTrackingDevice::Pointer tracker = mitk::VirtualTrackingDevice::New(); //Bounds (within the random numbers are generated) must be set before the tools are added double bound = 10.0; - mitk::ScalarType bounds[] = {-bound, bound, -bound, bound, -bound, bound}; + mitk::ScalarType bounds[] = { -bound, bound, -bound, bound, -bound, bound }; tracker->SetBounds(bounds); tracker->AddTool("tool1"); //Tracking device source to get the data mitk::TrackingDeviceSource::Pointer source = mitk::TrackingDeviceSource::New(); source->SetTrackingDevice(tracker); source->Connect(); //Cone representation for rendering of the moving object mitk::Cone::Pointer cone = mitk::Cone::New(); dataNode->SetData(cone); dataNode->SetName("My tracked object"); dataNode->SetColor(0.0, 1.0, 1.0); dataStorage->Add(dataNode); //Filter for rendering the cone at correct postion and orientation mitk::NavigationDataObjectVisualizationFilter::Pointer visualizer = mitk::NavigationDataObjectVisualizationFilter::New(); visualizer->SetInput(0, source->GetOutput()); visualizer->SetRepresentationObject(0, cone); source->StartTracking(); // --------------end of moving object code -------------------------- // // --------------begin of fixed object code ------------------------- // //Cylinder representation for rendering of the fixed object mitk::DataNode::Pointer cylinderNode = mitk::DataNode::New(); mitk::Cylinder::Pointer cylinder = mitk::Cylinder::New(); cylinderNode->SetData(cylinder); cylinderNode->SetName("My fixed object"); cylinderNode->SetColor(1.0, 0.0, 0.0); dataStorage->Add(cylinderNode); //Define a rotation and a translation for the fixed object mitk::Matrix3D rotationMatrix; rotationMatrix.SetIdentity(); double alpha = 0.3; rotationMatrix[1][1] = cos(alpha); rotationMatrix[1][2] = -sin(alpha); rotationMatrix[2][1] = sin(alpha); rotationMatrix[2][2] = cos(alpha); mitk::Vector3D offset; offset.Fill(5.0); //Add rotation and translation to affine transform mitk::AffineTransform3D::Pointer affineTransform3D = mitk::AffineTransform3D::New(); affineTransform3D->SetOffset(offset); affineTransform3D->SetMatrix(rotationMatrix); //apply rotation and translation mitk::NavigationData::Pointer fixedNavigationData = mitk::NavigationData::New(affineTransform3D); cylinder->GetGeometry()->SetIndexToWorldTransform(fixedNavigationData->GetAffineTransform3D()); // --------------end of fixed object code ------------------------- // // Global reinit with the bounds of the virtual tracking device mitk::TimeGeometry::Pointer timeGeometry = dataStorage->ComputeBoundingGeometry3D(dataStorage->GetAll()); mitk::BaseGeometry::Pointer geometry = timeGeometry->GetGeometryForTimeStep(0); geometry->SetBounds(bounds); - mitk::RenderingManager::GetInstance()->InitializeViews( geometry ); + mitk::RenderingManager::GetInstance()->InitializeViews(geometry); //Generate and render 75 time steps to move the tracked object - for(int i=0; i < 75; ++i) + for (int i = 0; i < 75; ++i) { //Update the cone position visualizer->Update(); //Update rendering renderWindow->GetVtkRenderWindow()->Render(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); MITK_INFO << "Position " << source->GetOutput()->GetPosition(); //Slight delay for the random numbers itksys::SystemTools::Delay(100); } //Stop the tracking device and disconnect it //The tracking is done, now we want to move the fixed object to its correct relative position regarding the tracked object. source->StopTracking(); source->Disconnect(); //Now the tracking is finished and we can use the transformation to move //the fixed object to its correct position relative to the new position //of the moving/tracked object. Therefore, we compose the navigation datas. fixedNavigationData->Compose(source->GetOutput(), false); //Update the transformation matrix of the cylinder cylinder->GetGeometry()->SetIndexToWorldTransform(fixedNavigationData->GetAffineTransform3D()); //Update the rendering renderWindow->GetVtkRenderWindow()->Render(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); //Wait a little before closing the renderwindow itksys::SystemTools::Delay(2000); -} +} \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox index e1208f1de3..91713bc56b 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox +++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkMITKIGTTrackingToolbox.dox @@ -1,93 +1,93 @@ /** \page org_mitk_views_igttrackingtoolbox The MITK-IGT Tracking Toolbox \imageMacro{../resources/iconTrackingToolBox.png,"Icon of the MITK-IGT Tracking Toolbox",2.00} \tableofcontents \section QmitkMITKIGTTrackingToolboxIntroduction Introduction The MITK-IGT Tracking Toolbox is a view which allows you to connect to a tracking device, track and visualize navigation tools and write the tracked data into a log file. -This page gives an overview of the view and is at the same time part of the IGT tutorial step \ref IGTTutorialStepPluginIntroduction. All parts containing constructions +This page gives an overview of the view and is at the same time part of the IGT tutorial step \ref IGTTutorialStepPluginIntroduction. All parts containing instructions for the tutorial begin with the bold printed label Tutorial. \imageMacro{QmitkIGTTracking_ScreenshotMitk.png,"MITK Screenshot with the TrackingToolbox activated",16.00} \section QmitkMITKIGTTrackingToolboxWorkflow General workflow Introduction Currently the devices Polaris, Aurora (both Northern Digital Inc. (NDI); Waterloo, Ontario, Canada), MicronTracker (Claron Technology, Inc.; Toronto, Ontario, Canada) and Optitrack (NaturalPoint) are supported (see Hardware Tracking Device Support). Different tracking hardware can be used via OpenIGTLink connections (see \ref IGTTutorialStepOpenIGTLink "Open IGT Link tutorial" ). For this Tracking Toolbox tutorial, we will use a virtual tracking device, which allows you to use simulated tracking data. This is very helpful if you want to test or implement some tracking application and don't have the hardware always available. A general Workflow with the Tracking Toolbox may be:
  • Configuration of a tracking device
  • Adding or loading a toolfile which holds tool definitions
  • Start tracking
  • Logging tracked data
Tutorial: In the following sections, we will get familiar with each of these points using the Virtual Tracking Device. \section QmitkMITKIGTTrackingToolboxConnecting Tracking Device Configuration The tracking device can be specified in the tracking device configuration section located in the upper area of the tracking tab. As shown in the screenshot below, you choose your tracking device in the drop down menu. If you use a real tracking system, you might need to set some parameters like the serial port for Aurora or Polaris or the host name for your OpenIGTLink connection. Most implemented tracking device include an option to test your conection. Therefore you just need to press the button "test connection". The results are displayed in the small black box on the right. Tutorial: For a first introduction, please select the virtual tracking device in the drop-down-menu. You should see an option to add some jittering to the simulated data. \imageMacro{QmitkIGTTracking_ConfigurationWidget.png,"Tracking Device Configuration",8.55} \section Tracking Tools For tracking, you need information about your tools. You can either add single tools, load previously created tool storages or for some devices auto-detect all available tools. The best way to edit tools after creation/loading is \ref org_mitk_views_igtnavigationtoolmanager view. Creation of new tools or loading of existing tool storages can be done within the Tracking Tool Widget \imageMacro{QmitkIGTTracking_NavigationToolManagement_TrackingTools.png, "The tracking tool widget for adding or loading tools.",9.00} All added or loaded tools will then be displayed in grey as shown in the screenshot below. If you start tracking they will become green if the tools were found and red if they were not found inside the tracking volume. \imageMacro{QmitkIGTTracking_TrackingToolsWidget.png,"Added Tracking Tools",9.08} \subsection QmitkMITKIGTTrackingToolboxAddingTools Adding tools The most simple step to begin with is to add new tools with this widget. The same widget is also available within \ref org_mitk_views_igtnavigationtoolmanager view and the single parameters are explained there in more detail. \imageMacro{QmitkIGTTracking_NavigationToolManagementAddTool.png,"Adding a new tool", 9.00} Tutorial: Please click the "Add single tool" button and make sure, that the Virtual Tracker is selected in the drop-down-menu (the tracking device configured in the first step must always match your tools!). You might want to give your tool a new name in the "Basic Information" section and load a surface for visualization in the "Tool Visualization" section (a surface file can be found in your binary folder if you did compile MITK by yourself: MITK-superbuild\MITK-Data\IGT-Data\ClaronTool.stl). If you don't have any surface data, you can just select "use simple cone". Click on "Finished" and repeat this step to add a second tool. \subsection QmitkMITKIGTTrackingToolboxLoadingTools Loading tools To load tools which can be tracked you need a predefined tracking tool storage. You can use the MITK \ref org_mitk_views_igtnavigationtoolmanager view to define a navigation tool storage or to save the tools created within the last step in a toolstorage. Navigation tool storages can be loaded by pressing the button "Load Tools". Please ensure that the tracking device type of the tools matches the chosen tracking device, otherwise you will get an error message if you try to start tracking. \subsection QmitkMITKIGTTrackingToolboxAutoDetection Auto detection of tools (only Aurora) If you use the Aurora system you also have the possibility to automatically detect the connected tools. In this case a tracking tool storage is created by the software. In the Tracking Device Configuration widget, a button "Auto Detection" appears. If you press this button the software connects to the system and automatically detects all connected tools. You will then be asked whether you want to save the detected tools as a tool storage to the hard drive. You might want to do this if you want to use or modify this tool storage later. In the automatically detected tool storage the tools are named AutoDetectedTools1, AutoDetectedTools2, and so on. Small spheres are used as tool surfaces. After autodetection the detected tools are loaded automatically even if you did not save them. \section QmitkMITKIGTTrackingToolboxStartTracking Start/stop tracking To start tracking, you first need to connect to your tracking device ("connect" button). If your tools or tool storage don't match the tracking device or if no connection can be established, this might give an error message here. \imageMacro{QmitkIGTTracking_TrackingControl.png,"Tracking Control to start tracking.", 9.00} If connected succesfully, the start tracking button is enabled. As soon as you clicked this button, the tool information and tools will be highlighted red or green (un-/successful tracking) and in case of successful tracking, it's position will be updated and the tools are visualized in the 3D view of MITK. Note that options may not be changed after connecting the tracking device. You can start, freeze, unfreeze and stop the tracking as long as you are connected. If you want to finish your tracking, please stop an disconnect your tracking device. Tutorial: Please click "connect" and "start tracking". Both tools should move within the tracking volume, the position data should be updated in the tool widget and be highlighted green. You can freeze, unfreeze and stop/restart the tracking as often as you like. When finished, please stop and disconnect. \section QmitkMITKIGTTrackingOptions Options In the options tab you can enable or disable the visualization of the tracking volume and of the tool quaternions. If enabled, the tool quaternions are shown in the tool information. You can also define the update rate of the tracking data. The update rate should not be set higher than the update rate of the tracking system. Other options might be available here depending on the newest developement within MITK-IGT. \imageMacro{QmitkIGTTracking_Options.png,"Recorded logging data.", 9.00} \section QmitkMITKIGTTrackingToolboxLogging Logging features The logging feature of the Tracking Toolbox supports logging in XML or CSV format. If your device is tracking, you are able to log the tracking data by using the logging tab. You first must define a file name. You can then choose whether you want comma seperated (csv) or xml format. Press "Start Logging" to start logging. You can also limit the number of logged frames, which will cause the logging to stop automatically after the given number. \imageMacro{QmitkIGTTracking_LoggingWidget.png,"Tracking options.", 9.00} -Tutorial: Please connect and start tracking as you already did in the last step, change to the logging tab, specify a csv file and start logging for a view seconds. Stop the tracking after a short period of time. You should now find the specified file which should look similar to the following screenshot and contain position data for both tools: +Tutorial: Please connect and start tracking as you already did in the last step, switch to the logging tab, specify a csv file and start logging for a view seconds. Stop the tracking after a short period of time. You should now find the specified file which should look similar to the following screenshot and contain position data for both tools: \imageMacro{QmitkIGTTracking_LogFile.png,"Recorded logging data.", 9.00} Return to the Tutorial Step: \ref IGTTutorialStepPluginIntroduction */ \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox index fa967d668f..9940cc1627 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox +++ b/Plugins/org.mitk.gui.qt.igttracking/documentation/UserManual/QmitkNavigationDataPlayer.dox @@ -1,28 +1,29 @@ /** \page org_mitk_views_navigationdataplayer The NavigationData Player \imageMacro{../resources/iconNavigationDataPlayer.png,"Icon of the NavigationData Player",2.00} \tableofcontents \section NavigationDataPlayerOverview The navigation data player plays recorded or artificial navigation data of one ore more tracking tools and visualizes their trajectory. It can also make the data available als a NavigationDataSource to Plugins that require a stream of tracking data, without having to create a tracking device. \imageMacro{QmitkIGTTracking_NavigationDataPlayer.png, "The Navigation Data Player", 7} To use it, select a set of recorded navigation data using the "Open File" button. The Player will show the number of tools and the number of frames in the file. Select the sequential player if you want to play the data with a specified tempo (set the update Interval accordingly). Use the Time-based player to play the data in the speed they were originally acquired in.
  • Check "Repeat" to repeat the data as a loop indefinitely.
  • Check "Register as Microservice" to make the data available as a microservice TrackingDataSource. Other Filters can then be connected to it from other plugins. This is useful for development purposes or to replay previously recorded Situations.
  • Check "Display" to render the data in the render Window.
-Tutorial: As part of the IGT tutorial, you might try to replay your recorded data from step \ref org_mitk_views_igttrackingtoolbox +Tutorial: As part of the IGT tutorial, you might try to replay your recorded data from step \ref org_mitk_views_igttrackingtoolbox. You should see two spheric tools moving within the tracking volume. Note that the tool storage is not included in the navigation data player at the moment, and hence all tools are represented as spheres. + Return to the Tutorial Step: \ref IGTTutorialStepPluginIntroduction */ \ No newline at end of file