IGSTK
igstkMicronTracker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkMicronTracker.h,v $
5  Language: C++
6  Date: $Date: 2008-11-17 20:12:25 $
7  Version: $Revision: 1.4 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkMicronTracker_h
19 #define __igstkMicronTracker_h
20 
21 #ifdef _MSC_VER
22 #pragma warning ( disable : 4018 )
23 //Warning about: identifier was truncated to '255' characters in the debug
24 //information (MVC6.0 Debug)
25 #pragma warning( disable : 4284 )
26 #endif
27 
28 #include "igstkTracker.h"
29 
30 //
31 // MicronTracker utilitiy classes declarations.
32 // These classes are part of the MTC library
33 // and can be found in the Utilities subdirectory.
34 //
35 class Markers;
36 class Marker;
37 class Persistence;
38 class Cameras;
39 class MCamera;
40 class Facet;
41 class Xform3D;
42 
43 #include <map>
44 
45 namespace igstk {
46 
60 class MicronTracker : public Tracker
61 {
62 public:
65 
66 public:
67 
69  igstkGetMacro( NumberOfTools, unsigned int );
70 
74  igstkSetStringMacro( CameraCalibrationFilesDirectory );
75 
80  igstkSetStringMacro( InitializationFile );
81 
83  igstkSetStringMacro( MarkerTemplatesDirectory );
84 
85 protected:
86 
87  MicronTracker(void);
88 
89  virtual ~MicronTracker(void);
90 
93 
95  virtual ResultType InternalOpen( void );
96 
98  virtual ResultType InternalClose( void );
99 
101  virtual ResultType InternalStartTracking( void );
102 
104  virtual ResultType InternalStopTracking( void );
105 
107  virtual ResultType InternalUpdateStatus( void );
108 
111  virtual ResultType InternalThreadedUpdateStatus( void );
112 
114  virtual ResultType InternalReset( void );
115 
117  virtual ResultType VerifyTrackerToolInformation( const TrackerToolType * );
118 
121  virtual ResultType ValidateSpecifiedFrequency( double frequencyInHz );
122 
124  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
125 
128  static void CreateErrorCodeList();
129 
131  static std::string GetErrorDescription( unsigned int );
132 
134  virtual ResultType RemoveTrackerToolFromInternalDataContainers( const
135  TrackerToolType * trackerTool );
136 
138  virtual ResultType AddTrackerToolToInternalDataContainers( const
139  TrackerToolType * trackerTool );
140 
141 private:
142 
143  MicronTracker(const Self&); //purposely not implemented
144  void operator=(const Self&); //purposely not implemented
145 
148  bool Initialize();
149 
151  bool LoadMarkerTemplates();
152 
154  bool SetUpCameras();
155 
157  itk::MutexLock::Pointer m_BufferLock;
158 
160  unsigned int m_NumberOfTools;
161 
163  std::string m_CameraCalibrationFilesDirectory;
164 
166  std::string m_InitializationFile;
167 
169  std::string m_MarkerTemplatesDirectory;
170 
171  Persistence * m_Persistence;
172  Markers * m_Markers;
173  Cameras * m_Cameras;
174  MCamera * m_SelectedCamera;
175 
177  double m_CameraLightCoolness;
178 
180  typedef std::map< std::string, std::vector < double > >
181  TrackerToolTransformContainerType;
182 
183  TrackerToolTransformContainerType m_ToolTransformBuffer;
184 
186  typedef std::map< unsigned int, std::string> ErrorCodeContainerType;
187  static ErrorCodeContainerType m_ErrorCodeContainer;
188 
190  static bool m_ErrorCodeListCreated;
191 
193  std::map< std::string, int > m_ToolStatusContainer;
194 
195 };
196 
197 }
198 
199 #endif //__igstk_MicronTracker_h_