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
38MRVOXELS_API Expected<FloatGrid> gridFromRaw( const std::filesystem::path& file, const RawParameters& params,
39 const ProgressCallback& cb = {} );
40
44 const ProgressCallback& cb = {} );
45
50
52MRVOXELS_API Expected<VdbVolume> fromRaw( const std::filesystem::path& file,
53 const ProgressCallback& cb = {} );
54
56MRVOXELS_API Expected<FloatGrid> gridFromRaw( const std::filesystem::path& file,
57 const ProgressCallback& cb = {} );
58
60MRVOXELS_API Expected<std::vector<VdbVolume>> fromVdb( const std::filesystem::path& file,
61 const ProgressCallback& cb = {} );
62
63MRVOXELS_API Expected<std::vector<FloatGrid>> gridsFromVdb( const std::filesystem::path& file,
64 const ProgressCallback& cb = {} );
66 const ProgressCallback& cb = {} );
67
68
70MRVOXELS_API Expected<VdbVolume> fromGav( const std::filesystem::path& file, const ProgressCallback& cb = {} );
72MRVOXELS_API Expected<VdbVolume> fromGav( std::istream& in, const ProgressCallback& cb = {} );
73
74
77 const ProgressCallback& cb = {} );
78
81 const ProgressCallback& cb = {} );
82
84
85// Determines iso-surface orientation
86enum class GridType
87{
88 // consider values less than iso as outer area
89 DenseGrid = 0,
90 // consider values less than iso as inner area
91 LevelSet = 1
92};
93
94#ifndef MRVOXELS_NO_TIFF
96{
97 std::filesystem::path dir;
98 Vector3f voxelSize = { 1.0f, 1.0f, 1.0f };
101};
104#endif // MRVOXELS_NO_TIFF
105
106#ifndef MR_PARSING_FOR_PB11_BINDINGS
107using VoxelsLoader = Expected<std::vector<VdbVolume>>( * )( const std::filesystem::path&, const ProgressCallback& );
108
110#endif
111
112}
113
116
117MRVOXELS_API Expected<LoadedObjects> makeObjectFromVoxelsFile( const std::filesystem::path& file, const ProgressCallback& callback = {} );
118
119}
#define MR_FORMAT_REGISTRY_EXTERNAL_DECL(API_ATTR, ProcName)
Definition MRIOFormatsRegistry.h:16
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:663
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< std::vector< FloatGrid > > gridsFromVdb(const std::filesystem::path &file, const ProgressCallback &cb={})
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< FloatGrid > gridFromRaw(const std::filesystem::path &file, const RawParameters &params, const ProgressCallback &cb={})
Load raw voxels from file with provided parameters.
MRVOXELS_API Expected< std::vector< FloatGrid > > gridsFromAnySupportedFormat(const std::filesystem::path &file, const ProgressCallback &cb={})
Detects the format from file extension and loads voxels from it.
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:87
Expected< std::vector< VdbVolume > >(*)(const std::filesystem::path &, const ProgressCallback &) VoxelsLoader
Definition MRVoxels/MRVoxelsLoad.h:107
Definition MRCameraOrientationPlugin.h:8
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:25
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:96
GridType gridType
Definition MRVoxels/MRVoxelsLoad.h:99
Vector3f voxelSize
Definition MRVoxels/MRVoxelsLoad.h:98
std::filesystem::path dir
Definition MRVoxels/MRVoxelsLoad.h:97
ProgressCallback cb
Definition MRVoxels/MRVoxelsLoad.h:100
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