IGSTK
|
00001 /*========================================================================= 00002 00003 Program: Image Guided Surgery Software Toolkit 00004 Module: $RCSfile: igstkMicronTracker.h,v $ 00005 Language: C++ 00006 Date: $Date: 2008-11-17 20:12:25 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) ISC Insight Software Consortium. All rights reserved. 00010 See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm 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 __igstkMicronTracker_h 00019 #define __igstkMicronTracker_h 00020 00021 #ifdef _MSC_VER 00022 #pragma warning ( disable : 4018 ) 00023 //Warning about: identifier was truncated to '255' characters in the debug 00024 //information (MVC6.0 Debug) 00025 #pragma warning( disable : 4284 ) 00026 #endif 00027 00028 #include "igstkTracker.h" 00029 00030 // 00031 // MicronTracker utilitiy classes declarations. 00032 // These classes are part of the MTC library 00033 // and can be found in the Utilities subdirectory. 00034 // 00035 class Markers; 00036 class Marker; 00037 class Persistence; 00038 class Cameras; 00039 class MCamera; 00040 class Facet; 00041 class Xform3D; 00042 00043 #include <map> 00044 00045 namespace igstk { 00046 00060 class MicronTracker : public Tracker 00061 { 00062 public: 00064 igstkStandardClassTraitsMacro( MicronTracker, Tracker ) 00065 00066 public: 00067 00069 igstkGetMacro( NumberOfTools, unsigned int ); 00070 00074 igstkSetStringMacro( CameraCalibrationFilesDirectory ); 00075 00080 igstkSetStringMacro( InitializationFile ); 00081 00083 igstkSetStringMacro( MarkerTemplatesDirectory ); 00084 00085 protected: 00086 00087 MicronTracker(void); 00088 00089 virtual ~MicronTracker(void); 00090 00092 typedef Tracker::ResultType ResultType; 00093 00095 virtual ResultType InternalOpen( void ); 00096 00098 virtual ResultType InternalClose( void ); 00099 00101 virtual ResultType InternalStartTracking( void ); 00102 00104 virtual ResultType InternalStopTracking( void ); 00105 00107 virtual ResultType InternalUpdateStatus( void ); 00108 00111 virtual ResultType InternalThreadedUpdateStatus( void ); 00112 00114 virtual ResultType InternalReset( void ); 00115 00117 virtual ResultType VerifyTrackerToolInformation( const TrackerToolType * ); 00118 00121 virtual ResultType ValidateSpecifiedFrequency( double frequencyInHz ); 00122 00124 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; 00125 00128 static void CreateErrorCodeList(); 00129 00131 static std::string GetErrorDescription( unsigned int ); 00132 00134 virtual ResultType RemoveTrackerToolFromInternalDataContainers( const 00135 TrackerToolType * trackerTool ); 00136 00138 virtual ResultType AddTrackerToolToInternalDataContainers( const 00139 TrackerToolType * trackerTool ); 00140 00141 private: 00142 00143 MicronTracker(const Self&); //purposely not implemented 00144 void operator=(const Self&); //purposely not implemented 00145 00148 bool Initialize(); 00149 00151 bool LoadMarkerTemplates(); 00152 00154 bool SetUpCameras(); 00155 00157 itk::MutexLock::Pointer m_BufferLock; 00158 00160 unsigned int m_NumberOfTools; 00161 00163 std::string m_CameraCalibrationFilesDirectory; 00164 00166 std::string m_InitializationFile; 00167 00169 std::string m_MarkerTemplatesDirectory; 00170 00171 Persistence * m_Persistence; 00172 Markers * m_Markers; 00173 Cameras * m_Cameras; 00174 MCamera * m_SelectedCamera; 00175 00177 double m_CameraLightCoolness; 00178 00180 typedef std::map< std::string, std::vector < double > > 00181 TrackerToolTransformContainerType; 00182 00183 TrackerToolTransformContainerType m_ToolTransformBuffer; 00184 00186 typedef std::map< unsigned int, std::string> ErrorCodeContainerType; 00187 static ErrorCodeContainerType m_ErrorCodeContainer; 00188 00190 static bool m_ErrorCodeListCreated; 00191 00193 std::map< std::string, int > m_ToolStatusContainer; 00194 00195 }; 00196 00197 } 00198 00199 #endif //__igstk_MicronTracker_h_