UsTK : Ultrasound ToolKit
version 2.0.1 under development (2024-12-17)
|
#include <visp3/ustk_needle_detection/usNeedleTrackerSIR2D.h>
Public Member Functions | |
usNeedleTrackerSIR2D () | |
~usNeedleTrackerSIR2D () | |
double | computeLikelihood (const usPolynomialCurve2D &model, const vpImage< unsigned char > &I) |
usPolynomialCurve2D * | getNeedle () |
usPolynomialCurve2D * | getParticle (unsigned int i) |
double | getWeight (unsigned int i) |
void | init (unsigned int dims[2], unsigned int nPoints, unsigned int nParticles, const usPolynomialCurve2D &needle) |
void | init (const vpImage< unsigned char > &I, unsigned int nPoints, unsigned int nParticles, const usPolynomialCurve2D &needle) |
void | resample () |
void | run (vpImage< unsigned char > &I, double v) |
void | setSigma (double s) |
void | setSigma1 (double s) |
void | setSigma2 (double s) |
Needle detection in 2D images based on particle filtering.
This class defines the particle-based needle detection pipeline for 2D images.
See [1] for more details.
Definition at line 53 of file usNeedleTrackerSIR2D.h.
usNeedleTrackerSIR2D::usNeedleTrackerSIR2D | ( | ) |
Default constructor.
Definition at line 37 of file usNeedleTrackerSIR2D.cpp.
usNeedleTrackerSIR2D::~usNeedleTrackerSIR2D | ( | ) |
Destructor.
Definition at line 48 of file usNeedleTrackerSIR2D.cpp.
double usNeedleTrackerSIR2D::computeLikelihood | ( | const usPolynomialCurve2D & | model, |
const vpImage< unsigned char > & | I | ||
) |
Computing the likelihood of the model for a given observation.
model | The needle model. |
I | The input image. |
Definition at line 252 of file usNeedleTrackerSIR2D.cpp.
References usPolynomialCurve2D::getLength(), and usPolynomialCurve2D::getPoint().
Referenced by run().
usPolynomialCurve2D * usNeedleTrackerSIR2D::getNeedle | ( | ) |
Returns the detected needle model.
Definition at line 114 of file usNeedleTrackerSIR2D.cpp.
usPolynomialCurve2D * usNeedleTrackerSIR2D::getParticle | ( | unsigned int | i | ) |
Get a specific particle.
Definition at line 116 of file usNeedleTrackerSIR2D.cpp.
double usNeedleTrackerSIR2D::getWeight | ( | unsigned int | i | ) |
Get a specific particle's weight.
Definition at line 126 of file usNeedleTrackerSIR2D.cpp.
void usNeedleTrackerSIR2D::init | ( | const vpImage< unsigned char > & | I, |
unsigned int | nPoints, | ||
unsigned int | nParticles, | ||
const usPolynomialCurve2D & | needle | ||
) |
Initialization method.
Initializes all attributes with default values and the given image resolution. Should be called before to start the detection.
I | Reference to the image. |
nPoints | The number of control points. |
nParticles | The number of particles. |
needle | The initial needle model. |
Definition at line 88 of file usNeedleTrackerSIR2D.cpp.
References usPolynomialCurve2D::getLength(), usPolynomialCurve2D::getPoint(), and init().
void usNeedleTrackerSIR2D::init | ( | unsigned int | dims[2], |
unsigned int | nPoints, | ||
unsigned int | nParticles, | ||
const usPolynomialCurve2D & | needle | ||
) |
Initialization method.
dims | The image dimensions (height, width). |
nPoints | The number of control points. |
nParticles | The number of particles. |
needle | The initial needle model. |
Initializes the particle filter. Should be called before to start the detection.
Definition at line 70 of file usNeedleTrackerSIR2D.cpp.
References usPolynomialCurve2D::getOrder().
Referenced by init().
void usNeedleTrackerSIR2D::resample | ( | ) |
Resample the particles proportionnaly to their weights.
Definition at line 295 of file usNeedleTrackerSIR2D.cpp.
Referenced by run().
void usNeedleTrackerSIR2D::run | ( | vpImage< unsigned char > & | I, |
double | v | ||
) |
Runs the needle detection process with the current post-scan volume.
I | The input image. |
v | The insertion velocity. |
Definition at line 142 of file usNeedleTrackerSIR2D.cpp.
References computeLikelihood(), usPolynomialCurve2D::getControlPoints(), usPolynomialCurve2D::getLength(), usPolynomialCurve2D::getNewOrderPolynomialCurve(), usPolynomialCurve2D::getTangent(), resample(), and usPolynomialCurve2D::setControlPoints().
void usNeedleTrackerSIR2D::setSigma | ( | double | s | ) |
Set the standard deviation for the update noise.
Definition at line 136 of file usNeedleTrackerSIR2D.cpp.
void usNeedleTrackerSIR2D::setSigma1 | ( | double | s | ) |
Set the standard deviation along the insertion direction.
Definition at line 138 of file usNeedleTrackerSIR2D.cpp.
void usNeedleTrackerSIR2D::setSigma2 | ( | double | s | ) |
Set the standard deviation orthogonal to the insertion direction.
Definition at line 140 of file usNeedleTrackerSIR2D.cpp.