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

Fits a curve to a set of points for resampling. More...

#include <vc/segmentation/lrps/FittedCurve.hpp>

Collaboration diagram for volcart::segmentation::FittedCurve:
[legend]

Public Member Functions

std::size_t size () const
 Return the current number of resampled points in the spline. More...
 
const std::vector< Voxel > & points () const
 Return the current list of resampled points. More...
 
const decltype(spline_) & spline () const
 Return the spline created from the input points. More...
 
Pixel eval (double t) const
 Resample the curve at a given t-value in [0.0, 1.0]. More...
 
std::vector< Voxel > evenlySpacePoints ()
 Evenly resample the curve with the same number of points as the input set. More...
 
std::vector< Voxel > resample (double resamplePerc=1.0)
 Resample the curve at a t-interval of resamplePerc. More...
 
std::vector< Voxel > sample (std::size_t numPoints) const
 Resample the curve to have numPoints of evenly spaced points.
 
Voxel operator() (int index) const
 Returns the voxel located at index.
 
std::vector< double > curvature (int hstep=1) const
 Calculate the local curvature along the spline. More...
 
double arclength () const
 Calculate the arc length of the curve

 
Constructors
 FittedCurve ()=default
 
 FittedCurve (const std::vector< Voxel > &vs, int zIndex)
 Construct curve from set of points and z-Index. More...
 

Private Attributes

std::size_t npoints_ {0}
 
int zIndex_ {0}
 
std::vector< double > ts_
 
std::vector< Voxel > points_
 
CubicSpline< double > spline_
 

Detailed Description

Fits a curve to a set of points for resampling.

Definition at line 19 of file FittedCurve.hpp.

Constructor & Destructor Documentation

◆ FittedCurve()

volcart::segmentation::FittedCurve::FittedCurve ( const std::vector< Voxel > &  vs,
int  zIndex 
)

Construct curve from set of points and z-Index.

All points in generated curve are assumed to be at z = zIndex.

Parameters
vsList of 2D points to fit
zIndexCurrent location in curve

Member Function Documentation

◆ curvature()

std::vector< double > volcart::segmentation::FittedCurve::curvature ( int  hstep = 1) const

Calculate the local curvature along the spline.

Parameters
hstepHow much to move by each time you move Default: 1 point

◆ eval()

Pixel volcart::segmentation::FittedCurve::eval ( double  t) const
inline

Resample the curve at a given t-value in [0.0, 1.0].

Definition at line 59 of file FittedCurve.hpp.

◆ evenlySpacePoints()

std::vector< Voxel > volcart::segmentation::FittedCurve::evenlySpacePoints ( )
inline

Evenly resample the curve with the same number of points as the input set.

Definition at line 63 of file FittedCurve.hpp.

◆ points()

const std::vector< Voxel > & volcart::segmentation::FittedCurve::points ( ) const
inline

Return the current list of resampled points.

Definition at line 53 of file FittedCurve.hpp.

◆ resample()

std::vector< Voxel > volcart::segmentation::FittedCurve::resample ( double  resamplePerc = 1.0)

Resample the curve at a t-interval of resamplePerc.

Parameters
resamplePercSampling interval, in percent of original number of points

◆ size()

std::size_t volcart::segmentation::FittedCurve::size ( ) const
inline

Return the current number of resampled points in the spline.

Definition at line 50 of file FittedCurve.hpp.

◆ spline()

const decltype(spline_) & volcart::segmentation::FittedCurve::spline ( ) const
inline

Return the spline created from the input points.

Definition at line 56 of file FittedCurve.hpp.

Member Data Documentation

◆ npoints_

std::size_t volcart::segmentation::FittedCurve::npoints_ {0}
private

Number of points in the curve

Definition at line 23 of file FittedCurve.hpp.

◆ points_

std::vector<Voxel> volcart::segmentation::FittedCurve::points_
private

List of sampled points

Definition at line 29 of file FittedCurve.hpp.

◆ spline_

CubicSpline<double> volcart::segmentation::FittedCurve::spline_
private

Spline representation of curve

Definition at line 31 of file FittedCurve.hpp.

◆ ts_

std::vector<double> volcart::segmentation::FittedCurve::ts_
private

Parameterized nodes

Definition at line 27 of file FittedCurve.hpp.

◆ zIndex_

int volcart::segmentation::FittedCurve::zIndex_ {0}
private

z-position of the curve

Definition at line 25 of file FittedCurve.hpp.


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