00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef MITKCLARONINTERFACE_H_HEADER_INCLUDED_ 00019 #define MITKCLARONINTERFACE_H_HEADER_INCLUDED_ 00020 #define MTC(func) {int r = func; if (r!=mtOK) printf("MTC error: %s\n",MTLastErrorString()); }; 00021 00022 #include <vector> 00023 #include <string> 00024 00025 #include <MitkIGTExports.h> 00026 #include "mitkCommon.h" 00027 00028 #include <itkObject.h> 00029 #include <itkObjectFactory.h> 00030 00031 typedef int mtHandle; 00032 00033 namespace mitk 00034 { 00035 typedef int claronToolHandle; 00036 00044 class MitkIGT_EXPORT ClaronInterface : public itk::Object 00045 { 00046 public: 00047 00048 mitkClassMacro(ClaronInterface,itk::Object); 00049 itkNewMacro(Self); 00055 void Initialize(std::string calibrationDir, std::string toolFilesDir); 00056 00061 bool StartTracking(); 00062 00067 bool StopTracking(); 00068 00072 std::vector<claronToolHandle> GetAllActiveTools(); 00073 00077 std::vector<double> GetTipPosition(claronToolHandle c); 00078 00082 std::vector<double> GetTipQuaternions(claronToolHandle c); 00083 00087 std::vector<double> GetPosition(claronToolHandle c); 00088 00092 std::vector<double> GetQuaternions(claronToolHandle c); 00093 00098 const char* GetName(claronToolHandle c); 00099 00103 void GrabFrame(); 00104 00108 bool IsTracking(); 00109 00115 bool IsMicronTrackerInstalled(); 00116 00117 protected: 00121 ClaronInterface(); 00125 ~ClaronInterface(); 00126 00127 00129 bool isTracking; 00130 00132 char calibrationDir[512]; 00134 char markerDir[512]; 00135 00136 //Some handles to communicate with the MTC library. 00137 mtHandle IdentifiedMarkers; 00138 mtHandle PoseXf; 00139 mtHandle CurrCamera; 00140 mtHandle IdentifyingCamera; 00141 //------------------------------------------------ 00142 00143 }; 00144 }//mitk 00145 #endif