|
Rerun C++ SDK
|
Archetype: A dense 3D scalar field, rendered by ray marching. More...
#include <rerun/archetypes/volume3d.hpp>
Public Member Functions | |
| RR_DISABLE_MAYBE_UNINITIALIZED_PUSH | Volume3D (Collection< uint64_t > shape, encodings::TensorBuffer buffer) |
| New Volume3D from dimensions and tensor buffer. | |
| Volume3D (Volume3D &&other)=default | |
| Volume3D (const Volume3D &other)=default | |
| Volume3D & | operator= (const Volume3D &other)=default |
| Volume3D & | operator= (Volume3D &&other)=default |
| Volume3D (rerun::components::TensorData _values) | |
| Volume3D | with_values (const rerun::components::TensorData &_values) && |
The scalar value of each voxel, as a 3D tensor with dimensions ordered [z, y, x]. | |
| Volume3D | with_many_values (const Collection< rerun::components::TensorData > &_values) && |
This method makes it possible to pack multiple values in a single component batch. | |
| Volume3D | with_voxel_size (const rerun::components::VoxelSize &_voxel_size) && |
| The scene-unit dimensions of a single voxel cell. | |
| Volume3D | with_many_voxel_size (const Collection< rerun::components::VoxelSize > &_voxel_size) && |
This method makes it possible to pack multiple voxel_size in a single component batch. | |
| Volume3D | with_translation (const rerun::components::Translation3D &_translation) && |
Translation of the minimum corner of voxel [0, 0, 0]. | |
| Volume3D | with_many_translation (const Collection< rerun::components::Translation3D > &_translation) && |
This method makes it possible to pack multiple translation in a single component batch. | |
| Volume3D | with_quaternion (const rerun::components::RotationQuat &_quaternion) && |
| Rotation of the volume via quaternion. | |
| Volume3D | with_many_quaternion (const Collection< rerun::components::RotationQuat > &_quaternion) && |
This method makes it possible to pack multiple quaternion in a single component batch. | |
| Volume3D | with_value_range (const rerun::components::ValueRange &_value_range) && |
How to map values to opacity and color. | |
| Volume3D | with_many_value_range (const Collection< rerun::components::ValueRange > &_value_range) && |
This method makes it possible to pack multiple value_range in a single component batch. | |
| Volume3D | with_colormap (const rerun::components::Colormap &_colormap) && |
Colormap applied to the values after mapping them through value_range. | |
| Volume3D | with_many_colormap (const Collection< rerun::components::Colormap > &_colormap) && |
This method makes it possible to pack multiple colormap in a single component batch. | |
| Volume3D | with_opacity (const rerun::components::Opacity &_opacity) && |
| Overall opacity of the volume. | |
| Volume3D | with_many_opacity (const Collection< rerun::components::Opacity > &_opacity) && |
This method makes it possible to pack multiple opacity in a single component batch. | |
| Collection< ComponentColumn > | columns (const Collection< uint32_t > &lengths_) |
| Partitions the component data into multiple sub-batches. | |
| Collection< ComponentColumn > | columns () |
| Partitions the component data into unit-length sub-batches. | |
Static Public Member Functions | |
| static Volume3D | update_fields () |
Update only some specific fields of a Volume3D. | |
| static Volume3D | clear_fields () |
Clear all the fields of a Volume3D. | |
Public Attributes | |
| std::optional< ComponentBatch > | values |
The scalar value of each voxel, as a 3D tensor with dimensions ordered [z, y, x]. | |
| std::optional< ComponentBatch > | voxel_size |
| The scene-unit dimensions of a single voxel cell. | |
| std::optional< ComponentBatch > | translation |
Translation of the minimum corner of voxel [0, 0, 0]. | |
| std::optional< ComponentBatch > | quaternion |
| Rotation of the volume via quaternion. | |
| std::optional< ComponentBatch > | value_range |
How to map values to opacity and color. | |
| std::optional< ComponentBatch > | colormap |
Colormap applied to the values after mapping them through value_range. | |
| std::optional< ComponentBatch > | opacity |
| Overall opacity of the volume. | |
Static Public Attributes | |
| static constexpr const char | ArchetypeName [] = "rerun.archetypes.Volume3D" |
The name of the archetype as used in ComponentDescriptors. | |
| static constexpr auto | Descriptor_values |
ComponentDescriptor for the values field. | |
| static constexpr auto | Descriptor_voxel_size |
ComponentDescriptor for the voxel_size field. | |
| static constexpr auto | Descriptor_translation |
ComponentDescriptor for the translation field. | |
| static constexpr auto | Descriptor_quaternion |
ComponentDescriptor for the quaternion field. | |
| static constexpr auto | Descriptor_value_range |
ComponentDescriptor for the value_range field. | |
| static constexpr auto | Descriptor_colormap |
ComponentDescriptor for the colormap field. | |
| static constexpr auto | Descriptor_opacity |
ComponentDescriptor for the opacity field. | |
Archetype: A dense 3D scalar field, rendered by ray marching.
This archetype is intended for volumetric scans and simulations, e.g. CT/MRI scans, signed distance fields, or occupancy probabilities sampled on a regular grid.
The values are a 3D tensor with dimensions ordered [z, y, x], i.e. the last dimension varies fastest and runs along the local X axis. This matches the row-major layout of archetypes::Image, with slices stacked along the local Z axis. The tensor element at [k, j, i] is thus the voxel with grid index [i, j, k].
Voxels are positioned exactly like those of archetypes::VoxelGridMap: the minimum corner of the voxel with [0, 0, 0] index is located at the origin of the entity's coordinate frame and can have an additional offset from there through the optional translation and rotation fields, and a voxel center is at (index + 0.5) * voxel_size in local grid coordinates (i.e. relative to the minimum corner). This archetype and a archetypes::VoxelGridMap with the same voxel_size and pose therefore agree voxel for voxel, the dense volume covering indices [0, 0, 0] up to [width - 1, height - 1, depth - 1].
⚠ This type is unstable and may change significantly in a way that the data won't be backwards compatible.
|
inline |
The scalar value of each voxel, as a 3D tensor with dimensions ordered [z, y, x].
Currently only f16 are supported.
|
inline |
This method makes it possible to pack multiple values in a single component batch.
This only makes sense when used in conjunction with columns. with_values should be used when logging a single row's worth of data.
|
inline |
The scene-unit dimensions of a single voxel cell.
This defines the voxel size along the local grid X/Y/Z axes, and thus the total extent of the volume: [width, height, depth] * voxel_size. Anisotropic spacing (as is common for medical scans) is expressed here. Each dimension must be finite and positive.
Defaults to [1.0, 1.0, 1.0].
|
inline |
This method makes it possible to pack multiple voxel_size in a single component batch.
This only makes sense when used in conjunction with columns. with_voxel_size should be used when logging a single row's worth of data.
|
inline |
Translation of the minimum corner of voxel [0, 0, 0].
Together with components::RotationQuat, this defines the pose of the volume relative to the entity's coordinate frame.
If not set, the minimum corner is placed at the origin of the entity's coordinate frame.
|
inline |
This method makes it possible to pack multiple translation in a single component batch.
This only makes sense when used in conjunction with columns. with_translation should be used when logging a single row's worth of data.
|
inline |
Rotation of the volume via quaternion.
Together with components::Translation3D, this defines the pose of the volume relative to the entity's coordinate frame. The rotation is around the minimum corner of voxel [0, 0, 0], and is applied before the translation.
|
inline |
This method makes it possible to pack multiple quaternion in a single component batch.
This only makes sense when used in conjunction with columns. with_quaternion should be used when logging a single row's worth of data.
|
inline |
How to map values to opacity and color.
If not specified, the range is estimated from the data.
|
inline |
This method makes it possible to pack multiple value_range in a single component batch.
This only makes sense when used in conjunction with columns. with_value_range should be used when logging a single row's worth of data.
|
inline |
Colormap applied to the values after mapping them through value_range.
Defaults to Turbo.
|
inline |
This method makes it possible to pack multiple colormap in a single component batch.
This only makes sense when used in conjunction with columns. with_colormap should be used when logging a single row's worth of data.
|
inline |
Overall opacity of the volume.
The opacity of a single voxel is its value (normalized through value_range) scaled by this, i.e. a linear ramp: low values are transparent, high values are opaque. Lowering this makes the interior of the volume visible.
Defaults to 1.0.
|
inline |
This method makes it possible to pack multiple opacity in a single component batch.
This only makes sense when used in conjunction with columns. with_opacity should be used when logging a single row's worth of data.
| Collection< ComponentColumn > rerun::archetypes::Volume3D::columns | ( | const Collection< uint32_t > & | lengths_ | ) |
Partitions the component data into multiple sub-batches.
Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.
This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.
The specified lengths must sum to the total length of the component batch.
| Collection< ComponentColumn > rerun::archetypes::Volume3D::columns | ( | ) |
Partitions the component data into unit-length sub-batches.
This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::values |
The scalar value of each voxel, as a 3D tensor with dimensions ordered [z, y, x].
Currently only f16 are supported.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::voxel_size |
The scene-unit dimensions of a single voxel cell.
This defines the voxel size along the local grid X/Y/Z axes, and thus the total extent of the volume: [width, height, depth] * voxel_size. Anisotropic spacing (as is common for medical scans) is expressed here. Each dimension must be finite and positive.
Defaults to [1.0, 1.0, 1.0].
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::translation |
Translation of the minimum corner of voxel [0, 0, 0].
Together with components::RotationQuat, this defines the pose of the volume relative to the entity's coordinate frame.
If not set, the minimum corner is placed at the origin of the entity's coordinate frame.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::quaternion |
Rotation of the volume via quaternion.
Together with components::Translation3D, this defines the pose of the volume relative to the entity's coordinate frame. The rotation is around the minimum corner of voxel [0, 0, 0], and is applied before the translation.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::value_range |
How to map values to opacity and color.
If not specified, the range is estimated from the data.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::colormap |
Colormap applied to the values after mapping them through value_range.
Defaults to Turbo.
| std::optional<ComponentBatch> rerun::archetypes::Volume3D::opacity |
Overall opacity of the volume.
The opacity of a single voxel is its value (normalized through value_range) scaled by this, i.e. a linear ramp: low values are transparent, high values are opaque. Lowering this makes the interior of the volume visible.
Defaults to 1.0.
|
staticconstexpr |
ComponentDescriptor for the values field.
|
staticconstexpr |
ComponentDescriptor for the voxel_size field.
|
staticconstexpr |
ComponentDescriptor for the translation field.
|
staticconstexpr |
ComponentDescriptor for the quaternion field.
|
staticconstexpr |
ComponentDescriptor for the value_range field.
|
staticconstexpr |
ComponentDescriptor for the colormap field.
|
staticconstexpr |
ComponentDescriptor for the opacity field.