#include <HDF5IO.hpp>
Public Member Functions | |
template<typename T > | |
void | addArray (std::string groupName, std::string datasetName, unsigned int size, boost::shared_array< T > data) |
template<typename T > | |
void | addArray (std::string groupName, std::string datasetName, std::vector< size_t > &dimensions, boost::shared_array< T > data) |
template<typename T > | |
void | addArray (std::string groupName, std::string datasetName, std::vector< size_t > &dimensions, std::vector< hsize_t > &chunkSize, boost::shared_array< T > data) |
void | addFloatChannelToRawScan (std::string name, int nr, size_t n, unsigned w, floatArr data) |
void | addImage (std::string groupName, std::string name, cv::Mat &img) |
void | addRawCamData (int scan_id, int img_id, ScanImage &cam_data) |
add recorded image referenced to a scan pose More... | |
void | addRawDataHeader (std::string description, Matrix4< BaseVector< float >> &referenceFrame) |
void | addRawScan (int nr, ScanPtr scan) |
size_t | chunkSize () |
bool | compress () |
bool | deleteDataset (const char *name) |
deletes a dataset permanently from the hdf file More... | |
template<typename T > | |
boost::shared_array< T > | getArray (std::string groupName, std::string datasetName, unsigned int &size) |
template<typename T > | |
boost::shared_array< T > | getArray (std::string groupName, std::string datasetName, std::vector< size_t > &dim) |
floatArr | getFloatChannelFromRawScan (std::string name, int nr, unsigned int &n, unsigned &w) |
Texture | getImage (std::string groupName, std::string datasetName) |
std::vector< std::vector< ScanImage > > | getRawCamData (bool load_image_data=true) |
std::vector< ScanPtr > | getRawScans (bool load_points=true) |
ScanImage | getSingleRawCamData (int scan_id, int img_id, bool load_image_data=true) |
ScanPtr | getSingleRawScan (int nr, bool load_points=true) |
HDF5IO (HDF5KernelPtr kernel, HDF5SchemaPtr schema) | |
HDF5IO () | |
Construct a new HDF5IO object. Do not use this. Only used by ModelFactory. More... | |
HDF5IO (std::string filename, int open_flags=HighFive::File::ReadWrite) | |
HDF5IO (const std::string filename, const std::string part_name, int open_flags=HighFive::File::ReadOnly) | |
Constructs a HDFIO io object to read a HDF5 file with the given filename. It accesses the mesh or point cloud with the given part name. The selected part can then be read and write to and from a Model pointer. This will automatically load and store all provided channels. The channels will be loaded if one accessing them in a lazy fashion. More... | |
ScanProjectPtr | loadScanProject () |
bool | open (std::string filename, int open_flag) |
virtual ModelPtr | read (std::string filename) |
Parse the given file and load supported elements. More... | |
ModelPtr | read (std::string filename, size_t scanNr) |
bool | readMesh (ModelPtr model_ptr) |
bool | readPointCloud (ModelPtr model_ptr) |
virtual void | save (std::string filename) |
Save the loaded elements to the given file. More... | |
virtual void | save (ModelPtr model, std::string filename) |
Set the model and save the loaded elements to the given file. More... | |
bool | saveMesh (ModelPtr model_ptr) |
void | saveScanProject (ScanProjectPtr project) |
void | setChunkSize (const size_t &size) |
void | setCompress (bool compress) |
void | setPreviewReductionFactor (const unsigned int factor) |
void | setUsePreviews (bool use) |
virtual | ~HDF5IO () |
Public Member Functions inherited from lvr2::BaseIO | |
BaseIO () | |
virtual ModelPtr | getModel () |
Get the model for io operations. More... | |
virtual void | setModel (ModelPtr m) |
Set the model for io operations to use. More... | |
virtual | ~BaseIO () |
Public Member Functions inherited from lvr2::AttributeMeshIOBase | |
template<typename MapT > | |
bool | addAttributeMap (const MapT &map, const std::string &name) |
addAttributeMap Stores a general attribute map to the persistence layer where the attribute group is defined by the given map type. Note, that the map keys are also stored, if you want to store a dense attribute map, please see addDenseAttributeMap. More... | |
template<typename MapT , typename BaseVecT > | |
bool | addDenseAttributeMap (const BaseMesh< BaseVecT > &mesh, const MapT &map, const std::string &name) |
addDenseAttributeMap Stores a dense attribute map to the persistence layer where the attribute group is defined by the given map type. More... | |
template<typename MapT > | |
bool | addDenseAttributeMap (const MapT &map, const std::string &name) |
addDenseAttributeMap Stores a dense attribute map to the persistence layer where the attribute group is defined by the given map type. More... | |
bool | addMesh (const HalfEdgeMesh< BaseVec > &hem) |
Adds a HalfEdgeMesh to the persistence layer. More... | |
template<typename MapT > | |
boost::optional< MapT > | getAttributeMap (const std::string &name) |
getAttributeMap Reads a general attribute map from the persistence layer where the attribute group is defined by the given map type. Note, that the map keys have to be available in the persistence layer. If you want to load a DenseAttributeMap, please use getDenseAttributeMap. More... | |
template<typename MapT > | |
boost::optional< MapT > | getDenseAttributeMap (const std::string &name) |
getDenseAttributeMap Reads a dense attribute map from the persistence layer where the attribute group is defined by the given map type. More... | |
boost::optional< HalfEdgeMesh< BaseVec > > | getMesh () |
Reads a HalfEdgeMesh from the persistence layer. More... | |
Public Member Functions inherited from lvr2::GroupedChannelIO | |
virtual bool | getChannel (const std::string group, const std::string name, FloatChannelOptional &channel)=0 |
getChannel Reads a float attribute channel in the given group with the given name More... | |
virtual bool | getChannel (const std::string group, const std::string name, FloatChannelOptional &channel)=0 |
getChannel Reads a float attribute channel in the given group with the given name More... | |
Static Public Attributes | |
static const std::string | indices_name = "indices" |
static const std::string | meshes_group = "meshes" |
static const std::string | vertices_name = "vertices" |
Private Member Functions | |
template<typename T > | |
void | addArray (HighFive::Group &g, std::string datasetName, std::vector< size_t > &dim, std::vector< hsize_t > &chunkSize, boost::shared_array< T > &data) |
template<typename T > | |
bool | addChannel (const std::string group, const std::string name, const AttributeChannel< T > &channel) |
virtual bool | addChannel (const std::string group, const std::string name, const FloatChannel &channel) |
addChannel Writes a float attribute channel from the given group with the given name More... | |
virtual bool | addChannel (const std::string group, const std::string name, const IndexChannel &channel) |
addChannel Writes an index attribute channel from the given group with the given name More... | |
virtual bool | addChannel (const std::string group, const std::string name, const UCharChannel &channel) |
addChannel Writes an unsigned char attribute channel from the given group with the given name More... | |
void | addImage (HighFive::Group &g, std::string datasetName, cv::Mat &img) |
virtual bool | addIndices (const IndexChannel &channel_ptr) |
Persistence layer interface, Writes the face indices of the mesh to the persistence layer. More... | |
virtual bool | addVertices (const FloatChannel &channel_ptr) |
Persistence layer interface, Writes the vertices of the mesh to the persistence layer. More... | |
bool | exist (const std::string &groupName) |
template<typename T > | |
boost::shared_array< T > | getArray (HighFive::Group &g, std::string datasetName, std::vector< size_t > &dim) |
template<typename T > | |
bool | getChannel (const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel) |
virtual bool | getChannel (const std::string group, const std::string name, FloatChannelOptional &channel) |
getChannel Reads a float attribute channel in the given group with the given name More... | |
virtual bool | getChannel (const std::string group, const std::string name, IndexChannelOptional &channel) |
getChannel Reads an index attribute channel in the given group with the given name More... | |
virtual bool | getChannel (const std::string group, const std::string name, UCharChannelOptional &channel) |
getChannel Reads an unsigned char attribute channel in the given group with the given name More... | |
HighFive::Group | getGroup (const std::string &groupName, bool create=true) |
HighFive::Group | getGroup (HighFive::Group &g, const std::string &groupName, bool create=true) |
Texture | getImage (HighFive::Group &g, std::string datasetName) |
void | getImage (HighFive::Group &g, std::string datasetName, cv::Mat &img) |
virtual IndexChannelOptional | getIndices () |
Persistence layer interface, Accesses the face indices of the mesh in the persistence layer. More... | |
boost::optional< HighFive::Group > | getMeshGroup (bool create=false) |
virtual FloatChannelOptional | getVertices () |
Persistence layer interface, Accesses the vertices of the mesh in the persistence layer. More... | |
bool | isGroup (HighFive::Group grp, std::string objName) |
template<typename T > | |
boost::shared_array< T > | reduceData (boost::shared_array< T > data, size_t dataCount, size_t dataWidth, unsigned int reductionFactor, size_t *reducedDataCount) |
std::vector< std::string > | splitGroupNames (const std::string &groupName) |
void | write_base_structure () |
Private Attributes | |
size_t | m_chunkSize |
bool | m_compress |
HighFive::File * | m_hdf5_file |
HDF5KernelPtr | m_kernel |
std::string | m_mesh_path |
std::string | m_part_name |
unsigned int | m_previewReductionFactor |
HDF5SchemaPtr | m_schema |
bool | m_usePreviews |
Additional Inherited Members | |
Protected Attributes inherited from lvr2::BaseIO | |
ModelPtr | m_model |
Definition at line 13 of file descriptions/HDF5IO.hpp.
lvr2::HDF5IO::HDF5IO | ( | HDF5KernelPtr | kernel, |
HDF5SchemaPtr | schema | ||
) |
Definition at line 6 of file descriptions/HDF5IO.cpp.
|
inline |
Construct a new HDF5IO object. Do not use this. Only used by ModelFactory.
Definition at line 93 of file HDF5IO.hpp.
lvr2::HDF5IO::HDF5IO | ( | std::string | filename, |
int | open_flags = HighFive::File::ReadWrite |
||
) |
Definition at line 59 of file HDF5IO.cpp.
lvr2::HDF5IO::HDF5IO | ( | const std::string | filename, |
const std::string | part_name, | ||
int | open_flags = HighFive::File::ReadOnly |
||
) |
Constructs a HDFIO io object to read a HDF5 file with the given filename. It accesses the mesh or point cloud with the given part name. The selected part can then be read and write to and from a Model pointer. This will automatically load and store all provided channels. The channels will be loaded if one accessing them in a lazy fashion.
filename | The HDF5 file filename |
part_name | The part in the HDF5 file which should be saved or loaded. |
open_flag | Open flags: See the HighFive::File open flags |
Definition at line 43 of file HDF5IO.cpp.
|
virtual |
Definition at line 70 of file HDF5IO.cpp.
void lvr2::HDF5IO::addArray | ( | std::string | groupName, |
std::string | datasetName, | ||
unsigned int | size, | ||
boost::shared_array< T > | data | ||
) |
void lvr2::HDF5IO::addArray | ( | std::string | groupName, |
std::string | datasetName, | ||
std::vector< size_t > & | dimensions, | ||
boost::shared_array< T > | data | ||
) |
void lvr2::HDF5IO::addArray | ( | std::string | groupName, |
std::string | datasetName, | ||
std::vector< size_t > & | dimensions, | ||
std::vector< hsize_t > & | chunkSize, | ||
boost::shared_array< T > | data | ||
) |
|
private |
|
private |
|
privatevirtual |
addChannel Writes a float attribute channel from the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the float channel which should be written |
Implements lvr2::GroupedChannelIO.
Definition at line 1214 of file HDF5IO.cpp.
|
privatevirtual |
addChannel Writes an index attribute channel from the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the index channel which should be written |
Implements lvr2::GroupedChannelIO.
|
privatevirtual |
addChannel Writes an unsigned char attribute channel from the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the unsigned char channel which should be written |
Implements lvr2::GroupedChannelIO.
void lvr2::HDF5IO::addFloatChannelToRawScan | ( | std::string | name, |
int | nr, | ||
size_t | n, | ||
unsigned | w, | ||
floatArr | data | ||
) |
Definition at line 720 of file HDF5IO.cpp.
void lvr2::HDF5IO::addImage | ( | std::string | groupName, |
std::string | name, | ||
cv::Mat & | img | ||
) |
Definition at line 674 of file HDF5IO.cpp.
|
private |
Definition at line 683 of file HDF5IO.cpp.
|
privatevirtual |
Persistence layer interface, Writes the face indices of the mesh to the persistence layer.
Implements lvr2::MeshGeometryIO.
Definition at line 1194 of file HDF5IO.cpp.
void lvr2::HDF5IO::addRawCamData | ( | int | scan_id, |
int | img_id, | ||
ScanImage & | cam_data | ||
) |
add recorded image referenced to a scan pose
Definition at line 927 of file HDF5IO.cpp.
void lvr2::HDF5IO::addRawDataHeader | ( | std::string | description, |
Matrix4< BaseVector< float >> & | referenceFrame | ||
) |
Definition at line 979 of file HDF5IO.cpp.
void lvr2::HDF5IO::addRawScan | ( | int | nr, |
ScanPtr | scan | ||
) |
Definition at line 799 of file HDF5IO.cpp.
|
privatevirtual |
Persistence layer interface, Writes the vertices of the mesh to the persistence layer.
Implements lvr2::MeshGeometryIO.
Definition at line 1187 of file HDF5IO.cpp.
size_t lvr2::HDF5IO::chunkSize | ( | ) |
Definition at line 116 of file HDF5IO.cpp.
bool lvr2::HDF5IO::compress | ( | ) |
Definition at line 105 of file HDF5IO.cpp.
bool lvr2::HDF5IO::deleteDataset | ( | const char * | name | ) |
deletes a dataset permanently from the hdf file
name | name of the dataset that gets deleted |
Definition at line 110 of file HDF5IO.cpp.
|
private |
Definition at line 1092 of file HDF5IO.cpp.
boost::shared_array<T> lvr2::HDF5IO::getArray | ( | std::string | groupName, |
std::string | datasetName, | ||
unsigned int & | size | ||
) |
boost::shared_array<T> lvr2::HDF5IO::getArray | ( | std::string | groupName, |
std::string | datasetName, | ||
std::vector< size_t > & | dim | ||
) |
|
private |
|
private |
|
privatevirtual |
getChannel Reads a float attribute channel in the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the float channel |
Definition at line 1202 of file HDF5IO.cpp.
|
privatevirtual |
getChannel Reads an index attribute channel in the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the index channel |
Implements lvr2::GroupedChannelIO.
Definition at line 1206 of file HDF5IO.cpp.
|
privatevirtual |
getChannel Reads an unsigned char attribute channel in the given group with the given name
group | The associated attribute group |
name | The associated attribute name |
channel | The pointer to the unsigned char channel |
Implements lvr2::GroupedChannelIO.
floatArr lvr2::HDF5IO::getFloatChannelFromRawScan | ( | std::string | name, |
int | nr, | ||
unsigned int & | n, | ||
unsigned & | w | ||
) |
Definition at line 644 of file HDF5IO.cpp.
|
private |
Definition at line 1012 of file HDF5IO.cpp.
|
private |
Definition at line 1052 of file HDF5IO.cpp.
Texture lvr2::HDF5IO::getImage | ( | std::string | groupName, |
std::string | datasetName | ||
) |
Definition at line 360 of file HDF5IO.cpp.
|
private |
Definition at line 377 of file HDF5IO.cpp.
|
private |
Definition at line 700 of file HDF5IO.cpp.
|
privatevirtual |
Persistence layer interface, Accesses the face indices of the mesh in the persistence layer.
Implements lvr2::MeshGeometryIO.
Definition at line 1172 of file HDF5IO.cpp.
|
private |
Definition at line 1146 of file HDF5IO.cpp.
std::vector< std::vector< ScanImage > > lvr2::HDF5IO::getRawCamData | ( | bool | load_image_data = true | ) |
Definition at line 466 of file HDF5IO.cpp.
std::vector< ScanPtr > lvr2::HDF5IO::getRawScans | ( | bool | load_points = true | ) |
Definition at line 414 of file HDF5IO.cpp.
ScanImage lvr2::HDF5IO::getSingleRawCamData | ( | int | scan_id, |
int | img_id, | ||
bool | load_image_data = true |
||
) |
Definition at line 591 of file HDF5IO.cpp.
ScanPtr lvr2::HDF5IO::getSingleRawScan | ( | int | nr, |
bool | load_points = true |
||
) |
Definition at line 507 of file HDF5IO.cpp.
|
privatevirtual |
Persistence layer interface, Accesses the vertices of the mesh in the persistence layer.
Implements lvr2::MeshGeometryIO.
Definition at line 1156 of file HDF5IO.cpp.
|
private |
Definition at line 1129 of file HDF5IO.cpp.
ScanProjectPtr lvr2::HDF5IO::loadScanProject | ( | ) |
Definition at line 21 of file descriptions/HDF5IO.cpp.
bool lvr2::HDF5IO::open | ( | std::string | filename, |
int | open_flag | ||
) |
Definition at line 232 of file HDF5IO.cpp.
|
virtual |
Parse the given file and load supported elements.
filename | The file to read. |
Implements lvr2::BaseIO.
Definition at line 121 of file HDF5IO.cpp.
ModelPtr lvr2::HDF5IO::read | ( | std::string | filename, |
size_t | scanNr | ||
) |
bool lvr2::HDF5IO::readMesh | ( | ModelPtr | model_ptr | ) |
Definition at line 191 of file HDF5IO.cpp.
bool lvr2::HDF5IO::readPointCloud | ( | ModelPtr | model_ptr | ) |
Definition at line 146 of file HDF5IO.cpp.
|
private |
|
virtual |
Save the loaded elements to the given file.
filename | Filename of the file to write. |
Implements lvr2::BaseIO.
Definition at line 282 of file HDF5IO.cpp.
|
virtual |
Set the model and save the loaded elements to the given file.
filename | Filename of the file to write. |
Reimplemented from lvr2::BaseIO.
Definition at line 287 of file HDF5IO.cpp.
bool lvr2::HDF5IO::saveMesh | ( | ModelPtr | model_ptr | ) |
Definition at line 299 of file HDF5IO.cpp.
void lvr2::HDF5IO::saveScanProject | ( | ScanProjectPtr | project | ) |
Definition at line 12 of file descriptions/HDF5IO.cpp.
void lvr2::HDF5IO::setChunkSize | ( | const size_t & | size | ) |
Definition at line 83 of file HDF5IO.cpp.
void lvr2::HDF5IO::setCompress | ( | bool | compress | ) |
Definition at line 78 of file HDF5IO.cpp.
void lvr2::HDF5IO::setPreviewReductionFactor | ( | const unsigned int | factor | ) |
Definition at line 88 of file HDF5IO.cpp.
void lvr2::HDF5IO::setUsePreviews | ( | bool | use | ) |
Definition at line 100 of file HDF5IO.cpp.
|
private |
Definition at line 984 of file HDF5IO.cpp.
|
private |
Definition at line 260 of file HDF5IO.cpp.
|
static |
Definition at line 60 of file HDF5IO.hpp.
|
private |
Definition at line 320 of file HDF5IO.hpp.
|
private |
Definition at line 319 of file HDF5IO.hpp.
|
private |
Definition at line 317 of file HDF5IO.hpp.
|
private |
Definition at line 22 of file descriptions/HDF5IO.hpp.
|
private |
Definition at line 324 of file HDF5IO.hpp.
|
private |
Definition at line 323 of file HDF5IO.hpp.
|
private |
Definition at line 322 of file HDF5IO.hpp.
|
private |
Definition at line 23 of file descriptions/HDF5IO.hpp.
|
private |
Definition at line 321 of file HDF5IO.hpp.
|
static |
Definition at line 61 of file HDF5IO.hpp.
|
static |
Definition at line 59 of file HDF5IO.hpp.