Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef __POINTMATCHER_IO_H
00037 #define __POINTMATCHER_IO_H
00038
00039 #include "PointMatcher.h"
00040
00042 template<typename T>
00043 struct PointMatcherIO
00044 {
00045 typedef typename PointMatcher<T>::Vector Vector;
00046 typedef typename PointMatcher<T>::Matrix Matrix;
00047 typedef typename PointMatcher<T>::DataPoints DataPoints;
00048 typedef typename PointMatcher<T>::TransformationParameters TransformationParameters;
00049 typedef typename PointMatcher<T>::Matrix Parameters;
00050
00051
00052
00053 static DataPoints loadCSV(const std::string& fileName);
00054 static DataPoints loadCSV(std::istream& is);
00055
00056 static void saveCSV(const DataPoints& data, const std::string& fileName);
00057 static void saveCSV(const DataPoints& data, std::ostream& os);
00058
00059
00060
00061 static DataPoints loadVTK(const std::string& fileName);
00062 static DataPoints loadVTK(std::istream& is);
00063
00064 static void saveVTK(const DataPoints& data, const std::string& fileName);
00065
00067 struct FileInfo
00068 {
00069 typedef Eigen::Matrix<T, 3, 1> Vector3;
00070
00071 std::string readingFileName;
00072 std::string referenceFileName;
00073 std::string configFileName;
00074 TransformationParameters initialTransformation;
00075 TransformationParameters groundTruthTransformation;
00076 Vector3 gravity;
00077
00078 FileInfo(const std::string& readingPath="", const std::string& referencePath="", const std::string& configFileName="", const TransformationParameters& initialTransformation=TransformationParameters(), const TransformationParameters& groundTruthTransformation=TransformationParameters(), const Vector& grativity=Vector3::Zero());
00079 };
00080
00082 struct FileInfoVector: public std::vector<FileInfo>
00083 {
00084 FileInfoVector();
00085 FileInfoVector(const std::string& fileName, std::string dataPath = "", std::string configPath = "");
00086
00087 protected:
00088 std::string localToGlobalFileName(const std::string& path, const std::string& fileName);
00089 bool findTransform(const PointMatcherSupport::CsvElements& data, const std::string& prefix, unsigned dim);
00090 TransformationParameters getTransform(const PointMatcherSupport::CsvElements& data, const std::string& prefix, unsigned dim, unsigned line);
00091 };
00092 };
00093
00094 #endif // __POINTMATCHER_IO_H