Fraxinus
17.12-rc3
An IGT application
|
#include <intersection.hpp>
Public Member Functions | |
Spline3D (size_t npoints) | |
~Spline3D () | |
void | setPoint (int idx, T const pt[3]) |
void | setTransform (bool b) |
bool | getTransform () const |
void | setAxis (int axis) |
int | getAxis () const |
size_t | getLength () const |
void | setPoints (vector< T > const &x, vector< T > const &y, vector< T > const &z) |
void | applyConvolution (vector< T > const &mask) |
void | compute () |
int | length () const |
bool | intersect (T &t, Plane3D &plane, T pointOnPlane[3]) const |
void | derivativeSingle (T t, T point[3]) const |
void | evaluateSingle (T t, T point[3]) const |
Intersection< T > | findIntersection (const MetaImage< inData_t > *img) const |
void | findAllIntersections (const vector< MetaImage< inData_t > > &imgs) |
IntersectionSet< T > & | getIntersections () |
const IntersectionSet< T > & | getConstIntersections () const |
Static Public Member Functions | |
static vector< Spline3D< T > > * | build (vtkSmartPointer< vtkPolyData > data) |
Protected Member Functions | |
int | findRoots (int p, Plane3D &plane, T roots[2]) const |
Protected Attributes | |
std::vector< T > | m_points [3] |
The points to interpolate. More... | |
std::vector< T > | m_cpoints [3] |
The control points. More... | |
IntersectionSet< T > | m_intersections |
The intersections (as filled by findAllIntersections) More... | |
bool | m_initialized |
True if m_cpoints is valid. More... | |
bool | m_transform |
Whether to transform when finding vector from plane matrix. More... | |
int | m_axis |
Which axis to use from plane matrix. More... | |
A class representing a quadratic 3D B-spline curve. It is templated: the parameter T is the type of the values it interpolates as well as the type of the parameter
Definition at line 11 of file intersection.hpp.
Constructor Initialize a 3D spline with n_points number of breakpoints
npoints | the number of points |
Definition at line 36 of file spline3d.hpp.
Default constructor - initialize to 0 points Destructor Frees the splines and does cleanup
Definition at line 56 of file spline3d.hpp.
|
inline |
Apply an 1d spatial convolution to the points to interpolate
Mask | to use for convolution - must be of length 3. |
Definition at line 141 of file spline3d.hpp.
|
inlinestatic |
Contstruct a set of splines representing the centerline described as a set of lines in *data. The algorithm will detect when centerlines split and make separate spline for the branch.
data | A set of points with lines between them |
Definition at line 323 of file spline3d.hpp.
|
inline |
Initializes the underlying spline structure with the provided data. Needs to be called after adding points to the spline before evaluating it. If it isn't, it will be done automatically
Definition at line 169 of file spline3d.hpp.
|
inline |
Get the derivative of the curve at position t
t | The position to find the derivative for |
point | The gradient vector at t=t |
Definition at line 272 of file spline3d.hpp.
|
inline |
Evaluate the curve at position t
t | the parameter position to evaluate at |
point | The spatial position at parameter position t |
Definition at line 293 of file spline3d.hpp.
|
inline |
Find all intersections for a set of images. The result can be retrieved by getIntersections() and getConstIntersections
imgs | Vector of images to intersect with the curve |
Definition at line 516 of file spline3d.hpp.
|
inline |
Find an intersection with a MetaImage
img | The image to find an intersection with |
Definition at line 467 of file spline3d.hpp.
|
inlineprotected |
Find the roots of the quadratic equation that can be built by inserting the basis functions into the plane equation
p | The position in m_points such that m_points[p] and m_points[p+1] are on opposite sides of the plane |
plane | The plane (from which we get the coefficients) |
roots | The roots will be returned here |
Definition at line 562 of file spline3d.hpp.
|
inline |
Retrieve which axis of plane matrix is to be used for angle recovery
Definition at line 109 of file spline3d.hpp.
|
inline |
Get the set of intersections that was found with findAllIntersections()
Definition at line 545 of file spline3d.hpp.
|
inline |
Get the set of intersections that was found with findAllIntersections()
Definition at line 536 of file spline3d.hpp.
|
inline |
Get the length of the spline
Definition at line 118 of file spline3d.hpp.
|
inline |
Return whether plane matrix will be transformed when retrieving the vector to use for angle recovery
Definition at line 89 of file spline3d.hpp.
|
inline |
Find an intersection between this curve and a plane. The method is to first find two adjacent points in m_points (the points to interpolate) that is on different sides of the plane. Then we call findRoots() to find the exact location between those two points.
t | The position to start at. Will contain the intersection position after |
plane | The plane to intersect with |
pointOnPlane | will contain a point that is both on the curve and on the plane. |
Definition at line 206 of file spline3d.hpp.
|
inline |
Get number of points to interpolate (and thus, how far the parameter may move)
Definition at line 187 of file spline3d.hpp.
|
inline |
Set which axis of plane matrix to use for angle recovery
axis | 0 for X axis, 1 for Y axis, 2 for Z axis |
Definition at line 99 of file spline3d.hpp.
|
inline |
Set a point to interpolate
idx | Index to set |
pt | Point to set |
Definition at line 64 of file spline3d.hpp.
|
inline |
Set all points in this spline
x | X coordinates |
y | Y coordinates |
z | Z coordinates |
Definition at line 127 of file spline3d.hpp.
|
inline |
Set whether to transform the plane matrix when retrieving the vector to use for angle recovery true to transform, false otherwise
Definition at line 79 of file spline3d.hpp.
|
protected |
Which axis to use from plane matrix.
Definition at line 652 of file spline3d.hpp.
|
protected |
The control points.
Definition at line 642 of file spline3d.hpp.
|
protected |
True if m_cpoints is valid.
Definition at line 647 of file spline3d.hpp.
|
protected |
The intersections (as filled by findAllIntersections)
Definition at line 645 of file spline3d.hpp.
|
protected |
The points to interpolate.
Definition at line 640 of file spline3d.hpp.
|
protected |
Whether to transform when finding vector from plane matrix.
Definition at line 650 of file spline3d.hpp.