Volume Cartographer 2.27.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
volcart::segmentation::StructureTensorParticleSim Class Reference

Structure Tensor Particle Simulation (STPS) segmentation. More...

#include <vc/segmentation/StructureTensorParticleSim.hpp>

Inheritance diagram for volcart::segmentation::StructureTensorParticleSim:
[legend]
Collaboration diagram for volcart::segmentation::StructureTensorParticleSim:
[legend]

Public Member Functions

std::size_t progressIterations () const override
 
 StructureTensorParticleSim ()=default
 Default constructor.
 
 ~StructureTensorParticleSim () override=default
 
void setPropagationScaleFactor (double g)
 Set the propagation force scale factor. More...
 
void setMaterialThickness (double m)
 Set the estimated thickness of the substrate (in um) More...
 
void setRKStepSize (double s)
 Set the Runge-Kutta step size. More...
 
PointSet compute () override
 Compute the segmentation. More...
 
- Public Member Functions inherited from volcart::segmentation::ChainSegmentationAlgorithm
virtual ~ChainSegmentationAlgorithm ()=default
 
auto progressIterations () const -> std::size_t override
 Returns the maximum progress value. More...
 
void setVolume (Volume::Pointer vol)
 Set the input Volume. More...
 
void setBounds (Bounds b)
 Set the bounding box for computation. More...
 
void setChain (Chain c)
 Set the input chain of seed points. More...
 
void setNumberOfSteps (std::size_t n)
 Set the number of propagation steps. More...
 
void setStepSize (double s)
 Set the propagation step size. More...
 
auto getStatus () const -> Status
 Get the status of the previous computation. More...
 
auto getPointSet () const -> const PointSet &
 Get the segmented pointset. More...
 
auto getPointSet () -> PointSet &
 Get the segmented pointset. More...
 
virtual std::size_t progressIterations () const =0
 

Private Member Functions

ForceChain calc_prop_forces_ (ParticleChain c)
 
ForceChain calc_spring_forces_ (ParticleChain c)
 
void add_chain_to_result_ ()
 
bool chain_stopped_ ()
 

Private Attributes

double propagationScaleFactor_ {0.5}
 
double springConstantK_ {-0.5}
 
double materialThickness_ {100}
 
int radius_ {5}
 
ParticleChain currentChain_
 
double rkStepSize_ {0.5}
 

Additional Inherited Members

- Public Types inherited from volcart::segmentation::ChainSegmentationAlgorithm
enum class  Status { Success , Failure , ReturnedEarly }
 
using Pointer = std::shared_ptr< ChainSegmentationAlgorithm >
 
using Chain = std::vector< cv::Vec3d >
 
using PointSet = volcart::OrderedPointSet< cv::Vec3d >
 
using Bounds = volcart::BoundingBox< double, 3 >
 
- Public Attributes inherited from volcart::IterationsProgress
Signal progressStarted
 
Signal< std::size_t > progressUpdated
 
Signal progressComplete
 
- Protected Member Functions inherited from volcart::segmentation::ChainSegmentationAlgorithm
 ChainSegmentationAlgorithm ()=default
 
- Protected Attributes inherited from volcart::segmentation::ChainSegmentationAlgorithm
Volume::Pointer vol_
 
Chain startingChain_
 
Bounds bb_
 
std::size_t numSteps_ {0}
 
double stepSize_ {1.0}
 
PointSet result_
 
Status status_ {Status::Success}
 

Detailed Description

Structure Tensor Particle Simulation (STPS) segmentation.

This algorithm propagates a chain of points through a volume using an estimate of the local neighborhood as a guide. Point movement is constrained by way of a corrective spring force between each point.

Definition at line 25 of file StructureTensorParticleSim.hpp.

Constructor & Destructor Documentation

◆ ~StructureTensorParticleSim()

volcart::segmentation::StructureTensorParticleSim::~StructureTensorParticleSim ( )
overridedefault

Default destructor

Member Function Documentation

◆ add_chain_to_result_()

void volcart::segmentation::StructureTensorParticleSim::add_chain_to_result_ ( )
private

Add the current chain to the final result point set

◆ calc_prop_forces_()

ForceChain volcart::segmentation::StructureTensorParticleSim::calc_prop_forces_ ( ParticleChain  c)
private

Calculate the propagation force direction for each point in the chain

◆ calc_spring_forces_()

ForceChain volcart::segmentation::StructureTensorParticleSim::calc_spring_forces_ ( ParticleChain  c)
private

Calculate the corrective spring force for each point in the chain

◆ chain_stopped_()

bool volcart::segmentation::StructureTensorParticleSim::chain_stopped_ ( )
private

Return whether or not any point in the chain is out of bounds

◆ compute()

PointSet volcart::segmentation::StructureTensorParticleSim::compute ( )
overridevirtual

Compute the segmentation.

Implements volcart::segmentation::ChainSegmentationAlgorithm.

◆ progressIterations()

std::size_t volcart::segmentation::StructureTensorParticleSim::progressIterations ( ) const
overridevirtual

Sends when the segmentation is updated with intermediate results

Reimplemented from volcart::segmentation::ChainSegmentationAlgorithm.

◆ setMaterialThickness()

void volcart::segmentation::StructureTensorParticleSim::setMaterialThickness ( double  m)
inline

Set the estimated thickness of the substrate (in um)

Used to generate the radius of the structure tensor calculation

Definition at line 44 of file StructureTensorParticleSim.hpp.

◆ setPropagationScaleFactor()

void volcart::segmentation::StructureTensorParticleSim::setPropagationScaleFactor ( double  g)
inline

Set the propagation force scale factor.

Definition at line 37 of file StructureTensorParticleSim.hpp.

◆ setRKStepSize()

void volcart::segmentation::StructureTensorParticleSim::setRKStepSize ( double  s)
inline

Set the Runge-Kutta step size.

Should be less than or equal to the value set by setStepSize(). Number of RK iterations per output step is determined by stepSize_ / rkStepSize_.

Definition at line 52 of file StructureTensorParticleSim.hpp.

Member Data Documentation

◆ currentChain_

ParticleChain volcart::segmentation::StructureTensorParticleSim::currentChain_
private

Most recent version of the chain

Definition at line 74 of file StructureTensorParticleSim.hpp.

◆ materialThickness_

double volcart::segmentation::StructureTensorParticleSim::materialThickness_ {100}
private

Estimated material thickness in um

Definition at line 69 of file StructureTensorParticleSim.hpp.

◆ propagationScaleFactor_

double volcart::segmentation::StructureTensorParticleSim::propagationScaleFactor_ {0.5}
private

Scale factor for propagation force

Definition at line 65 of file StructureTensorParticleSim.hpp.

◆ radius_

int volcart::segmentation::StructureTensorParticleSim::radius_ {5}
private

Radius for structure tensor calculation kernel

Definition at line 71 of file StructureTensorParticleSim.hpp.

◆ rkStepSize_

double volcart::segmentation::StructureTensorParticleSim::rkStepSize_ {0.5}
private

Runge-Kutta step size. Number of RK iterations per step is determined by stepSize_ / rkStepSize_

Definition at line 80 of file StructureTensorParticleSim.hpp.

◆ springConstantK_

double volcart::segmentation::StructureTensorParticleSim::springConstantK_ {-0.5}
private

Spring constant for Hooke's law

Definition at line 67 of file StructureTensorParticleSim.hpp.


The documentation for this class was generated from the following file: