MeshLib Documentation
Loading...
Searching...
No Matches
Voxel

This chapter represents documentation about Volume (Voxel) More...

Topics

 Volume Indexer
 
 Volume (Voxel) Segmentation
 This chapter represents documentation about Volume (Voxel) Segmentation.
 
 Voxel Path
 

Classes

struct  MR::MergeVolumePartSettings
 Parameters' structure for MR::mergeVolumePart. More...
 
struct  MR::VolumeToMeshByPartsSettings
 Parameters' structure for MR::volumeToMeshByParts. More...
 

Functions

 MR::VoxelLocation::operator bool () const
 check for validity
 
 MR::VolumeIndexer::VolumeIndexer (const Vector3i &dims)
 
const Vector3i & MR::VolumeIndexer::dims () const
 
size_t MR::VolumeIndexer::size () const
 returns the total number of voxels
 
VoxelId MR::VolumeIndexer::endId () const
 returns the last plus one voxel Id for defining iteration range
 
size_t MR::VolumeIndexer::sizeXY () const
 
Vector3i MR::VolumeIndexer::toPos (VoxelId id) const
 
VoxelId MR::VolumeIndexer::toVoxelId (const Vector3i &pos) const
 
VoxelLocation MR::VolumeIndexer::toLoc (VoxelId id) const
 
VoxelLocation MR::VolumeIndexer::toLoc (const Vector3i &pos) const
 
bool MR::VolumeIndexer::isInDims (const Vector3i &pos) const
 returns true if this voxel is within dimensions
 
bool MR::VolumeIndexer::isBdVoxel (const Vector3i &pos) const
 returns true if this voxel is on the boundary of the volume
 
bool MR::VolumeIndexer::areNeigbors (VoxelId v0, VoxelId v1) const
 returns true if v1 is within at most 6 neighbors of v0
 
bool MR::VolumeIndexer::areNeigbors (const Vector3i &pos0, const Vector3i &pos1) const
 
MRMESH_API bool MR::VolumeIndexer::hasNeighbour (const Vector3i &pos, OutEdge toNei) const
 given existing voxel at (pos), returns whether it has valid neighbor specified by the edge (toNei)
 
VoxelId MR::VolumeIndexer::getNeighbor (VoxelId v, OutEdge toNei) const
 returns id of v's neighbor specified by the edge
 
VoxelId MR::VolumeIndexer::getNeighbor (VoxelId v, const Vector3i &pos, OutEdge toNei) const
 
VoxelLocation MR::VolumeIndexer::getNeighbor (const VoxelLocation &loc, OutEdge toNei) const
 
VoxelId MR::VolumeIndexer::getExistingNeighbor (VoxelId v, OutEdge toNei) const
 returns id of v's neighbor specified by the edge, which is known to exist (so skipping a lot of checks)
 
VoxelId MR::VolumeIndexer::getNeighbor (VoxelId v, const Vector3i &pos, bool bdPos, OutEdge toNei) const
 
MRVOXELS_API Expected< VoxelBitSet > MR::segmentVolumeByGraphCut (const SimpleVolume &densityVolume, float k, const VoxelBitSet &sourceSeeds, const VoxelBitSet &sinkSeeds, ProgressCallback cb={})
 Segment voxels of given volume on two sets using graph-cut, returning source set.
 

Variables

VoxelId MR::VoxelLocation::id
 
Vector3i MR::VoxelLocation::pos
 
Vector3i MR::VolumeIndexer::dims_
 
size_t MR::VolumeIndexer::sizeXY_ = 0
 = dims_.x * dims_.y
 
size_t MR::VolumeIndexer::size_ = 0
 = dims_.x * dims_.y * dims_.z
 
int MR::VolumeIndexer::neiInc_ [OutEdgeCount] = {}
 

Detailed Description

This chapter represents documentation about Volume (Voxel)

Function Documentation

◆ areNeigbors() [1/2]

bool MR::VolumeIndexer::areNeigbors ( const Vector3i & pos0,
const Vector3i & pos1 ) const
inlinenodiscard

◆ areNeigbors() [2/2]

bool MR::VolumeIndexer::areNeigbors ( VoxelId v0,
VoxelId v1 ) const
inlinenodiscard

returns true if v1 is within at most 6 neighbors of v0

◆ dims()

const Vector3i & MR::VolumeIndexer::dims ( ) const
inlinenodiscard

◆ endId()

VoxelId MR::VolumeIndexer::endId ( ) const
inlinenodiscard

returns the last plus one voxel Id for defining iteration range

◆ getExistingNeighbor()

VoxelId MR::VolumeIndexer::getExistingNeighbor ( VoxelId v,
OutEdge toNei ) const
inlinenodiscard

returns id of v's neighbor specified by the edge, which is known to exist (so skipping a lot of checks)

◆ getNeighbor() [1/4]

VoxelLocation MR::VolumeIndexer::getNeighbor ( const VoxelLocation & loc,
OutEdge toNei ) const
inlinenodiscard

given existing voxel at (loc), returns its neighbor specified by the edge (toNei); if the neighbour does not exist (loc is on boundary), returns invalid VoxelLocation

◆ getNeighbor() [2/4]

VoxelId MR::VolumeIndexer::getNeighbor ( VoxelId v,
const Vector3i & pos,
bool bdPos,
OutEdge toNei ) const
inlinenodiscard

◆ getNeighbor() [3/4]

VoxelId MR::VolumeIndexer::getNeighbor ( VoxelId v,
const Vector3i & pos,
OutEdge toNei ) const
inlinenodiscard

◆ getNeighbor() [4/4]

VoxelId MR::VolumeIndexer::getNeighbor ( VoxelId v,
OutEdge toNei ) const
inlinenodiscard

returns id of v's neighbor specified by the edge

◆ hasNeighbour()

MRMESH_API bool MR::VolumeIndexer::hasNeighbour ( const Vector3i & pos,
OutEdge toNei ) const
nodiscard

given existing voxel at (pos), returns whether it has valid neighbor specified by the edge (toNei)

◆ isBdVoxel()

bool MR::VolumeIndexer::isBdVoxel ( const Vector3i & pos) const
inlinenodiscard

returns true if this voxel is on the boundary of the volume

◆ isInDims()

bool MR::VolumeIndexer::isInDims ( const Vector3i & pos) const
inlinenodiscard

returns true if this voxel is within dimensions

◆ operator bool()

MR::VoxelLocation::operator bool ( ) const
inlineexplicit

check for validity

◆ segmentVolumeByGraphCut()

MRVOXELS_API Expected< VoxelBitSet > MR::segmentVolumeByGraphCut ( const SimpleVolume & densityVolume,
float k,
const VoxelBitSet & sourceSeeds,
const VoxelBitSet & sinkSeeds,
ProgressCallback cb = {} )

Segment voxels of given volume on two sets using graph-cut, returning source set.

Parameters
k- coefficient in the exponent of the metric affecting edge capacity:
increasing k you force to find a higher steps in the density on the boundary, decreasing k you ask for smoother boundary
sourceSeeds- these voxels will be included in the result
sinkSeeds- these voxels will be excluded from the result
See also
VolumeSegmenter

◆ size()

size_t MR::VolumeIndexer::size ( ) const
inlinenodiscard

returns the total number of voxels

◆ sizeXY()

size_t MR::VolumeIndexer::sizeXY ( ) const
inlinenodiscard

◆ toLoc() [1/2]

VoxelLocation MR::VolumeIndexer::toLoc ( const Vector3i & pos) const
inlinenodiscard

◆ toLoc() [2/2]

VoxelLocation MR::VolumeIndexer::toLoc ( VoxelId id) const
inlinenodiscard

◆ toPos()

Vector3i MR::VolumeIndexer::toPos ( VoxelId id) const
inlinenodiscard

◆ toVoxelId()

VoxelId MR::VolumeIndexer::toVoxelId ( const Vector3i & pos) const
inlinenodiscard

◆ VolumeIndexer()

MR::VolumeIndexer::VolumeIndexer ( const Vector3i & dims)
inlinenodiscard

Variable Documentation

◆ dims_

Vector3i MR::VolumeIndexer::dims_
protected

◆ id

VoxelId MR::VoxelLocation::id

◆ neiInc_

int MR::VolumeIndexer::neiInc_[OutEdgeCount] = {}
protected

◆ pos

Vector3i MR::VoxelLocation::pos

◆ size_

size_t MR::VolumeIndexer::size_ = 0
protected

= dims_.x * dims_.y * dims_.z

◆ sizeXY_

size_t MR::VolumeIndexer::sizeXY_ = 0
protected

= dims_.x * dims_.y