Volume Cartographer 2.28.0
FittedCurve.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6#include <vector>
7
10
12{
19{
20public:
23
26 FittedCurve() = default;
27
36 FittedCurve(const std::vector<Voxel>& vs, int zIndex);
40 [[nodiscard]] auto size() const -> std::size_t;
41
43 [[nodiscard]] auto points() const -> const std::vector<Voxel>&;
44
46 [[nodiscard]] auto spline() const -> const Spline&;
47
49 [[nodiscard]] auto eval(double t) const -> Pixel;
50
53 [[nodiscard]] auto evenlySpacePoints() -> std::vector<Voxel>;
54
62 auto resample(double resamplePerc = 1.0) -> std::vector<Voxel>;
63
65 [[nodiscard]] auto sample(std::size_t numPoints) const
66 -> std::vector<Voxel>;
67
69 auto operator()(int index) const -> Voxel;
70
75 [[nodiscard]] auto curvature(int hstep = 1) const -> std::vector<double>;
76
78 [[nodiscard]] auto arclength() const -> double;
79
80private:
82 std::size_t npoints_{0};
84 int zIndex_{0};
86 std::vector<double> ts_;
88 std::vector<Voxel> points_;
91};
92} // namespace volcart::segmentation
Fits a curve to a set of points for resampling.
Definition: FittedCurve.hpp:19
auto evenlySpacePoints() -> std::vector< Voxel >
Evenly resample the curve with the same number of points as the input set.
auto points() const -> const std::vector< Voxel > &
Return the current list of resampled points.
auto size() const -> std::size_t
Return the current number of resampled points in the spline.
auto resample(double resamplePerc=1.0) -> std::vector< Voxel >
Resamples the curve at a t-interval of resamplePerc.
auto spline() const -> const Spline &
Return the spline created from the input points.
auto sample(std::size_t numPoints) const -> std::vector< Voxel >
Sample the curve into numPoints of evenly spaced points.
auto curvature(int hstep=1) const -> std::vector< double >
Calculate the local curvature along the spline.
FittedCurve(const std::vector< Voxel > &vs, int zIndex)
Construct curve from set of points and z-Index.
auto eval(double t) const -> Pixel
Resample the curve at a given t-value in [0.0, 1.0].
auto arclength() const -> double
Calculate the arc length of the curve
Segmentation algorithms and utilities library