1 #ifndef DIRECTORY_KERNEL_HPP 2 #define DIRECTORY_KERNEL_HPP 4 #include <boost/filesystem.hpp> 23 const std::string& group,
24 const std::string& container,
28 const std::string& group,
29 const std::string& container,
33 const std::string& group,
34 const std::string& container,
35 const cv::Mat& image)
const;
38 const std::string& group,
39 const std::string& metaName,
40 const YAML::Node& node)
const;
43 const std::string& group,
44 const std::string container)
const;
47 const std::string& group,
48 const std::string& container)
const;
50 virtual boost::optional<cv::Mat>
loadImage(
51 const std::string& group,
52 const std::string& container)
const;
55 const std::string& group,
56 const std::string& container,
57 YAML::Node& node)
const;
60 const std::string& group,
61 const std::string& container,
62 std::vector<size_t> &dims)
const;
65 const std::string& group,
66 const std::string& container,
67 std::vector<size_t> &dims)
const;
70 const std::string& group,
71 const std::string& container,
72 std::vector<size_t> &dims)
const;
75 const std::string& groupName,
76 const std::string& datasetName,
77 const std::vector<size_t>& dimensions,
78 const boost::shared_array<float>& data)
const;
81 const std::string& groupName,
const std::string& datasetName,
82 const std::vector<size_t>& dimensions,
83 const boost::shared_array<double>& data)
const;
86 const std::string& groupName,
const std::string& datasetName,
87 const std::vector<size_t>& dimensions,
88 const boost::shared_array<unsigned char>& data)
const;
90 virtual bool exists(
const std::string& group)
const;
91 virtual bool exists(
const std::string& group,
const std::string& container)
const;
94 virtual void subGroupNames(
const std::string& group,
const std::regex&
filter, std::vector<string>& subGroupNames)
const;
98 boost::shared_array<T>
loadArray(
const std::string &group,
const std::string &constainer, std::vector<size_t> &dims)
const 102 size_t length = dims[0];
103 for (
size_t i = 1; i < dims.size(); i++)
111 std::cout <<
timestamp <<
"Warning: DirectoryKernel::LoadArray(): Found zero dim: " << i << std::endl;
114 T *data =
new T[length];
116 for (
size_t i = 0; i < length; i++)
120 return boost::shared_array<T>(data);
122 return boost::shared_array<T>(
nullptr);
125 template <
typename T>
127 const std::string &group,
const std::string &container,
128 const std::vector<size_t> &dims,
const boost::shared_array<T>& data)
const 132 size_t length = dims[0];
133 for (
size_t i = 1; i < dims.size(); i++)
141 std::cout <<
timestamp <<
"Warning: DirectoryKernel::SaveArray(): Found zero dim: " << i << std::endl;
146 for (
size_t i = 0; i < length; i++)
153 boost::filesystem::path
getAbsolutePath(
const std::string &group,
const std::string &name)
const;
virtual void saveFloatArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< float > &data) const
virtual ucharArr loadUCharArray(const std::string &group, const std::string &container, std::vector< size_t > &dims) const
std::shared_ptr< MeshBuffer > MeshBufferPtr
virtual doubleArr loadDoubleArray(const std::string &group, const std::string &container, std::vector< size_t > &dims) const
static Timestamp timestamp
A global time stamp object for program runtime measurement.
boost::shared_array< double > doubleArr
boost::filesystem::path getAbsolutePath(const std::string &group, const std::string &name) const
boost::shared_array< T > loadArray(const std::string &group, const std::string &constainer, std::vector< size_t > &dims) const
boost::shared_array< unsigned char > ucharArr
virtual void savePointBuffer(const std::string &group, const std::string &container, const PointBufferPtr &buffer) const
std::shared_ptr< PointBuffer > PointBufferPtr
virtual void saveMeshBuffer(const std::string &group, const std::string &container, const MeshBufferPtr &buffer) const
virtual void saveMetaYAML(const std::string &group, const std::string &metaName, const YAML::Node &node) const
DirectoryKernel(const std::string &root)
virtual void subGroupNames(const std::string &group, std::vector< string > &subGroupNames) const
virtual void saveImage(const std::string &group, const std::string &container, const cv::Mat &image) const
boost::shared_array< float > floatArr
virtual void loadMetaYAML(const std::string &group, const std::string &container, YAML::Node &node) const
virtual PointBufferPtr loadPointBuffer(const std::string &group, const std::string &container) const
void saveArray(const std::string &group, const std::string &container, const std::vector< size_t > &dims, const boost::shared_array< T > &data) const
void filter(lvr2::PointBufferPtr &cloud, lvr2::indexArray &inlier, size_t j)
virtual bool exists(const std::string &group) const
virtual void saveUCharArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< unsigned char > &data) const
virtual floatArr loadFloatArray(const std::string &group, const std::string &container, std::vector< size_t > &dims) const
std::shared_ptr< DirectoryKernel > DirectoryKernelPtr
virtual ~DirectoryKernel()=default
virtual void saveDoubleArray(const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< double > &data) const
virtual MeshBufferPtr loadMeshBuffer(const std::string &group, const std::string container) const
virtual boost::optional< cv::Mat > loadImage(const std::string &group, const std::string &container) const