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)
 
usPolynomialCurve2DgetNeedle ()
 
usPolynomialCurve2DgetParticle (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ usNeedleTrackerSIR2D()

usNeedleTrackerSIR2D::usNeedleTrackerSIR2D ( )

Default constructor.

Definition at line 37 of file usNeedleTrackerSIR2D.cpp.

◆ ~usNeedleTrackerSIR2D()

usNeedleTrackerSIR2D::~usNeedleTrackerSIR2D ( )

Destructor.

Definition at line 48 of file usNeedleTrackerSIR2D.cpp.

Member Function Documentation

◆ computeLikelihood()

double usNeedleTrackerSIR2D::computeLikelihood ( const usPolynomialCurve2D model,
const vpImage< unsigned char > &  I 
)

Computing the likelihood of the model for a given observation.

Parameters
modelThe needle model.
IThe input image.

Definition at line 252 of file usNeedleTrackerSIR2D.cpp.

References usPolynomialCurve2D::getLength(), and usPolynomialCurve2D::getPoint().

Referenced by run().

◆ getNeedle()

usPolynomialCurve2D * usNeedleTrackerSIR2D::getNeedle ( )

Returns the detected needle model.

Definition at line 114 of file usNeedleTrackerSIR2D.cpp.

◆ getParticle()

usPolynomialCurve2D * usNeedleTrackerSIR2D::getParticle ( unsigned int  i)

Get a specific particle.

Definition at line 116 of file usNeedleTrackerSIR2D.cpp.

◆ getWeight()

double usNeedleTrackerSIR2D::getWeight ( unsigned int  i)

Get a specific particle's weight.

Definition at line 126 of file usNeedleTrackerSIR2D.cpp.

◆ init() [1/2]

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.

Parameters
IReference to the image.
nPointsThe number of control points.
nParticlesThe number of particles.
needleThe initial needle model.

Definition at line 88 of file usNeedleTrackerSIR2D.cpp.

References usPolynomialCurve2D::getLength(), usPolynomialCurve2D::getPoint(), and init().

◆ init() [2/2]

void usNeedleTrackerSIR2D::init ( unsigned int  dims[2],
unsigned int  nPoints,
unsigned int  nParticles,
const usPolynomialCurve2D needle 
)

Initialization method.

Parameters
dimsThe image dimensions (height, width).
nPointsThe number of control points.
nParticlesThe number of particles.
needleThe 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().

◆ resample()

void usNeedleTrackerSIR2D::resample ( )

Resample the particles proportionnaly to their weights.

Definition at line 295 of file usNeedleTrackerSIR2D.cpp.

Referenced by run().

◆ run()

void usNeedleTrackerSIR2D::run ( vpImage< unsigned char > &  I,
double  v 
)

Runs the needle detection process with the current post-scan volume.

Parameters
IThe input image.
vThe insertion velocity.

Definition at line 142 of file usNeedleTrackerSIR2D.cpp.

References computeLikelihood(), usPolynomialCurve2D::getControlPoints(), usPolynomialCurve2D::getLength(), usPolynomialCurve2D::getNewOrderPolynomialCurve(), usPolynomialCurve2D::getTangent(), resample(), and usPolynomialCurve2D::setControlPoints().

◆ setSigma()

void usNeedleTrackerSIR2D::setSigma ( double  s)

Set the standard deviation for the update noise.

Definition at line 136 of file usNeedleTrackerSIR2D.cpp.

◆ setSigma1()

void usNeedleTrackerSIR2D::setSigma1 ( double  s)

Set the standard deviation along the insertion direction.

Definition at line 138 of file usNeedleTrackerSIR2D.cpp.

◆ setSigma2()

void usNeedleTrackerSIR2D::setSigma2 ( double  s)

Set the standard deviation orthogonal to the insertion direction.

Definition at line 140 of file usNeedleTrackerSIR2D.cpp.