MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxelsLoad.h
Go to the documentation of this file.
1#pragma once
2#include "MRVoxelsFwd.h"
3#include "MRVoxelsVolume.h"
4
6#include "MRMesh/MRObject.h"
9
10#include <filesystem>
11
12namespace MR
13{
14
18
19namespace VoxelsLoad
20{
21
29
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
84enum class GridType
85{
90};
91
93{
94 std::filesystem::path dir;
95 Vector3f voxelSize = { 1.0f, 1.0f, 1.0f };
98};
99
102
103using LoadingTiffSettings [[deprecated( "Use RasterFolderLoadSettings" )]] MR_BIND_IGNORE = RasterFolderLoadSettings;
104[[deprecated( "Use loadRasterFolder" )]]
105MR_BIND_IGNORE inline Expected<VdbVolume> loadTiffDir( const RasterFolderLoadSettings& settings )
106{
107 return loadRasterFolder( settings );
108}
109
110#ifndef MR_PARSING_FOR_ANY_BINDINGS
111using VoxelsLoader = Expected<std::vector<VdbVolume>>( * )( const std::filesystem::path&, const ProgressCallback& );
112
114#endif
115
116}
117
120
121MRVOXELS_API Expected<LoadedObjects> makeObjectFromVoxelsFile( const std::filesystem::path& file, const ProgressCallback& callback = {} );
122
124
125}
#define MR_FORMAT_REGISTRY_EXTERNAL_DECL(API_ATTR, ProcName)
Definition MRIOFormatsRegistry.h:18
#define MRVOXELS_API
see explanation in MRMesh/MRMeshFwd.h
Definition MRVoxelsFwd.h:14
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:790
ScalarType
scalar value's binary format type
Definition MRScalarConvert.h:14
tl::expected< T, E > Expected
Definition MRExpected.h:31
@ Float32
Definition MRScalarConvert.h:23
Expected< std::vector< std::shared_ptr< ObjectVoxels > > > makeObjectVoxelsFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads voxels from given file in new object
Expected< LoadedObjects > makeObjectFromVoxelsFile(const std::filesystem::path &file, const ProgressCallback &callback={})
Definition MRDicom.h:21
Expected< std::vector< VdbVolume > > fromAnySupportedFormat(const std::filesystem::path &file, const ProgressCallback &cb={})
Detects the format from file extension and loads voxels from it.
Expected< VdbVolume > loadRasterFolder(const RasterFolderLoadSettings &settings)
Expected< std::vector< FloatGrid > > gridsFromVdb(const std::filesystem::path &file, const ProgressCallback &cb={})
GridType
Determines iso-surface orientation.
Definition MRVoxelsLoad.h:85
@ DenseGrid
consider values less than iso as outer area
Definition MRVoxelsLoad.h:87
@ LevelSet
consider values less than iso as inner area
Definition MRVoxelsLoad.h:89
Expected< std::vector< VdbVolume > > fromVdb(const std::filesystem::path &file, const ProgressCallback &cb={})
Load all voxel volumes from OpenVDB file.
Expected< VdbVolume > fromRaw(const std::filesystem::path &file, const RawParameters &params, const ProgressCallback &cb={})
Load raw voxels from file with provided parameters.
Expected< RawParameters > findRawParameters(std::filesystem::path &file)
Expected< FloatGrid > gridFromRaw(const std::filesystem::path &file, const RawParameters &params, const ProgressCallback &cb={})
Load raw voxels from file with provided parameters.
Expected< VdbVolume > fromGav(const std::filesystem::path &file, const ProgressCallback &cb={})
Load voxel from Gav-file with micro CT reconstruction.
Expected< std::vector< VdbVolume > >(*)(const std::filesystem::path &, const ProgressCallback &) VoxelsLoader
Definition MRVoxelsLoad.h:111
Expected< std::vector< FloatGrid > > gridsFromAnySupportedFormat(const std::filesystem::path &file, const ProgressCallback &cb={})
Detects the format from file extension and loads voxels from it.
Expected< VdbVolume > loadTiffDir(const RasterFolderLoadSettings &settings)
Definition MRVoxelsLoad.h:105
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRVoxelsLoad.h:93
ProgressCallback cb
Definition MRVoxelsLoad.h:97
Vector3f voxelSize
Definition MRVoxelsLoad.h:95
std::filesystem::path dir
Definition MRVoxelsLoad.h:94
GridType gridType
Definition MRVoxelsLoad.h:96
Definition MRVoxelsLoad.h:23
bool gridLevelSet
OpenVDB GridClass set as GRID_LEVEL_SET (need to set right surface normals direction)
Definition MRVoxelsLoad.h:26
ScalarType scalarType
Definition MRVoxelsLoad.h:27
Vector3i dimensions
Definition MRVoxelsLoad.h:24
Vector3f voxelSize
Definition MRVoxelsLoad.h:25