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_
virtual ResultType InternalUpdateStatus(void)
Update the status and the transforms for all TrackerTools.
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
igstkSetStringMacro(CameraCalibrationFilesDirectory)
Set the directory path that contains the camera calibration files.
virtual ResultType ValidateSpecifiedFrequency(double frequencyInHz)
The "ValidateSpecifiedFrequency" method checks if the specified frequency is valid for the tracking d...
static std::string GetErrorDescription(unsigned int)
Get Error description given the error code.
virtual ResultType VerifyTrackerToolInformation(const TrackerToolType *)
Verify tracker tool information.
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
virtual ResultType InternalStopTracking(void)
Take the tracking device out of tracking mode.
virtual ResultType RemoveTrackerToolFromInternalDataContainers(const TrackerToolType *trackerTool)
Remove tracker tool entry from internal containers.
virtual ResultType AddTrackerToolToInternalDataContainers(const TrackerToolType *trackerTool)
Add tracker tool entry from internal containers.
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
virtual ResultType InternalReset(void)
Reset the tracking device to put it back to its original state.
igstkStandardClassTraitsMacro(MicronTracker, Tracker) public
Macro with standard traits declarations.
virtual ResultType InternalStartTracking(void)
Put the tracking device into tracking mode.
Abstract superclass for concrete IGSTK Tracker classes.
Definition: igstkTracker.h:96
Provides support for the Claron MicronTracker.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print object information.
virtual ResultType InternalClose(void)
Close communication with the tracking device.
igstkStandardAbstractClassTraitsMacro(Tracker, Object) public typedef TrackerTool TrackerToolType
Macro with standard traits declarations.
Definition: igstkTracker.h:101
static void CreateErrorCodeList()
Create an associative container that maps error code to error descritpion.
virtual ResultType InternalThreadedUpdateStatus(void)
Update the status and the transforms.
virtual ResultType InternalOpen(void)
Open communication with the tracking device.