UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usNeedleDetectionTools Namespace Reference

Functions

double angle (double *p1, double *p2, double *q1, double *q2)
 
vpMatrix approximateCoordinates (vpMatrix X, vpMatrix MSS, unsigned int s)
 
void arithmeticMean (const vpMatrix points, double *mean, unsigned int npts, unsigned int d)
 
void computeQuantile (unsigned char *data, unsigned int dataSize, unsigned int nDesired, unsigned int &q, unsigned int &nThresholded)
 
void computeQuantile (short *data, unsigned int dataSize, unsigned int nDesired, unsigned int &q, unsigned int &nThresholded)
 
void computeQuantile (const unsigned int *data, unsigned int dataSize, unsigned int nDesired, unsigned int &q, unsigned int &nThresholded)
 
void computeControlPoints (const vpMatrix &model, vpMatrix &mss, double **points, const unsigned int &nPoints)
 
double dist3 (double *x, double *y)
 
bool findEntry (const vpMatrix &model, double *entry, unsigned int nPoints, const vpColVector &origin, const vpColVector &entryPlane, int VOI[6])
 
vpColVector geometricMedian (const vpMatrix points, unsigned int npts, unsigned int d)
 
bool inside (const vpColVector point, int *VOI)
 
bool intersectionLinePlane (vpMatrix line, const vpColVector &plane, double offset, double &x, double &y, double &z)
 
void linearRegression (vpMatrix &points, double &x, double &y, double &z, double &u, double &v, double &w)
 
void linearRegression (vpMatrix &points, double &a, double &b, double &u, double &v, double &w)
 
short quantile (short *data, unsigned int num, unsigned int n)
 
double variance (vpMatrix points, unsigned int npts, unsigned int d)
 

Detailed Description

Basic tools for needle detection.

This class implements various tools for 3D point cloud processing.

Function Documentation

◆ angle()

double usNeedleDetectionTools::angle ( double *  p1,
double *  p2,
double *  q1,
double *  q2 
)

Compute the principal angle between two vectors.

Definition at line 225 of file usNeedleDetectionTools.cpp.

◆ approximateCoordinates()

vpMatrix usNeedleDetectionTools::approximateCoordinates ( vpMatrix  X,
vpMatrix  MSS,
unsigned int  s 
)

Approximate curvilinear coordinates.

Parameters
XThe points for which to compute the coordinates.
MSSThe control points of the curve.
sThe order of the polynomial curve.
Returns
The Vandermonde matrix built from the approximate curvilinear coordinates of X.

Computes the approximate curvilinear coordinates of the points X for the model MSS.

Given $X\in\mathbb{R}^{n\times d}$, and $MSS\in\mathbb{R}^{s\times d}$, the approximate coordinate of $X_i$ for $i\in[1,n]$ is defined as $\hat{a}_i=\frac{(X_i-MSS_1)\cdot \mathbf{k}_0}{||\mathbf{k}_0||}$, where $k_0$ is the principal direction vector of the needle.

The result is a Vandermonde matrix built from the coordinates of all points in $X$:

\[ A = \left[ \begin{array}{ccc} 1 & \cdots & 1\\ \hat{a}_1 & \cdots & \hat{a}_n\\ \vdots & & \vdots\\ \hat{a}_1^{s-1} & \cdots & \hat{a}_n^{s-1} \end{array} \right] \]

Definition at line 357 of file usNeedleDetectionTools.cpp.

Referenced by computeControlPoints().

◆ arithmeticMean()

void usNeedleDetectionTools::arithmeticMean ( const vpMatrix  points,
double *  mean,
unsigned int  npts,
unsigned int  d 
)

Compute the mean (center of mass) of a set of d-dimensional points.

Parameters
pointsThe input points.
meanPointer to hold the result.
nptsNumber of points.
dDimension.

Definition at line 36 of file usNeedleDetectionTools.cpp.

Referenced by geometricMedian(), and variance().

◆ computeControlPoints()

void usNeedleDetectionTools::computeControlPoints ( const vpMatrix &  model,
vpMatrix &  mss,
double **  points,
const unsigned int &  nPoints 
)

Definition at line 333 of file usNeedleDetectionTools.cpp.

References approximateCoordinates().

◆ computeQuantile() [1/3]

void usNeedleDetectionTools::computeQuantile ( const unsigned int *  data,
unsigned int  dataSize,
unsigned int  nDesired,
unsigned int &  q,
unsigned int &  nThresholded 
)

Definition at line 142 of file usNeedleDetectionTools.cpp.

◆ computeQuantile() [2/3]

void usNeedleDetectionTools::computeQuantile ( short *  data,
unsigned int  dataSize,
unsigned int  nDesired,
unsigned int &  q,
unsigned int &  nThresholded 
)

Definition at line 125 of file usNeedleDetectionTools.cpp.

◆ computeQuantile() [3/3]

void usNeedleDetectionTools::computeQuantile ( unsigned char *  data,
unsigned int  dataSize,
unsigned int  nDesired,
unsigned int &  q,
unsigned int &  nThresholded 
)

Definition at line 108 of file usNeedleDetectionTools.cpp.

◆ dist3()

double usNeedleDetectionTools::dist3 ( double *  x,
double *  y 
)

Compute the euclidean distance between two 3D points.

Definition at line 217 of file usNeedleDetectionTools.cpp.

◆ findEntry()

bool usNeedleDetectionTools::findEntry ( const vpMatrix &  model,
double *  entry,
unsigned int  nPoints,
const vpColVector &  origin,
const vpColVector &  entryPlane,
int  VOI[6] 
)

Definition at line 163 of file usNeedleDetectionTools.cpp.

References inside(), and intersectionLinePlane().

◆ geometricMedian()

vpColVector usNeedleDetectionTools::geometricMedian ( const vpMatrix  points,
unsigned int  npts,
unsigned int  d 
)

Compute the geometric median of a set of d-dimensional points.

Parameters
pointsThe input points.
nptsNumber of points.
dDimension.

Definition at line 48 of file usNeedleDetectionTools.cpp.

References arithmeticMean().

◆ inside()

bool usNeedleDetectionTools::inside ( const vpColVector  point,
int *  VOI 
)

Definition at line 210 of file usNeedleDetectionTools.cpp.

Referenced by findEntry().

◆ intersectionLinePlane()

bool usNeedleDetectionTools::intersectionLinePlane ( vpMatrix  line,
const vpColVector &  plane,
double  offset,
double &  x,
double &  y,
double &  z 
)

Get the intersection between a plane and a straight line.

Definition at line 391 of file usNeedleDetectionTools.cpp.

Referenced by findEntry().

◆ linearRegression() [1/2]

void usNeedleDetectionTools::linearRegression ( vpMatrix &  points,
double &  a,
double &  b,
double &  u,
double &  v,
double &  w 
)

Definition at line 286 of file usNeedleDetectionTools.cpp.

◆ linearRegression() [2/2]

void usNeedleDetectionTools::linearRegression ( vpMatrix &  points,
double &  x,
double &  y,
double &  z,
double &  u,
double &  v,
double &  w 
)

Performs linear regression on a set of 3D points.

Definition at line 238 of file usNeedleDetectionTools.cpp.

◆ quantile()

short usNeedleDetectionTools::quantile ( short *  data,
unsigned int  num,
unsigned int  n 
)

Definition at line 91 of file usNeedleDetectionTools.cpp.

◆ variance()

double usNeedleDetectionTools::variance ( vpMatrix  points,
unsigned int  npts,
unsigned int  d 
)

Compute the variance of a set of d-dimensional points.

Definition at line 78 of file usNeedleDetectionTools.cpp.

References arithmeticMean().