PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusMicronTracker.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusMicronTracker_h
8 #define __vtkPlusMicronTracker_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 
12 #include "vtkPlusDevice.h"
13 
14 class MicronTrackerInterface;
15 class vtkMatrix4x4;
16 
22 class vtkPlusDataCollectionExport vtkPlusMicronTracker : public vtkPlusDevice
23 {
24 public:
25  static vtkPlusMicronTracker* New();
27 
29  virtual std::string GetSdkVersion();
30 
31  virtual bool IsTracker() const { return true; }
32 
34  PlusStatus Probe();
36 
38  PlusStatus GetImage(vtkImageData* leftImage, vtkImageData* rightImage);
39 
41  vtkGetMacro(IsMicronTrackingInitialized, int);
42 
43  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
44  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* rootConfigElement);
45 
46  MicronTrackerInterface* GetMicronTrackerInterface() { return this->MicronTracker; };
47 
48  static void LogMessageCallback(int level, const char* message, void* userdata);
49 
50  vtkSetMacro(TemplateDirectory, std::string);
51  vtkGetMacro(TemplateDirectory, std::string);
52 
53  vtkSetMacro(IniFile, std::string);
54  vtkGetMacro(IniFile, std::string);
55 
56 protected:
59 
61 
62  virtual PlusStatus InternalConnect();
64  virtual PlusStatus NotifyConfigured();
65 
67  PlusStatus RefreshMarkerTemplates();
68 
70  void GetTransformMatrix(int markerIndex, vtkMatrix4x4* transformMatrix);
71 
72 protected:
73  MicronTrackerInterface* MicronTracker;
75  std::string TemplateDirectory;
76  std::string IniFile;
77 
78 #ifdef USE_MicronTracker_TIMESTAMPS
79  double TrackerTimeToSystemTimeSec; // time_System = time_Tracker + TrackerTimeToSystemTimeSec
80  bool TrackerTimeToSystemTimeComputed; // the time offset is always computed when the first frame is received after start tracking
81 #endif
82 
83  vtkSmartPointer<vtkImageData> FrameLeft;
84  vtkSmartPointer<vtkImageData> FrameRight;
85  FrameSizeType FrameSize;
86 
87 private:
89  void operator=(const vtkPlusMicronTracker&);
90 };
91 
92 #endif
const char int const char const char Phidget_LogLevel level
Definition: phidget22.h:2458
vtkSmartPointer< vtkImageData > FrameRight
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
virtual bool IsTracker() const
MicronTrackerInterface * GetMicronTrackerInterface()
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
virtual std::string GetSdkVersion()
virtual PlusStatus Probe()
Interface class to Claron MicronTracker optical trackers.
MicronTrackerInterface * MicronTracker
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus InternalStartRecording()
virtual PlusStatus GetImage(const std::string &requestedImageId, std::string &assignedImageId, const std::string &imageReferencFrameName, vtkImageData *imageData, vtkMatrix4x4 *ijkToReferenceTransform)
virtual PlusStatus NotifyConfigured()
const char * message
Definition: phidget22.h:2457
virtual PlusStatus InternalDisconnect()
virtual PlusStatus InternalUpdate()
vtkSmartPointer< vtkImageData > FrameLeft
static vtkPlusDevice * New()