Volume Cartographer 2.27.0
|
Local Reslice Particle Simulation (LRPS) segmentation. More...
#include <vc/segmentation/LocalResliceParticleSim.hpp>
Public Types | |
using | Pointer = std::shared_ptr< LocalResliceSegmentation > |
![]() | |
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... | |
![]() | |
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 ¤tCurve, 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 | |
![]() | |
Signal | progressStarted |
Signal< std::size_t > | progressUpdated |
Signal | progressComplete |
![]() | |
ChainSegmentationAlgorithm ()=default | |
![]() | |
Volume::Pointer | vol_ |
Chain | startingChain_ |
Bounds | bb_ |
std::size_t | numSteps_ {0} |
double | stepSize_ {1.0} |
PointSet | result_ |
Status | status_ {Status::Success} |
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.
using volcart::segmentation::LocalResliceSegmentation::Pointer = std::shared_ptr<LocalResliceSegmentation> |
Pointer
Definition at line 38 of file LocalResliceParticleSim.hpp.
|
overridedefault |
Default destructor
|
overridevirtual |
Compute the segmentation.
Implements volcart::segmentation::ChainSegmentationAlgorithm.
|
private |
Debug: Draw curve on slice image.
curve | Input curve |
sliceIndex | Slice on which to draw |
particleIndex | Highlight point at particleIndex |
showSpline | Draw interpolated curve. Default only draws points |
|
private |
Estimate the normal to the curve at point index.
currentCurve | Input curve |
index | Index of point on curve |
|
inlinestatic |
Make a new shared instance
Definition at line 48 of file LocalResliceParticleSim.hpp.
|
overridevirtual |
Returns the maximum progress value.
Reimplemented from volcart::segmentation::ChainSegmentationAlgorithm.
|
inline |
Set the weight for the Active Contour metric.
Definition at line 64 of file LocalResliceParticleSim.hpp.
|
inline |
Set the weight for the Absolute Curvature Sum metric.
Definition at line 82 of file LocalResliceParticleSim.hpp.
|
inline |
Set whether to consider previous position as candidate position.
Definition at line 105 of file LocalResliceParticleSim.hpp.
|
inline |
Set the weight for the Arc Length metric.
Definition at line 88 of file LocalResliceParticleSim.hpp.
|
inline |
Set the distance weight factor for candidate positions.
Definition at line 101 of file LocalResliceParticleSim.hpp.
|
inline |
Debug: Dumps reslices and intensity maps to disk
Definition at line 114 of file LocalResliceParticleSim.hpp.
|
inline |
Set the stretch weight factor.
Definition at line 70 of file LocalResliceParticleSim.hpp.
|
inline |
Set the curvature weight factor.
Definition at line 76 of file LocalResliceParticleSim.hpp.
|
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.
|
inline |
Set the number of curve optimization iterations per step.
Definition at line 58 of file LocalResliceParticleSim.hpp.
|
inline |
Set the reslice window size.
Definition at line 98 of file LocalResliceParticleSim.hpp.
|
inline |
Set the target z-index.
Definition at line 55 of file LocalResliceParticleSim.hpp.
|
inline |
Debug: Shows intensity maps in GUI window
Definition at line 111 of file LocalResliceParticleSim.hpp.
|
private |
Active Contour weight parameter
Definition at line 151 of file LocalResliceParticleSim.hpp.
|
private |
Abs. Curvature Sum weight parameter
Definition at line 157 of file LocalResliceParticleSim.hpp.
|
private |
Reconsider previous position flag
Definition at line 163 of file LocalResliceParticleSim.hpp.
|
staticconstexprprivate |
Default minimum energy gradient
Definition at line 146 of file LocalResliceParticleSim.hpp.
|
private |
Arc Length weight parameter
Definition at line 159 of file LocalResliceParticleSim.hpp.
|
private |
Dump visualization to disk flag
Definition at line 165 of file LocalResliceParticleSim.hpp.
|
private |
Target z-index
Definition at line 149 of file LocalResliceParticleSim.hpp.
|
private |
Active Contour stretch parameter
Definition at line 153 of file LocalResliceParticleSim.hpp.
|
private |
Active Contour curvature parameter
Definition at line 155 of file LocalResliceParticleSim.hpp.
|
private |
Estimated material thickness in um
Definition at line 171 of file LocalResliceParticleSim.hpp.
|
private |
Number of curve optimization iterations
Definition at line 169 of file LocalResliceParticleSim.hpp.
|
private |
Distance weight factor for candidate positions
Definition at line 161 of file LocalResliceParticleSim.hpp.
|
private |
Window size for reslice
Definition at line 173 of file LocalResliceParticleSim.hpp.
|
private |
Show visualization in GUI flag
Definition at line 167 of file LocalResliceParticleSim.hpp.