CortidQCT
1.2.2.52
|
Type representing a voxel volume. More...
#include <VoxelVolume.h>
Public Types | |
using | ValueType = float |
Voxel value type. | |
Construction | |
VoxelVolume () noexcept | |
Constructs an empty volume. | |
VoxelVolume (std::string const &filename) | |
IO | |
VoxelVolume & | loadFromFile (std::string const &filename) |
Loads the volume data from file using format auto detection. More... | |
Accessors | |
VolumeSize const & | size () const noexcept |
Returns the volume size. | |
VoxelSize const & | voxelSize () const noexcept |
Returns the voxel size. | |
bool | isEmpty () const noexcept |
Returns true iff the volume is empty. | |
Raw Data Access | |
The methods in this section all call a functional with a pointer to raw data as its argument. The pointer is only guaranteed to be valid within the call to the given functional.
| |
template<class F > | |
auto | withUnsafeDataPointer (F &&f) const noexcept(noexcept(f(std::declval< VoxelData >().data()))) |
Calls the given functional with an unsafe pointer to the raw voxel storage. More... | |
Type representing a voxel volume.
A 3D voxel volume where each voxel has a floating point density value. Voxel size can be anisotropic.
|
inline |
Constructs a volume by reading its data from a file
VoxelVolume & CortidQCT::VoxelVolume::loadFromFile | ( | std::string const & | filename | ) |
Loads the volume data from file using format auto detection.
Supported file formats are: bst
filename | Path to the file to load the volume from |
std::invalid_argument | if the volume could not be loaded from the file given by filename |
std::invalid_argument | if the file format could not be recognized |
|
inlinenoexcept |
Calls the given functional with an unsafe pointer to the raw voxel storage.
Voxel data are stored in column major order: y, x then z.
F | function that accepts a ValueType const * pointer as the only argument. |
noexcept(conditional) | iff f(ValueType const *) is noexcept |