PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkFcsvReader.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 __vtkFcsvReader_h
8 #define __vtkFcsvReader_h
9 
10 // Local includes
11 #include "vtkPlusDataCollectionExport.h"
12 
13 // VTK includes
14 #include <vtkObject.h>
15 
16 // STL includes
17 #include <vector>
18 #include <stdexcept>
19 
25 class vtkPlusDataCollectionExport FcsvPoint
26 {
27 public:
28  std::string label;
29  double position[3];
30  int selected;
32 };
33 
39 struct vtkPlusDataCollectionExport FcsvData
40 {
41  std::string filePath; // L.fcsv
42  std::string name; //= L
43  int numPoints; //= 16
44  int symbolScale; // = 5
45  int symbolType; // = 11
46  int visibility; //= 1
47  float version; //= 2
48  float textScale; //= 4.5
49  float color[3]; //= 0.4,1,1
50  float selectedColor[3]; //= 1,0.5,0.5
51  float opacity; //= 1
52  float ambient; //= 0
53  float diffuse; //= 1
54  float specular; //= 0
55  float power; //= 1
56  int locked; //= 0
57  std::vector<std::string> columns; //= label,x,y,z,sel,vis
58  int numberingScheme; //= 0
59  std::vector<FcsvPoint> points;
60 };
61 
68 class vtkPlusDataCollectionExport vtkFcsvReader : public vtkObject
69 {
70 public:
71  static vtkFcsvReader* New();
72  vtkTypeMacro(vtkFcsvReader, vtkObject);
73  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
74 
76  void Update(void);
77 
79  vtkSetMacro(FileName, std::string);
81  vtkGetMacro(FileName, std::string);
82 
84  {
85  return FcsvDataObject;
86  };
87  FcsvPoint& GetFcsvPoint(unsigned int index)
88  {
89  if (index < FcsvDataObject.points.size())
90  {
91  return FcsvDataObject.points[index];
92  }
93  throw std::out_of_range("Point out of range.");
94  }
95 
96 protected:
97  vtkFcsvReader();
98  virtual ~vtkFcsvReader();
99 
100  void StripCharsFromString(std::string& str, const std::string& chars);
101  void ProcessHeaderEntry(const std::string& headerEntry, const std::string& headerEntryValue);
102 
103  std::string FileName;
105 
106 private:
107  vtkFcsvReader(const vtkFcsvReader&); //purposely not implemented
108  vtkFcsvReader& operator=(const vtkFcsvReader&); //purposely not implemented
109 };
110 
111 #endif // __FcsvReader_h
int numPoints
Definition: vtkFcsvReader.h:43
FcsvPoint & GetFcsvPoint(unsigned int index)
Definition: vtkFcsvReader.h:87
float opacity
Definition: vtkFcsvReader.h:51
int numberingScheme
Definition: vtkFcsvReader.h:58
Describes a fiducial list.
Definition: vtkFcsvReader.h:39
std::string name
Definition: vtkFcsvReader.h:42
float diffuse
Definition: vtkFcsvReader.h:53
float version
Definition: vtkFcsvReader.h:47
float specular
Definition: vtkFcsvReader.h:54
float power
Definition: vtkFcsvReader.h:55
int visibility
Definition: vtkFcsvReader.h:31
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
int symbolScale
Definition: vtkFcsvReader.h:44
int visibility
Definition: vtkFcsvReader.h:46
std::vector< std::string > columns
Definition: vtkFcsvReader.h:57
std::string FileName
std::vector< FcsvPoint > points
Definition: vtkFcsvReader.h:59
float textScale
Definition: vtkFcsvReader.h:48
std::string label
Definition: vtkFcsvReader.h:28
Describes a single fiducial point.
Definition: vtkFcsvReader.h:25
float ambient
Definition: vtkFcsvReader.h:52
std::string filePath
Definition: vtkFcsvReader.h:41
const FcsvData & GetFcsvDataObject()
Definition: vtkFcsvReader.h:83
double * position
Definition: phidget22.h:3303
FcsvData FcsvDataObject
int symbolType
Definition: vtkFcsvReader.h:45