PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
AtracsysMarkerCreator.cxx
Go to the documentation of this file.
1 #include "PlusConfigure.h"
2 #include "AtracsysTracker.h"
3 #include "vtksys/CommandLineArguments.hxx"
4 
5 // STL includes
6 #include <algorithm>
7 #include <fstream>
8 #include <iomanip>
9 #include <iostream>
10 #include <vector>
11 
12 //----------------------------------------------------------------------------
13 using namespace Atracsys;
14 
15 // global handle to Atracsys API wrapper
17 Tracker::DEVICE_TYPE DeviceType = Atracsys::Tracker::DEVICE_TYPE::UNKNOWN_DEVICE;
18 
19 // constants
20 #define NUM_BACKGROUND_FRAMES 100
21 #define DEFAULT_NUM_DATA_FRAMES 100
22 #define ATRACSYS_MAX_FIDUCIALS 6
23 
24 // for convenience
26 #define ATR_SUCCESS ATR_RESULT::SUCCESS
27 
28 // data types
29 typedef std::vector<Fiducials> FiducialsSequence;
30 typedef std::vector<Marker> MarkerSequence;
31 
32 // struct to hold geometry intrinsics
33 struct CustomGeometry
34 {
35  std::string name;
36  std::string description;
37  std::string destPath;
38  int geometryId;
39  Fiducials fids;
40 };
41 
42 // forward declarations
43 PlusStatus CollectFiducialSequence(FiducialsSequence& fidFrameList, int numFrames);
47 std::string WriteGeometryToString(const CustomGeometry& geom);
48 PlusStatus CollectMarkerSequence(CustomGeometry& geom, MarkerSequence& markerFrameList, int numFrames);
49 PlusStatus RefineMarkerGeometry(CustomGeometry& geom, MarkerSequence& markerFrameList);
50 PlusStatus WriteGeometryToIniFile(const CustomGeometry& geom);
51 
52 // function to remove excessive precision for geometry coordinates writing
53 double remDecimals(double a, double prec)
54 {
55  return (std::abs(a) > prec) ? a : 0.0;
56 };
57 
58 //----------------------------------------------------------------------------
59 // 3D point/vector struct to help in processing fiducial data
60 struct vec3
61 {
62  double x{ 0 };
63  double y{ 0 };
64  double z{ 0 };
65 
66  vec3() = default;
67  vec3(const vec3& x1) = default;
68  vec3(const Fiducial& f) : x{ f.xMm }, y{ f.yMm }, z{ f.zMm } {};
69  vec3(double _x, double _y, double _z) : x{ _x }, y{ _y }, z{ _z } {};
70 
71  vec3& operator=(const vec3& other) = default;
72  vec3& operator=(vec3&& other) = default;
73  vec3 operator-() const
74  {
75  return { -this->x, -this->y, -this->z };
76  }
77 
78  vec3& operator+=(const vec3& other)
79  {
80  this->x += other.x;
81  this->y += other.y;
82  this->z += other.z;
83  return *this;
84  }
85 
86  vec3& operator-=(const vec3& other)
87  {
88  this->x -= other.x;
89  this->y -= other.y;
90  this->z -= other.z;
91  return *this;
92  }
93 
94  vec3& operator/=(const double& value)
95  {
96  this->x /= value;
97  this->y /= value;
98  this->z /= value;
99  return *this;
100  }
101 
102  vec3& operator*=(const double& value)
103  {
104  this->x *= value;
105  this->y *= value;
106  this->z *= value;
107  return *this;
108  }
109 
110  vec3 operator+ (const vec3& x2) const
111  {
112  vec3 result{ *this };
113  result += x2;
114  return result;
115  }
116 
117  vec3 operator- (const vec3& x1) const
118  {
119  vec3 result{ *this };
120  result -= x1;
121  return result;
122  }
123 
124  vec3 operator* (const double value) const
125  {
126  return { this->x * value, this->y * value, this->z * value };
127  }
128 
129  friend vec3 operator* (const double value, const vec3& x1)
130  {
131  return x1 * value;
132  }
133 
134  vec3 operator/ (const double value) const
135  {
136  vec3 result{ *this };
137  result /= value;
138  return result;
139  }
140 
141  double operator* (const vec3& x1) const
142  {
143  return x1.x * this->x + x1.y * this->y + x1.z * this->z;
144  }
145 
146  double norm() const
147  {
148  return std::sqrt(this->normSqr());
149  }
150 
151  double normSqr() const
152  {
153  return *this * *this;
154  }
155 
156  vec3& normalize()
157  {
158  // check if norm() is not 0
159  if (this->norm())
160  *this /= this->norm();
161  return *this;
162  }
163 
164  vec3 cross(const vec3& x2) const
165  {
166  return { this->y * x2.z - this->z * x2.y, this->z * x2.x - this->x * x2.z, this->x * x2.y - this->y * x2.x };
167  }
168 };
169 
170 //----------------------------------------------------------------------------
171 int main(int argc, char** argv)
172 {
173  // Check command line arguments.
174  bool printHelp(false);
175  std::string markerName;
176  std::string description;
177  std::string destinationPath;
178  int geometryId = -1;
179  int verboseLevel = vtkPlusLogger::LOG_LEVEL_UNDEFINED;
180  int numFrames = DEFAULT_NUM_DATA_FRAMES;
181  int intTime = -1;
182  int imgThresh = -1;
183 
184  vtksys::CommandLineArguments args;
185  args.Initialize(argc, argv);
186 
187  args.AddArgument("--help", vtksys::CommandLineArguments::NO_ARGUMENT, &printHelp, "Print this help.");
188  args.AddArgument("--marker-name", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &markerName, "Name of marker.");
189  args.AddArgument("--description", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &description, "Decsription of marker (i.e. purpose, color, size, and any other desired metadata).");
190  args.AddArgument("--geometryId", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &geometryId, "Id of the geometry we are creating. Must be unique.");
191  args.AddArgument("--destination-path", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &destinationPath, "Where the generated marker geometry ini file will be written to.");
192  args.AddArgument("--verbose", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &verboseLevel, "Verbose level (1=error only, 2=warning, 3=info, 4=debug, 5=trace).");
193  args.AddArgument("--num-frames", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &numFrames, "Number of frames to use in generating marker geometry ini file.");
194  args.AddArgument("--int-time", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &intTime, "Integration time for the camera.");
195  args.AddArgument("--img-thresh", vtksys::CommandLineArguments::EQUAL_ARGUMENT, &imgThresh, "Image compression threshold.");
196 
197  std::this_thread::sleep_for(std::chrono::milliseconds(4000));
198 
199  if (!args.Parse())
200  {
201  std::cerr << "Problem parsing arguments." << std::endl;
202  std::cout << "Help: " << args.GetHelp() << std::endl;
203  exit(EXIT_FAILURE);
204  }
205 
206  if (printHelp)
207  {
208  std::cout << args.GetHelp() << std::endl;
209  exit(EXIT_SUCCESS);
210  }
211 
212  vtkPlusLogger::Instance()->SetLogLevel(verboseLevel);
213 
214  if (markerName.empty())
215  {
216  LOG_ERROR("--marker-name argument is required!");
217  std::cout << "Help: " << args.GetHelp() << std::endl;
218  exit(EXIT_FAILURE);
219  }
220 
221  if (description.empty())
222  {
223  LOG_ERROR("--description argument is required!");
224  std::cout << "Help: " << args.GetHelp() << std::endl;
225  exit(EXIT_FAILURE);
226  }
227 
228  if (geometryId == -1)
229  {
230  LOG_ERROR("--geometryId argument is required!");
231  std::cout << "Help: " << args.GetHelp() << std::endl;
232  exit(EXIT_FAILURE);
233  }
234 
235  LOG_INFO("Logging at level " << vtkPlusLogger::Instance()->GetLogLevel() << " (" << vtkPlusLogger::Instance()->GetLogLevelString() << ") to file: " << vtkPlusLogger::Instance()->GetLogFileName());
236 
237  // Connect to tracker
238  ATR_RESULT result = AtrTracker.Connect();
239  if (result != ATR_SUCCESS && result != ATR_RESULT::WARNING_CONNECTED_IN_USB2)
240  {
241  LOG_ERROR(AtrTracker.ResultToString(result));
242  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
243  return PLUS_FAIL;
244  }
245  else if (result == ATR_RESULT::WARNING_CONNECTED_IN_USB2)
246  {
247  LOG_WARNING(AtrTracker.ResultToString(result));
248  AtrTracker.SetUserLEDState(255, 153, 0, 0); // orange LED
249  }
250 
251  // If spryTrack, setup for onboard processing and disable extraneous marker info streaming
253  if (DeviceType == Tracker::DEVICE_TYPE::SPRYTRACK_180)
254  {
255  AtrTracker.SetSpryTrackProcessingType(Tracker::SPRYTRACK_IMAGE_PROCESSING_TYPE::PROCESSING_ONBOARD);
256  }
257  // Setting other options
258  if (intTime > 0)
259  {
260  if (AtrTracker.SetOption("Image Integration Time", std::to_string(intTime)) != Atracsys::Tracker::SUCCESS)
261  {
262  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
263  return PLUS_FAIL;
264  }
265  }
266  if (imgThresh > 0)
267  {
268  if (AtrTracker.SetOption("Image Compression Threshold", std::to_string(imgThresh)) != Atracsys::Tracker::SUCCESS)
269  {
270  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
271  return PLUS_FAIL;
272  }
273  }
274 
275  // Collect background frames
276  LOG_INFO("\nBackground acquisition. Do NOT place the marker in front of the camera.");
277  LOG_INFO("Press <ENTER> to continue.");
278  std::cin.get();
279 
280  FiducialsSequence backgroundfidsFrameList;
281  Fiducials backgroundFids; // list of fiducials visible in background
282  AtrTracker.SetUserLEDState(0, 0, 255, 0); // blue LED
283  if (CollectFiducialSequence(backgroundfidsFrameList, NUM_BACKGROUND_FRAMES) != PLUS_SUCCESS)
284  {
285  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
286  LOG_ERROR("Failed to collect background noise fiducial frames.");
287  return PLUS_FAIL;
288  }
289  std::cout << "\n";
290  ProcessBackgroundFiducials(backgroundfidsFrameList, backgroundFids);
291  LOG_INFO("Background collection successful (" << backgroundFids.size() << " stray reflections).\n");
292 
293  // Create initial marker geometry
294  AtrTracker.SetUserLEDState(0, 255, 0, 0); // green LED
295  LOG_INFO("Place marker facing the camera in the first half of the working volume\nand rotate slowly the marker until geometry file is generated (left LED off).");
296  LOG_INFO("Press <ENTER> to continue.");
297  std::cin.get();
298 
299  AtrTracker.SetUserLEDState(255, 153, 0, 0); // orange LED
300  LOG_INFO("Trying to get a good initial guess of the geometry...");
301  Fiducials foregroundFids;
302  if (CaptureInitialGeometry(backgroundFids, foregroundFids) != PLUS_SUCCESS)
303  {
304  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
305  LOG_ERROR("Failed to collect initial foreground fiducials.");
306  return PLUS_FAIL;
307  }
308 
309  AtrTracker.SetUserLEDState(0, 0, 255, 0); // blue LED
310  LOG_INFO("Initial guess for marker geometry obtained.");
311 
312  CustomGeometry geom;
313  geom.name = markerName;
314  geom.description = description;
315  geom.destPath = destinationPath;
316  geom.geometryId = geometryId;
317  geom.fids = foregroundFids;
318 
319  // Refining initial marker geometry
320  LOG_INFO("Collecting marker frames to refine geometry...");
321  MarkerSequence markerFrameList;
322  if (CollectMarkerSequence(geom, markerFrameList, numFrames) != PLUS_SUCCESS)
323  {
324  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
325  LOG_ERROR("Failed to collect marker frames with initial geometry guess.");
326  return PLUS_FAIL;
327  }
328  std::cout << "\n";
329 
330  LOG_INFO("Refining geometry...");
331  if (RefineMarkerGeometry(geom, markerFrameList) != PLUS_SUCCESS)
332  {
333  AtrTracker.SetUserLEDState(255, 0, 0, 0); // red LED
334  LOG_ERROR("Failed to refine geometry.");
335  return PLUS_FAIL;
336  }
337 
338  // Write marker ini file
340 
341  // turn LED off & end program
342  AtrTracker.EnableUserLED(false);
343  return EXIT_SUCCESS;
344 }
345 
346 //----------------------------------------------------------------------------
347 void ProgressBar(int i, int N, int barWidth = 70)
348 {
349  std::cout << "[";
350  int pos = barWidth * i / N;
351  for (int i = 0; i < barWidth; ++i) {
352  if (i < pos) std::cout << "=";
353  else if (i == pos) std::cout << ">";
354  else std::cout << " ";
355  }
356  std::cout << "] " << int(100 * i / N) << " %\r";
357  std::cout.flush();
358 }
359 
360 //----------------------------------------------------------------------------
362 {
363  int m = 0;
364  ProgressBar(m, numFrames);
365  Fiducials fid3dFrame;
366  std::map<std::string, std::string> events; // unused
367  uint64_t ts = 0; // unused
368  while (m < numFrames)
369  {
370  ATR_RESULT result = AtrTracker.GetFiducialsInFrame(fid3dFrame, events, ts);
371  if (result == ATR_SUCCESS)
372  {
373  ProgressBar(++m, numFrames);
374  fidFrameList.push_back(fid3dFrame);
375  }
376  else if (result == ATR_RESULT::ERROR_NO_FRAME_AVAILABLE)
377  {
378  continue;
379  }
380  else
381  {
382  LOG_ERROR(AtrTracker.ResultToString(result));
383  return PLUS_FAIL;
384  }
385  }
386  return PLUS_SUCCESS;
387 }
388 
389 //----------------------------------------------------------------------------
391 {
392  Fiducials frame;
393  // make sure fids is empty
394  fids.clear();
395 
396  for (FiducialsSequence::size_type frameNum = 0; frameNum < fidFrameList.size(); frameNum++)
397  {
398  frame = fidFrameList[frameNum];
399  // populate fids with list of fiducials appearing in the background
400  std::copy(frame.begin(), frame.end(), std::inserter(fids, fids.end()));
401  }
402 
403  // remove duplicate points in backgroundFids && resize
404  std::sort(fids.begin(), fids.end());
405  Fiducials::iterator it = std::unique(fids.begin(), fids.end());
406  fids.resize(std::distance(fids.begin(), it));
407  return PLUS_SUCCESS;
408 }
409 
410 //----------------------------------------------------------------------------
412 {
413  Fiducials fid3dFrame;
414  std::map<std::string, std::string> events; // unused
415  uint64_t ts = 0; // unused
416  while (true)
417  {
418  ATR_RESULT result = AtrTracker.GetFiducialsInFrame(fid3dFrame, events, ts);
419  if (result == ATR_SUCCESS)
420  {
421  int deter = 0;
422  // Remove those also part of the background
423  fid3dFrame.erase(
424  std::remove_if(fid3dFrame.begin(), fid3dFrame.end(),
425  [&backFids](const Fiducial& item) {
426  return std::find(backFids.begin(), backFids.end(), item) != backFids.end();
427  }),
428  fid3dFrame.end()
429  );
430 
431  // Skip frame if foreground fiducial number too small or too large
432  if (fid3dFrame.size() < 3 || fid3dFrame.size() > ATRACSYS_MAX_FIDUCIALS)
433  {
434  continue;
435  }
436  // Check that all fiducial probabilities are 1
437  for (const auto& f : fid3dFrame)
438  {
439  deter += std::floor(f.probability);
440  }
441  if (deter == fid3dFrame.size())
442  {
443  fids = fid3dFrame;
444  break;
445  }
446  }
447  else if (result == ATR_RESULT::ERROR_NO_FRAME_AVAILABLE)
448  {
449  continue;
450  }
451  else
452  {
453  LOG_ERROR(AtrTracker.ResultToString(result));
454  return PLUS_FAIL;
455  }
456  }
457 
458  return PLUS_SUCCESS;
459 }
460 
461 //----------------------------------------------------------------------------
463 {
464  // Start processing fids positions to determine marker coordinate system.
465  vec3 c(0.0, 0.0, 0.0);
466  // Calculate the centroid of fiducials, also the origin of the new coordinate system.
467  for (const auto& fid : fids)
468  {
469  c += vec3(fid);
470  }
471  c /= static_cast<double>(fids.size());
472 
473  // Calculate all fiducial-to-centroid distances and automatically store them in descending order.
474  std::multimap<double, int, std::greater<double>> dists;
475  for (int i = 0; i < fids.size(); ++i)
476  {
477  dists.insert({ (c - vec3(fids[i])).norm(), i });
478  }
479  // Look for the largest *unique* distance from the centroid, the corresponding fiducial will
480  // define the x-axis.
481  vec3 x;
482  for (auto prev = dists.begin(), curr = ++dists.begin(); curr != dists.end(); ++prev, ++curr)
483  {
484  if (std::abs(prev->first - curr->first) > 0.1)
485  {
486  auto fidId = (prev == dists.begin()) ? prev->second : curr->second;
487  x = vec3(fids[fidId]);
488  break;
489  }
490  }
491  // Calculate all fiducial-to-x-axis distances and automatically store them in descending order.
492  std::multimap<double, int, std::greater<double>> dists2;
493  for (int i = 0; i < fids.size(); ++i)
494  {
495  double num = ((x - vec3(fids[i])).cross(x - c)).norm();
496  dists2.insert({ num / (x - c).norm(), i });
497  }
498  // Look for the largest *unique* distance from x-axis, it will define the plane of the y-axis.
499  vec3 p;
500  for (auto prev = dists2.begin(), curr = ++dists2.begin(); curr != dists2.end(); ++prev, ++curr)
501  {
502  if (std::abs(prev->first - curr->first) > 0.1)
503  {
504  auto fidId = (prev == dists2.begin()) ? prev->second : curr->second;
505  p = vec3(fids[fidId]);
506  break;
507  }
508  }
509  // Calculate z-axis and y-axis.
510  vec3 vx = (x - c).normalize();
511  vec3 vz = (vx.cross(p - c)).normalize();
512  vec3 vy = vz.cross(vx);
513 
514  // Store the coordinates of each fiducial in the new coordinate system.
515  for (auto& fid : fids)
516  {
517  Fiducial f = fid;
518  fid.xMm = (vec3(f) - c) * vx;
519  fid.yMm = (vec3(f) - c) * vy;
520  fid.zMm = (vec3(f) - c) * vz;
521  }
522 }
523 
524 //----------------------------------------------------------------------------
525 std::string WriteGeometryToString(const CustomGeometry& geom)
526 {
527  std::ostringstream os;
528 
529  // write metadata
530  os << "; " << geom.name << std::endl;
531  os << "; " << geom.description << std::endl;
532  auto t = std::time(nullptr);
533  auto tm = *std::localtime(&t);
534  os << "; " << std::put_time(&tm, "%Y-%m-%d %H:%M:%S") << std::endl;
535 
536  // write geometry
537  os << "[geometry]" << std::endl;
538  os << "count=" << geom.fids.size() << std::endl;
539  os << "id=" << geom.geometryId << std::endl;
540 
541  for (Fiducials::size_type i = 0; i < geom.fids.size(); i++)
542  {
543  os << "[fiducial" << i << "]" << std::endl;
544  os << "x=" << geom.fids[i].xMm << std::endl;
545  os << "y=" << geom.fids[i].yMm << std::endl;
546  os << "z=" << geom.fids[i].zMm << std::endl;
547  }
548 
549  return os.str();
550 }
551 
552 //----------------------------------------------------------------------------
553 PlusStatus CollectMarkerSequence(CustomGeometry& geom, MarkerSequence& markerFrameList, int numFrames)
554 {
555  std::string geoStr = WriteGeometryToString(geom);
556  // Load initial marker for tracking
557  int gid; // unused
559  {
560  LOG_ERROR("Unable to load initial marker.");
561  return PLUS_FAIL;
562  }
563 
564  int m = 0;
565  ProgressBar(m, numFrames);
566  std::vector<Marker> markersFrame;
567  std::map<std::string, std::string> events; // unused
568  uint64_t ts = 0; // unused
569  while (m < numFrames)
570  {
571  ATR_RESULT result = AtrTracker.GetMarkersInFrame(markersFrame, events, ts);
572  if (result == ATR_SUCCESS)
573  {
574  if (markersFrame.size() == 1) // make sure there is only one marker tracked
575  {
576  ProgressBar(++m, numFrames);
577  markerFrameList.push_back(markersFrame.front());
578  }
579  }
580  else if (result == ATR_RESULT::ERROR_NO_FRAME_AVAILABLE)
581  {
582  continue;
583  }
584  else
585  {
586  LOG_ERROR(AtrTracker.ResultToString(result));
587  return PLUS_FAIL;
588  }
589  }
590  return PLUS_SUCCESS;
591 }
592 
593 //----------------------------------------------------------------------------
594 PlusStatus RefineMarkerGeometry(CustomGeometry& geom, MarkerSequence& markerFrameList)
595 {
596  Fiducials accFids(geom.fids.size());
597  for (int m = 0; m < markerFrameList.size(); ++m)
598  {
599  Fiducials fids = markerFrameList[m].GetFiducials();
601  // Accumulate fids coordinates for averaging
602  for (int i = 0; i < fids.size(); ++i)
603  {
604  accFids[i].xMm += fids[i].xMm;
605  accFids[i].yMm += fids[i].yMm;
606  accFids[i].zMm += fids[i].zMm;
607  }
608  }
609 
610  // Complete the averaging and output the result
611  for (int i = 0; i < accFids.size(); ++i)
612  {
613  accFids[i].xMm = remDecimals(accFids[i].xMm / markerFrameList.size(), 1e-4);
614  accFids[i].yMm = remDecimals(accFids[i].yMm / markerFrameList.size(), 1e-4);
615  accFids[i].zMm = remDecimals(accFids[i].zMm / markerFrameList.size(), 1e-4);
616  }
617 
618  geom.fids = accFids;
619 
620  return PLUS_SUCCESS;
621 }
622 
623 //----------------------------------------------------------------------------
624 PlusStatus WriteGeometryToIniFile(const CustomGeometry& geom)
625 {
626  // create file path
627  std::string fileName;
628  if (geom.destPath.empty())
629  {
630  fileName = "./" + geom.name + ".ini";
631  }
632  else
633  {
634  fileName = geom.destPath + '/' + geom.name + ".ini";
635  }
636  LOG_INFO("Writing marker geometry to: " << fileName);
637  std::ofstream file;
638  file.open(fileName);
639  file << WriteGeometryToString(geom);
640  file.close();
641  LOG_INFO("Done.");
642  return PLUS_SUCCESS;
643 }
std::vector< Fiducials > FiducialsSequence
Atracsys::Tracker::RESULT ATR_RESULT
PlusStatus RefineMarkerGeometry(CustomGeometry &geom, MarkerSequence &markerFrameList)
RESULT SetUserLEDState(int red, int green, int blue, int frequency, bool enabled=true)
Tracker AtrTracker
int
Definition: phidget22.h:3069
igsioStatus PlusStatus
Definition: PlusCommon.h:40
std::vector< Fiducial > Fiducials
uint32_t * distance
Definition: phidget22.h:4650
RESULT EnableUserLED(bool enabled)
#define ATRACSYS_MAX_FIDUCIALS
std::string to_string(ClariusAvailability avail)
#define NUM_BACKGROUND_FRAMES
PlusStatus WriteGeometryToIniFile(const CustomGeometry &geom)
for i
int x1
Definition: phidget22.h:4262
#define PLUS_FAIL
Definition: PlusCommon.h:43
Image slice number p
Definition: algo4.m:14
RESULT SetSpryTrackProcessingType(SPRYTRACK_IMAGE_PROCESSING_TYPE processingType)
Tracker::DEVICE_TYPE DeviceType
#define PLUS_SUCCESS
Definition: PlusCommon.h:44
RESULT LoadMarkerGeometryFromString(std::string filePath, int &geometryId)
PhidgetGPS_Time * time
Definition: phidget22.h:3623
#define DEFAULT_NUM_DATA_FRAMES
PlusStatus CollectFiducialSequence(FiducialsSequence &fidFrameList, int numFrames)
int int int x2
Definition: phidget22.h:4262
RESULT GetDeviceType(DEVICE_TYPE &deviceType)
int x
Definition: phidget22.h:4265
const char const char * value
Definition: phidget22.h:5111
static vtkIGSIOLogger * Instance()
int main(int argc, char **argv)
RESULT SetOption(const std::string &, const std::string &)
std::vector< Marker > MarkerSequence
double remDecimals(double a, double prec)
Direction vectors of rods y
Definition: algo3.m:15
std::string WriteGeometryToString(const CustomGeometry &geom)
RESULT GetFiducialsInFrame(std::vector< Fiducial > &fiducials, std::map< std::string, std::string > &events, uint64_t &sdkTimestamp)
void TransformMarkerCoordinateSystem(Fiducials &fids)
RESULT GetMarkersInFrame(std::vector< Marker > &markers, std::map< std::string, std::string > &events, uint64_t &sdkTimestamp)
#define ATR_SUCCESS
PlusStatus CaptureInitialGeometry(Fiducials &backgroundFids, Fiducials &fids)
for t
Definition: exploreFolders.m:9
PlusStatus ProcessBackgroundFiducials(FiducialsSequence &fidFrameList, Fiducials &backgroundFids)
void ProgressBar(int i, int N, int barWidth=70)
N
Definition: algo3.m:19
PlusStatus CollectMarkerSequence(CustomGeometry &geom, MarkerSequence &markerFrameList, int numFrames)
std::string ResultToString(RESULT result)