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

Local Reslice Particle Simulation (LRPS) segmentation. More...

#include <vc/segmentation/LocalResliceParticleSim.hpp>

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

Public Types

using Pointer = std::shared_ptr< LocalResliceSegmentation >
 
- 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 Member Functions

 LocalResliceSegmentation ()=default
 Default constructor.
 
 ~LocalResliceSegmentation () override=default
 
void setTargetZIndex (int z)
 Set the target z-index. More...
 
void setOptimizationIterations (int n)
 Set the number of curve optimization iterations per step. More...
 
void setAlpha (double a)
 Set the weight for the Active Contour metric. More...
 
void setK1 (double k)
 Set the stretch weight factor. More...
 
void setK2 (double k)
 Set the curvature weight factor. More...
 
void setBeta (double b)
 Set the weight for the Absolute Curvature Sum metric. More...
 
void setDelta (double d)
 Set the weight for the Arc Length metric. More...
 
void setMaterialThickness (double m)
 Set the estimated thickness of the substrate (in um) More...
 
void setResliceSize (int s)
 Set the reslice window size. More...
 
void setDistanceWeightFactor (int f)
 Set the distance weight factor for candidate positions. More...
 
void setConsiderPrevious (bool b)
 Set whether to consider previous position as candidate position. More...
 
auto compute () -> PointSet override
 Compute the segmentation. More...
 
void setVisualize (bool b)
 
void setDumpVis (bool b)
 
auto progressIterations () const -> std::size_t override
 Returns the maximum progress value. 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
 

Static Public Member Functions

template<typename... Args>
static auto New (Args... args) -> Pointer
 

Private Member Functions

auto estimate_normal_at_index_ (const FittedCurve &currentCurve, int index) -> cv::Vec3d
 Estimate the normal to the curve at point index. More...
 
auto draw_particle_on_slice_ (const FittedCurve &curve, int sliceIndex, int particleIndex=-1, bool showSpline=false) const -> cv::Mat
 Debug: Draw curve on slice image. More...
 
auto create_final_pointset_ (const std::vector< std::vector< Voxel > > &points) -> PointSet
 Convert the internal storage array into a final PointSet.
 

Private Attributes

int endIndex_ {0}
 
double alpha_ {1.0 / 3.0}
 
double k1_ {0.5}
 
double k2_ {0.5}
 
double beta_ {1.0 / 3.0}
 
double delta_ {1.0 / 3.0}
 
int peakDistanceWeight_ {50}
 
bool considerPrevious_ {false}
 
bool dumpVis_ {false}
 
bool visualize_ {false}
 
int numIters_ {15}
 
double materialThickness_ {100}
 
int resliceSize_ {32}
 

Static Private Attributes

static constexpr double DEFAULT_MIN_ENERGY_GRADIENT = 1e-7
 

Additional Inherited Members

- 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

Local Reslice Particle Simulation (LRPS) segmentation.

This algorithm propagates a chain of points forward through a volume from a starting z-index to an ending z-index. Each point is assumed to start within a "channel" of maximum intensity, that is, the bright voxels of a page layer. As the chain propagates forward, each point produces a reslice image that is locally orthogonal to the layer. Using this view, the algorithm finds the weighted set of maxima local to the point. These are assumed to be layer voxels on the current or a nearby layer. Using the sorted maxima for each point, the algorithm then selects the propagated positions for all points in the chain that minimize the energy loss of the chain curvature.

The ending index is inclusive.

Definition at line 34 of file LocalResliceParticleSim.hpp.

Member Typedef Documentation

◆ Pointer

Pointer

Definition at line 38 of file LocalResliceParticleSim.hpp.

Constructor & Destructor Documentation

◆ ~LocalResliceSegmentation()

volcart::segmentation::LocalResliceSegmentation::~LocalResliceSegmentation ( )
overridedefault

Default destructor

Member Function Documentation

◆ compute()

auto volcart::segmentation::LocalResliceSegmentation::compute ( ) -> PointSet
overridevirtual

Compute the segmentation.

Implements volcart::segmentation::ChainSegmentationAlgorithm.

◆ draw_particle_on_slice_()

auto volcart::segmentation::LocalResliceSegmentation::draw_particle_on_slice_ ( const FittedCurve curve,
int  sliceIndex,
int  particleIndex = -1,
bool  showSpline = false 
) const -> cv::Mat
private

Debug: Draw curve on slice image.

Parameters
curveInput curve
sliceIndexSlice on which to draw
particleIndexHighlight point at particleIndex
showSplineDraw interpolated curve. Default only draws points

◆ estimate_normal_at_index_()

auto volcart::segmentation::LocalResliceSegmentation::estimate_normal_at_index_ ( const FittedCurve currentCurve,
int  index 
) -> cv::Vec3d
private

Estimate the normal to the curve at point index.

Parameters
currentCurveInput curve
indexIndex of point on curve

◆ New()

template<typename... Args>
static auto volcart::segmentation::LocalResliceSegmentation::New ( Args...  args) -> Pointer
inlinestatic

Make a new shared instance

Definition at line 48 of file LocalResliceParticleSim.hpp.

◆ progressIterations()

auto volcart::segmentation::LocalResliceSegmentation::progressIterations ( ) const -> std::size_t
overridevirtual

Returns the maximum progress value.

Reimplemented from volcart::segmentation::ChainSegmentationAlgorithm.

◆ setAlpha()

void volcart::segmentation::LocalResliceSegmentation::setAlpha ( double  a)
inline

Set the weight for the Active Contour metric.

See also
double ActiveContourInternal()

Definition at line 64 of file LocalResliceParticleSim.hpp.

◆ setBeta()

void volcart::segmentation::LocalResliceSegmentation::setBeta ( double  b)
inline

Set the weight for the Absolute Curvature Sum metric.

See also
double AbsCurvatureSum()

Definition at line 82 of file LocalResliceParticleSim.hpp.

◆ setConsiderPrevious()

void volcart::segmentation::LocalResliceSegmentation::setConsiderPrevious ( bool  b)
inline

Set whether to consider previous position as candidate position.

Definition at line 105 of file LocalResliceParticleSim.hpp.

◆ setDelta()

void volcart::segmentation::LocalResliceSegmentation::setDelta ( double  d)
inline

Set the weight for the Arc Length metric.

See also
double WindowedArcLength()

Definition at line 88 of file LocalResliceParticleSim.hpp.

◆ setDistanceWeightFactor()

void volcart::segmentation::LocalResliceSegmentation::setDistanceWeightFactor ( int  f)
inline

Set the distance weight factor for candidate positions.

Definition at line 101 of file LocalResliceParticleSim.hpp.

◆ setDumpVis()

void volcart::segmentation::LocalResliceSegmentation::setDumpVis ( bool  b)
inline

Debug: Dumps reslices and intensity maps to disk

Definition at line 114 of file LocalResliceParticleSim.hpp.

◆ setK1()

void volcart::segmentation::LocalResliceSegmentation::setK1 ( double  k)
inline

Set the stretch weight factor.

See also
double ActiveContourInternal()

Definition at line 70 of file LocalResliceParticleSim.hpp.

◆ setK2()

void volcart::segmentation::LocalResliceSegmentation::setK2 ( double  k)
inline

Set the curvature weight factor.

See also
double ActiveContourInternal()

Definition at line 76 of file LocalResliceParticleSim.hpp.

◆ setMaterialThickness()

void volcart::segmentation::LocalResliceSegmentation::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 95 of file LocalResliceParticleSim.hpp.

◆ setOptimizationIterations()

void volcart::segmentation::LocalResliceSegmentation::setOptimizationIterations ( int  n)
inline

Set the number of curve optimization iterations per step.

Definition at line 58 of file LocalResliceParticleSim.hpp.

◆ setResliceSize()

void volcart::segmentation::LocalResliceSegmentation::setResliceSize ( int  s)
inline

Set the reslice window size.

Definition at line 98 of file LocalResliceParticleSim.hpp.

◆ setTargetZIndex()

void volcart::segmentation::LocalResliceSegmentation::setTargetZIndex ( int  z)
inline

Set the target z-index.

Definition at line 55 of file LocalResliceParticleSim.hpp.

◆ setVisualize()

void volcart::segmentation::LocalResliceSegmentation::setVisualize ( bool  b)
inline

Debug: Shows intensity maps in GUI window

Definition at line 111 of file LocalResliceParticleSim.hpp.

Member Data Documentation

◆ alpha_

double volcart::segmentation::LocalResliceSegmentation::alpha_ {1.0 / 3.0}
private

Active Contour weight parameter

Definition at line 151 of file LocalResliceParticleSim.hpp.

◆ beta_

double volcart::segmentation::LocalResliceSegmentation::beta_ {1.0 / 3.0}
private

Abs. Curvature Sum weight parameter

Definition at line 157 of file LocalResliceParticleSim.hpp.

◆ considerPrevious_

bool volcart::segmentation::LocalResliceSegmentation::considerPrevious_ {false}
private

Reconsider previous position flag

Definition at line 163 of file LocalResliceParticleSim.hpp.

◆ DEFAULT_MIN_ENERGY_GRADIENT

constexpr double volcart::segmentation::LocalResliceSegmentation::DEFAULT_MIN_ENERGY_GRADIENT = 1e-7
staticconstexprprivate

Default minimum energy gradient

Definition at line 146 of file LocalResliceParticleSim.hpp.

◆ delta_

double volcart::segmentation::LocalResliceSegmentation::delta_ {1.0 / 3.0}
private

Arc Length weight parameter

Definition at line 159 of file LocalResliceParticleSim.hpp.

◆ dumpVis_

bool volcart::segmentation::LocalResliceSegmentation::dumpVis_ {false}
private

Dump visualization to disk flag

Definition at line 165 of file LocalResliceParticleSim.hpp.

◆ endIndex_

int volcart::segmentation::LocalResliceSegmentation::endIndex_ {0}
private

Target z-index

Definition at line 149 of file LocalResliceParticleSim.hpp.

◆ k1_

double volcart::segmentation::LocalResliceSegmentation::k1_ {0.5}
private

Active Contour stretch parameter

Definition at line 153 of file LocalResliceParticleSim.hpp.

◆ k2_

double volcart::segmentation::LocalResliceSegmentation::k2_ {0.5}
private

Active Contour curvature parameter

Definition at line 155 of file LocalResliceParticleSim.hpp.

◆ materialThickness_

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

Estimated material thickness in um

Definition at line 171 of file LocalResliceParticleSim.hpp.

◆ numIters_

int volcart::segmentation::LocalResliceSegmentation::numIters_ {15}
private

Number of curve optimization iterations

Definition at line 169 of file LocalResliceParticleSim.hpp.

◆ peakDistanceWeight_

int volcart::segmentation::LocalResliceSegmentation::peakDistanceWeight_ {50}
private

Distance weight factor for candidate positions

Definition at line 161 of file LocalResliceParticleSim.hpp.

◆ resliceSize_

int volcart::segmentation::LocalResliceSegmentation::resliceSize_ {32}
private

Window size for reslice

Definition at line 173 of file LocalResliceParticleSim.hpp.

◆ visualize_

bool volcart::segmentation::LocalResliceSegmentation::visualize_ {false}
private

Show visualization in GUI flag

Definition at line 167 of file LocalResliceParticleSim.hpp.


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