7 const std::string &group,
8 const std::string &container,
12 if(!boost::filesystem::exists(
p.parent_path()))
14 boost::filesystem::create_directories(
p.parent_path());
18 model->m_mesh = buffer;
19 std::cout <<
timestamp <<
"Directory Kernel::saveMeshBuffer(): " <<
p.string() << std::endl;
24 const std::string &group,
25 const std::string &container,
29 if(!boost::filesystem::exists(
p.parent_path()))
31 boost::filesystem::create_directories(
p.parent_path());
34 model->m_pointCloud = buffer;
35 std::cout <<
timestamp <<
"Directory Kernel::savePointBuffer(): " <<
p.string() << std::endl;
40 const std::string &group,
41 const std::string &container,
42 const cv::Mat &image)
const
45 if(!boost::filesystem::exists(
p.parent_path()))
47 boost::filesystem::create_directories(
p.parent_path());
49 std::cout <<
timestamp <<
"Directory Kernel::saveImage(): " <<
p.string() << std::endl;
51 cv::imwrite(
p.string(), image);
55 const std::string &group,
56 const std::string &container,
57 const YAML::Node &node)
const
60 if(!boost::filesystem::exists(
p.parent_path()))
62 boost::filesystem::create_directories(
p.parent_path());
64 std::cout <<
timestamp <<
"Directory Kernel::saveMetaYAML(): " <<
p.string() << std::endl;
71 const std::string &group,
72 const std::string container)
const
75 std::cout <<
timestamp <<
"Directory Kernel::loadMeshBuffer(): " <<
p.string() << std::endl;
84 const std::string &group,
85 const std::string &container)
const
88 std::cout <<
timestamp <<
"Directory Kernel::loadPointBuffer(): " <<
p.string() << std::endl;
92 std::cout << model->m_pointCloud << std::endl;
93 std::cout << model->m_pointCloud->numPoints() << std::endl;
94 return model->m_pointCloud;
99 const std::string &group,
100 const std::string &container)
const
103 boost::optional<cv::Mat> opt;
104 std::cout <<
timestamp <<
"Directory Kernel::loadImage: " <<
p.string() << std::endl;
105 if(boost::filesystem::exists(
p))
107 opt = cv::imread(
p.string());
118 const std::string &group,
119 const std::string &container,
123 std::cout <<
timestamp <<
"Directory Kernel::loadMetaYAML: " <<
p.string() << std::endl;
146 boost::filesystem::directory_iterator it(groupPath);
147 while (it != boost::filesystem::directory_iterator{})
149 if (boost::filesystem::is_directory(*it))
159 boost::filesystem::directory_iterator it(groupPath);
160 while (it != boost::filesystem::directory_iterator{})
162 if (boost::filesystem::is_directory(*it))
164 std::string currentName = it->path().string();
165 if (std::regex_match(currentName,
filter))
175 boost::filesystem::path groupPath(group);
176 boost::filesystem::path namePath(name);
178 boost::filesystem::path ret = rootPath / groupPath / namePath;
186 return loadArray<unsigned char>(group, container, dims);
191 return loadArray<float>(group, container, dims);
196 return loadArray<double>(group, container, dims);
199 void DirectoryKernel::saveFloatArray(
const std::string& groupName,
const std::string& datasetName,
const std::vector<size_t>& dimensions,
const boost::shared_array<float>& data)
const
201 saveArray<float>(groupName, datasetName, dimensions, data);
204 void DirectoryKernel::saveDoubleArray(
const std::string& groupName,
const std::string& datasetName,
const std::vector<size_t>& dimensions,
const boost::shared_array<double>& data)
const
206 saveArray<double>(groupName, datasetName, dimensions, data);
209 void DirectoryKernel::saveUCharArray(
const std::string& groupName,
const std::string& datasetName,
const std::vector<size_t>& dimensions,
const boost::shared_array<unsigned char>& data)
const
211 saveArray<unsigned char>(groupName, datasetName, dimensions, data);