MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxels/MRVoxelsLoad.h
Go to the documentation of this file.
1#pragma once
2#include "MRVoxelsFwd.h"
3#include "MRScalarConvert.h"
4#include "MRVoxelsVolume.h"
5
7#include "MRMesh/MRObject.h"
9
10#include <filesystem>
11
12namespace MR
13{
14
15namespace VoxelsLoad
16{
17
21
30MRVOXELS_API Expected<VdbVolume> fromRaw( const std::filesystem::path& file, const RawParameters& params,
31 const ProgressCallback& cb = {} );
34MRVOXELS_API Expected<VdbVolume> fromRaw( std::istream& in, const RawParameters& params,
35 const ProgressCallback& cb = {} );
36
41
43MRVOXELS_API Expected<VdbVolume> fromRaw( const std::filesystem::path& file,
44 const ProgressCallback& cb = {} );
45
47MRVOXELS_API Expected<std::vector<VdbVolume>> fromVdb( const std::filesystem::path& file,
48 const ProgressCallback& cb = {} );
49
51MRVOXELS_API Expected<VdbVolume> fromGav( const std::filesystem::path& file, const ProgressCallback& cb = {} );
53MRVOXELS_API Expected<VdbVolume> fromGav( std::istream& in, const ProgressCallback& cb = {} );
54
55
58 const ProgressCallback& cb = {} );
59
61
62// Determines iso-surface orientation
63enum class GridType
64{
65 // consider values less than iso as outer area
66 DenseGrid = 0,
67 // consider values less than iso as inner area
68 LevelSet = 1
69};
70
71#ifndef MRVOXELS_NO_TIFF
73{
74 std::filesystem::path dir;
75 Vector3f voxelSize = { 1.0f, 1.0f, 1.0f };
78};
81#endif // MRVOXELS_NO_TIFF
82
83#ifndef MR_PARSING_FOR_PB11_BINDINGS
84using VoxelsLoader = Expected<std::vector<VdbVolume>>( * )( const std::filesystem::path&, const ProgressCallback& );
85
87#endif
88
89}
90
93
94MRVOXELS_API Expected<LoadedObjects> makeObjectFromVoxelsFile( const std::filesystem::path& file, const ProgressCallback& callback = {} );
95
96}
#define MR_FORMAT_REGISTRY_EXTERNAL_DECL(API_ATTR, ProcName)
Definition MRIOFormatsRegistry.h:15
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:600
MRVOXELS_API Expected< std::vector< VdbVolume > > fromAnySupportedFormat(const std::filesystem::path &file, const ProgressCallback &cb={})
Detects the format from file extension and loads voxels from it.
MRVOXELS_API Expected< RawParameters > findRawParameters(std::filesystem::path &file)
MRVOXELS_API Expected< VdbVolume > fromGav(const std::filesystem::path &file, const ProgressCallback &cb={})
Load voxel from Gav-file with micro CT reconstruction.
MRVOXELS_API Expected< VdbVolume > fromRaw(const std::filesystem::path &file, const RawParameters &params, const ProgressCallback &cb={})
Load raw voxels from file with provided parameters.
MRVOXELS_API Expected< std::vector< VdbVolume > > fromVdb(const std::filesystem::path &file, const ProgressCallback &cb={})
Load all voxel volumes from OpenVDB file.
MRVOXELS_API Expected< VdbVolume > loadTiffDir(const LoadingTiffSettings &settings)
Load voxels from a set of TIFF files.
GridType
Definition MRVoxels/MRVoxelsLoad.h:64
Expected< std::vector< VdbVolume > >(*)(const std::filesystem::path &, const ProgressCallback &) VoxelsLoader
Definition MRVoxels/MRVoxelsLoad.h:84
MRVOXELS_API Expected< LoadedObjects > makeObjectFromVoxelsFile(const std::filesystem::path &file, const ProgressCallback &callback={})
ScalarType
scalar value's binary format type
Definition MRScalarConvert.h:10
tl::expected< T, E > Expected
Definition MRExpected.h:58
MRVOXELS_API Expected< std::vector< std::shared_ptr< ObjectVoxels > > > makeObjectVoxelsFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads voxels from given file in new object
Definition MRVoxels/MRVoxelsLoad.h:73
GridType gridType
Definition MRVoxels/MRVoxelsLoad.h:76
Vector3f voxelSize
Definition MRVoxels/MRVoxelsLoad.h:75
std::filesystem::path dir
Definition MRVoxels/MRVoxelsLoad.h:74
ProgressCallback cb
Definition MRVoxels/MRVoxelsLoad.h:77
Definition MRVoxels/MRVoxelsLoad.h:23
bool gridLevelSet
OpenVDB GridClass set as GRID_LEVEL_SET (need to set right surface normals direction)
Definition MRVoxels/MRVoxelsLoad.h:26
ScalarType scalarType
Definition MRVoxels/MRVoxelsLoad.h:27
Vector3i dimensions
Definition MRVoxels/MRVoxelsLoad.h:24
Vector3f voxelSize
Definition MRVoxels/MRVoxelsLoad.h:25