40 #include <opencv2/core/core.hpp> 41 #include <opencv2/highgui/highgui.hpp> 43 #include <H5Tpublic.h> 55 class HDF5IO :
public BaseIO,
public AttributeMeshIOBase
110 bool open(std::string filename,
int open_flag);
118 std::vector<ScanPtr>
getRawScans(
bool load_points =
true);
120 std::vector<std::vector<ScanImage> >
getRawCamData(
bool load_image_data =
true);
123 int nr,
unsigned int& n,
unsigned& w);
128 std::string groupName, std::string name, cv::Mat& img);
161 std::string groupName, std::string datasetName,
166 std::string groupName, std::string datasetName,
167 std::vector<size_t>& dim);
171 std::string groupName,
172 std::string datasetName,
174 boost::shared_array<T> data);
178 std::string groupName,
179 std::string datasetName,
180 std::vector<size_t>& dimensions,
181 boost::shared_array<T> data);
185 std::string groupName,
186 std::string datasetName,
187 std::vector<size_t>& dimensions,
188 std::vector<hsize_t>& chunkSize,
189 boost::shared_array<T> data);
217 template <
typename T>
247 template <
typename T>
277 boost::optional<HighFive::Group>
getMeshGroup(
bool create =
false);
286 std::string datasetName,
287 std::vector<size_t>& dim,
288 std::vector<hsize_t>& chunkSize,
289 boost::shared_array<T>& data);
297 std::vector<std::string>
splitGroupNames(
const std::string &groupName);
299 bool exist(
const std::string &groupName);
310 template <
typename T>
311 boost::shared_array<T>
reduceData(boost::shared_array<T> data,
314 unsigned int reductionFactor,
315 size_t *reducedDataCount);
329 #include "HDF5IO.tcc" void setCompress(bool compress)
bool readPointCloud(ModelPtr model_ptr)
bool deleteDataset(const char *name)
deletes a dataset permanently from the hdf file
void addRawCamData(int scan_id, int img_id, ScanImage &cam_data)
add recorded image referenced to a scan pose
Datastructures for holding loaded data.
void addArray(std::string groupName, std::string datasetName, unsigned int size, boost::shared_array< T > data)
virtual void save(std::string filename)
Save the loaded elements to the given file.
bool readMesh(ModelPtr model_ptr)
A 4x4 matrix class implementation for use with the provided vertex types.
void setPreviewReductionFactor(const unsigned int factor)
virtual ModelPtr read(std::string filename)
Parse the given file and load supported elements.
static const std::string indices_name
HighFive::File * m_hdf5_file
static const int ReadWrite
Open flag: Read Write access.
Texture getImage(std::string groupName, std::string datasetName)
void addRawDataHeader(std::string description, Matrix4< BaseVector< float >> &referenceFrame)
unsigned int m_previewReductionFactor
virtual bool addVertices(const FloatChannel &channel_ptr)
Persistence layer interface, Writes the vertices of the mesh to the persistence layer.
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
std::vector< ScanPtr > getRawScans(bool load_points=true)
void setUsePreviews(bool use)
UCharChannel::Optional UCharChannelOptional
void addImage(std::string groupName, std::string name, cv::Mat &img)
static const int ReadOnly
Open flag: Read only access.
std::vector< std::vector< ScanImage > > getRawCamData(bool load_image_data=true)
bool isGroup(HighFive::Group grp, std::string objName)
virtual bool addIndices(const IndexChannel &channel_ptr)
Persistence layer interface, Writes the face indices of the mesh to the persistence layer...
boost::shared_array< T > reduceData(boost::shared_array< T > data, size_t dataCount, size_t dataWidth, unsigned int reductionFactor, size_t *reducedDataCount)
BaseHDF5IO::AddFeatures< lvr2::hdf5features::ScanProjectIO, lvr2::hdf5features::ArrayIO > HDF5IO
virtual FloatChannelOptional getVertices()
Persistence layer interface, Accesses the vertices of the mesh in the persistence layer...
boost::shared_array< T > getArray(std::string groupName, std::string datasetName, unsigned int &size)
This class represents a texture.
boost::shared_array< float > floatArr
bool saveMesh(ModelPtr model_ptr)
std::vector< std::string > splitGroupNames(const std::string &groupName)
floatArr getFloatChannelFromRawScan(std::string name, int nr, unsigned int &n, unsigned &w)
FloatChannel::Optional FloatChannelOptional
void addFloatChannelToRawScan(std::string name, int nr, size_t n, unsigned w, floatArr data)
Base interface for all I/O related classes.
static const std::string vertices_name
std::shared_ptr< Model > ModelPtr
IndexChannel::Optional IndexChannelOptional
bool exist(const std::string &groupName)
static const std::string meshes_group
virtual IndexChannelOptional getIndices()
Persistence layer interface, Accesses the face indices of the mesh in the persistence layer...
bool getChannel(const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel)
void write_base_structure()
bool open(std::string filename, int open_flag)
HighFive::Group getGroup(const std::string &groupName, bool create=true)
bool addChannel(const std::string group, const std::string name, const AttributeChannel< T > &channel)
HDF5IO()
Construct a new HDF5IO object. Do not use this. Only used by ModelFactory.
ScanPtr getSingleRawScan(int nr, bool load_points=true)
void addRawScan(int nr, ScanPtr scan)
ScanImage getSingleRawCamData(int scan_id, int img_id, bool load_image_data=true)
boost::optional< HighFive::Group > getMeshGroup(bool create=false)
void setChunkSize(const size_t &size)