36 #ifndef __POINTMATCHER_IO_H 37 #define __POINTMATCHER_IO_H 61 static std::string
getColLabel(
const Label& label,
const int row);
106 void init(std::string name)
109 this->matrixRowId = 0;
110 this->matrixType = UNSUPPORTED;
121 const static SupportedLabels labels = {
125 {
"pad",
"pad", FEATURE},
127 {
"normals",
"nx", DESCRIPTOR},
128 {
"normals",
"ny", DESCRIPTOR},
129 {
"normals",
"nz", DESCRIPTOR},
130 {
"normals",
"normal_x", DESCRIPTOR},
131 {
"normals",
"normal_y", DESCRIPTOR},
132 {
"normals",
"normal_z", DESCRIPTOR},
133 {
"observationDirections",
"observationDirections0", DESCRIPTOR},
134 {
"observationDirections",
"observationDirections1", DESCRIPTOR},
135 {
"observationDirections",
"observationDirections2", DESCRIPTOR},
136 {
"color",
"red", DESCRIPTOR},
137 {
"color",
"green", DESCRIPTOR},
138 {
"color",
"blue", DESCRIPTOR},
139 {
"color",
"alpha", DESCRIPTOR},
140 {
"eigValues",
"eigValues0", DESCRIPTOR},
141 {
"eigValues",
"eigValues1", DESCRIPTOR},
142 {
"eigValues",
"eigValues2", DESCRIPTOR},
143 {
"eigVectors",
"eigVectors0X", DESCRIPTOR},
144 {
"eigVectors",
"eigVectors0Y", DESCRIPTOR},
145 {
"eigVectors",
"eigVectors0Z", DESCRIPTOR},
146 {
"eigVectors",
"eigVectors1X", DESCRIPTOR},
147 {
"eigVectors",
"eigVectors1Y", DESCRIPTOR},
148 {
"eigVectors",
"eigVectors1Z", DESCRIPTOR},
149 {
"eigVectors",
"eigVectors2X", DESCRIPTOR},
150 {
"eigVectors",
"eigVectors2Y", DESCRIPTOR},
151 {
"eigVectors",
"eigVectors2Z", DESCRIPTOR},
152 {
"intensity",
"intensity", DESCRIPTOR},
154 {
"time",
"time", TIME}
171 void add(
const std::string internalName,
const unsigned int dim);
175 Labels getLabels()
const;
183 static DataPoints
loadCSV(
const std::string& fileName);
184 static DataPoints
loadCSV(std::istream& is);
186 static void saveCSV(
const DataPoints& data,
const std::string& fileName);
187 static void saveCSV(
const DataPoints& data, std::ostream& os);
202 Eigen::Matrix<unsigned int, Eigen::Dynamic, Eigen::Dynamic> high32;
205 Eigen::Matrix<unsigned int, Eigen::Dynamic, Eigen::Dynamic>
low32;
208 SplitTime(): isHigh32Found(false), isLow32Found(false){};
212 static DataPoints
loadVTK(
const std::string& fileName);
213 static DataPoints
loadVTK(std::istream& is);
215 static void saveVTK(
const DataPoints& data,
const std::string& fileName,
bool binary =
false);
218 static DataPoints
loadPLY(
const std::string& fileName);
219 static DataPoints
loadPLY(std::istream& is);
221 static void savePLY(
const DataPoints& data,
const std::string& fileName);
224 static DataPoints
loadPCD(
const std::string& fileName);
225 static DataPoints
loadPCD(std::istream& is);
227 static void savePCD(
const DataPoints& data,
const std::string& fileName);
241 FileInfo(
const std::string& readingPath=
"",
const std::string& referencePath=
"",
const std::string& configFileName=
"",
const TransformationParameters& initialTransformation=
TransformationParameters(),
const TransformationParameters& groundTruthTransformation=
TransformationParameters(),
const Vector& gravity=Vector3::Zero());
248 FileInfoVector(
const std::string& fileName, std::string dataPath =
"", std::string configPath =
"");
251 std::string localToGlobalFileName(
const std::string& path,
const std::string& fileName);
283 PLYProperty(
const std::string& type,
const std::string& name,
const unsigned pos);
286 PLYProperty(
const std::string& idx_type,
const std::string& type,
const std::string& name,
const unsigned pos);
323 PLYElement(
const std::string& name,
const unsigned num,
const unsigned offset) :
324 name(name), num(num), total_props(0), offset(offset), nbFeatures(0), nbDescriptors(0) {}
328 bool operator==(
const PLYElement& other)
const;
357 static ElementTypes getElementType(
const std::string& elem_name);
359 bool elementSupported(
const std::string& elem_name);
360 static PLYElement* createElement(
const std::string& elem_name,
const int elem_num,
const unsigned offset);
382 pmType = UNSUPPORTED;
403 viewPoint = Eigen::Matrix<T, 7, 1>::Zero();
411 #endif // __POINTMATCHER_IO_H A vector of Label.
Definition: PointMatcher.h:221
int pmRowID
row id used in a DataPoints
Definition: IO.h:278
TransformationParameters initialTransformation
matrix of initial estimate transform
Definition: IO.h:237
bool is_list
member is true of property is a list
Definition: IO.h:274
unsigned int size
Size of the property in bytes.
Definition: IO.h:367
IO Functions and classes that are dependant on scalar type are defined in this templatized class...
Definition: IO.h:43
unsigned int count
number of dimension
Definition: IO.h:369
unsigned pos
index of the property in element
Definition: IO.h:273
unsigned span
number of columns spanned by descriptor
Definition: IO.h:260
std::string referenceFileName
file name of the reference point cloud
Definition: IO.h:235
std::string readingFileName
file name of the reading point cloud
Definition: IO.h:234
static DataPoints loadPLY(const std::string &fileName)
Load polygon file format (ply) file.
Definition: IO.cpp:1287
A point cloud.
Definition: PointMatcher.h:199
std::string name
name of descriptor
Definition: IO.h:258
static DataPoints loadPCD(const std::string &fileName)
Load Point Cloud Library (pcd) file.
Definition: IO.cpp:1847
std::vector< SupportedLabel > SupportedLabels
Vector of supported labels in PointMatcher and their external names.
Definition: IO.h:84
PointMatcher< T >::DataPoints::Labels Labels
alias
Definition: IO.h:52
std::string configFileName
file name of the yaml configuration
Definition: IO.h:236
std::string type
type of PLY property
Definition: IO.h:271
Factory for PLY elements.
Definition: IO.h:349
PLYElement(const std::string &name, const unsigned num, const unsigned offset)
PLY Element constructor.
Definition: IO.h:323
static bool plyPropTypeValid(const std::string &type)
Check that property defined by type is a valid PLY type note: type must be lowercase.
Definition: IO.cpp:1823
static void savePLY(const DataPoints &data, const std::string &fileName)
save datapoints to PLY point cloud format
Definition: IO.cpp:1653
static void saveVTK(const DataPoints &data, const std::string &fileName, bool binary=false)
Save point cloud to a file as VTK.
Definition: IO.cpp:1261
std::string name
name identifying the PLY element
Definition: IO.h:305
std::string name
name of PLY property
Definition: IO.h:270
bool isHigh32Found
was the high 32bits found in the file
Definition: IO.h:200
SplitTime()
Constructor.
Definition: IO.h:208
The name for a certain number of dim.
Definition: PointMatcher.h:213
std::string field
Name of the property.
Definition: IO.h:366
static DataPoints loadCSV(const std::string &fileName)
Associate an external name to a DataPoints type of information.
Definition: IO.cpp:408
PointMatcher< T >::TransformationParameters TransformationParameters
alias
Definition: IO.h:49
std::map< std::string, std::vector< std::string > > CsvElements
Data from a CSV file.
Definition: PointMatcher.h:117
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
A dense matrix over ScalarType.
Definition: PointMatcher.h:161
PointMatcher< T >::Vector Vector
alias
Definition: IO.h:45
PLYProperty()
Default constructor. If used member values must be filled later.
Definition: IO.h:280
static const SupportedLabels & getSupportedExternalLabels()
Vector containing the mapping of all external names to PointMatcher representation.
Definition: IO.h:117
PMPropTypes pmType
type of information in PointMatcher
Definition: IO.h:277
PointMatcher< T >::DataPoints::Label Label
alias
Definition: IO.h:51
unsigned num
number of occurences of the element
Definition: IO.h:306
PLYVertex(const unsigned num, const unsigned offset)
Constructor.
Definition: IO.h:344
PLYProperties properties
all properties found in the header
Definition: IO.h:309
Eigen::Matrix< T, 3, 1 > Vector3
alias
Definition: IO.h:232
static void saveCSV(const DataPoints &data, const std::string &fileName)
Save point cloud to a file as CSV.
Definition: IO.cpp:836
Information for a PCD property.
Definition: IO.h:364
PMPropTypes type
type of information in PointMatcher
Definition: IO.h:77
PMPropTypes pmType
type of information in PointMatcher
Definition: IO.h:372
PointMatcher< T >::Matrix Matrix
alias
Definition: IO.h:46
bool isLow32Found
was the low 32bits found in the file
Definition: IO.h:201
Eigen::Matrix< unsigned int, Eigen::Dynamic, Eigen::Dynamic > low32
Matrix containing file data representing the low 32 bits.
Definition: IO.h:205
std::string idx_type
for list properties, type of number of elements
Definition: IO.h:272
static void savePCD(const DataPoints &data, const std::string &fileName)
save datapoints to PCD point cloud format
Definition: IO.cpp:2257
unsigned start_col
column number at which descriptor starts
Definition: IO.h:259
PointMatcher< T >::Int64Matrix Int64Matrix
alias
Definition: IO.h:47
A structure to hold information about descriptors contained in a CSV file.
Definition: IO.h:257
Eigen::Matrix< std::int64_t, Eigen::Dynamic, Eigen::Dynamic > Int64Matrix
A dense signed 64-bits matrix.
Definition: PointMatcher.h:165
Information to exploit a reading from a file using this library. Fields might be left blank if unused...
Definition: IO.h:230
PointMatcher< T >::Matrix Parameters
alias
Definition: IO.h:50
unsigned total_props
total number of properties in PLY element
Definition: IO.h:307
SupportedVTKDataTypes
Enumeration of legacy VTK data types that can be parsed.
Definition: IO.h:191
unsigned nbDescriptors
number of valid descriptors found in the header
Definition: IO.h:311
Storage for time loaded separatly.
Definition: IO.h:198
unsigned nbFeatures
number of valid features found in the header
Definition: IO.h:310
TransformationParameters groundTruthTransformation
matrix of the ground-truth transform
Definition: IO.h:238
char type
Type: I: signed, U: unsigned, F: float.
Definition: IO.h:368
std::pair< int, std::string > LabelAssociationPair
Pair feature column, feature name.
Definition: IO.h:55
std::map< std::string, LabelAssociationPair > SublabelAssociationMap
Map to associate common descriptor sublabels to PM descriptor matrix row and labels ex: nx...
Definition: IO.h:59
static std::string getColLabel(const Label &label, const int row)
convert a descriptor label to an appropriate sub-label
Definition: IO.cpp:469
Structure containing all information required to map external information to PointMatcher internal re...
Definition: IO.h:73
A vector of file info, to be used in batch processing.
Definition: IO.h:245
Generate a vector of Labels by checking for collision is the same name is reused. ...
Definition: IO.h:162
Interface for PLY property.
Definition: IO.h:267
PLYProperties::iterator it_PLYProp
Iterator for a vector of PLY properties.
Definition: IO.h:299
PointMatcher< T >::DataPoints DataPoints
alias
Definition: IO.h:48
int pmRowID
row id used in a DataPoints
Definition: IO.h:373
PMPropTypes
Type of information in a DataPoints. Each type is stored in its own dense matrix. ...
Definition: IO.h:64
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
A vector over ScalarType.
Definition: PointMatcher.h:153
PCDproperty()
Empty constructor.
Definition: IO.h:376
std::string internalName
name used in PointMatcher
Definition: IO.h:75
Vector3 gravity
gravity vector
Definition: IO.h:239
std::map< std::string, std::vector< PLYProperty > > PLYDescPropMap
Map from a descriptor name to a list PLY property ex: "normals" -> nx, ny ,nz.
Definition: IO.h:293
Implementation of PLY vertex element.
Definition: IO.h:334
Interface for all PLY elements.
Definition: IO.h:302
std::string externalName
name used in external format
Definition: IO.h:76
Matrix TransformationParameters
A matrix holding the parameters a transformation.
Definition: PointMatcher.h:174
std::vector< PLYProperty > PLYProperties
Vector of properties specific to PLY files.
Definition: IO.h:296
unsigned offset
line at which data starts
Definition: IO.h:308
static DataPoints loadVTK(const std::string &fileName)
Load point cloud from a file as VTK.
Definition: IO.cpp:910
SupportedLabel(const std::string &internalName, const std::string &externalName, const PMPropTypes &type)
Constructor.
Definition: IO.cpp:418