UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-12-17)
usPostScanToPreScan2DConverter Class Reference

#include <visp3/ustk_core/usPostScanToPreScan2DConverter.h>

Public Member Functions

 usPostScanToPreScan2DConverter ()
 
 usPostScanToPreScan2DConverter (const usImagePostScan2D< unsigned char > &inputSettings, const int BModeSampleNumber, const int scanLineNumber)
 
 usPostScanToPreScan2DConverter (const usTransducerSettings &transducerSettings, const int BModeSampleNumber, const int scanLineNumber, const double xResolution, const double yResolution)
 
 ~usPostScanToPreScan2DConverter ()
 
void convert (const usImagePostScan2D< unsigned char > &imageToConvert, usImagePreScan2D< unsigned char > &imageConverted, int preScanSamples)
 

Protected Member Functions

void init (const usImagePostScan2D< unsigned char > &inputSettings, const int BModeSampleNumber, const int scanLineNumber)
 
void init (const usTransducerSettings &inputSettings, const int BModeSampleNumber, const int scanLineNumber, const double xResolution, const double yResolution)
 

Detailed Description

2D back-scan converter

This class allows to convert a 2D post-scan ultrasound image to a pre-scan image. The convertion is applied in the convert() method.

Considering the following usImagePostScan2D image (convex or linear) as input:

this class generates an usImagePreScan2D (convex or linear) as output:

Here is an example of how to use the converter, to build a pre-scan image from a post-scan image.

#include <visp3/ustk_core/usPostScanToPreScan2DConverter.h>
int main()
{
// example of 2D post-scan image settings
unsigned int width = 320;
unsigned int height = 240;
double transducerRadius = 0.045;
double scanLinePitch = 0.0012;
unsigned int scanLineNumber = 256;
bool isTransducerConvex = true;
double widthResolution = 0.002;
double heightResolution = 0.002;
vpImage<unsigned char> I(height, width); // to fill
postScan2d.setTransducerRadius(transducerRadius);
postScan2d.setScanLinePitch(scanLinePitch);
postScan2d.setScanLineNumber(scanLineNumber);
postScan2d.setTransducerConvexity(isTransducerConvex);
postScan2d.setWidthResolution(widthResolution);
postScan2d.setHeightResolution(heightResolution);
postScan2d.setData(I);
usImagePreScan2D <unsigned char> preScan; // converter output
backConverter.convert(postScan2d, preScan, 480); // preScan is now an image built from postScan image
}
void setHeightResolution(double heightResolution)
void setData(const vpImage< Type > &image)
void setWidthResolution(double widthResolution)
void convert(const usImagePostScan2D< unsigned char > &imageToConvert, usImagePreScan2D< unsigned char > &imageConverted, int preScanSamples)
void setTransducerConvexity(const bool isTransducerConvex)
void setScanLinePitch(const double scanLinePitch)
void setTransducerRadius(const double transducerRadius)
void setScanLineNumber(unsigned int scanLineNumber)
Examples
tutorial-servo-target-confidence.cpp, tutorial-sonosite-confidence-control.cpp, tutorial-sonosite-confidence-map.cpp, and tutorial-ultrasonix-servo-target-confidence.cpp.

Definition at line 90 of file usPostScanToPreScan2DConverter.h.

Constructor & Destructor Documentation

◆ usPostScanToPreScan2DConverter() [1/3]

usPostScanToPreScan2DConverter::usPostScanToPreScan2DConverter ( )

Default constructor.

Definition at line 39 of file usPostScanToPreScan2DConverter.cpp.

◆ usPostScanToPreScan2DConverter() [2/3]

usPostScanToPreScan2DConverter::usPostScanToPreScan2DConverter ( const usImagePostScan2D< unsigned char > &  inputSettings,
const int  BModeSampleNumber,
const int  scanLineNumber 
)

Initialisation constructor.

Parameters
inputSettingsPost-scan settings you want to use to back-convert image.
BModeSampleNumberNumber of samples along a scan line : height of the pre-scan image built by run().
scanLineNumberNumber of scan lines : width of the pre-scan image built by run().

Definition at line 47 of file usPostScanToPreScan2DConverter.cpp.

References init().

◆ usPostScanToPreScan2DConverter() [3/3]

usPostScanToPreScan2DConverter::usPostScanToPreScan2DConverter ( const usTransducerSettings transducerSettings,
const int  BModeSampleNumber,
const int  scanLineNumber,
const double  xResolution,
const double  yResolution 
)

Default constructor.

Definition at line 56 of file usPostScanToPreScan2DConverter.cpp.

References init().

◆ ~usPostScanToPreScan2DConverter()

usPostScanToPreScan2DConverter::~usPostScanToPreScan2DConverter ( )

Destructor.

Definition at line 66 of file usPostScanToPreScan2DConverter.cpp.

Member Function Documentation

◆ convert()

◆ init() [1/2]

void usPostScanToPreScan2DConverter::init ( const usImagePostScan2D< unsigned char > &  inputSettings,
const int  BModeSampleNumber,
const int  scanLineNumber 
)
protected

Initialize the back-scan converter.

Parameters
inputSettingsPost-scan settings you want to use to back-convert image.
BModeSampleNumberNumber of samples along a scan line : height of the pre-scan image built by run().
scanLineNumberNumber of scan lines : width of the pre-scan image built by run().

Definition at line 74 of file usPostScanToPreScan2DConverter.cpp.

References usTransducerSettings::getDepth(), usTransducerSettings::getFieldOfView(), usImagePostScan2D< Type >::getHeightResolution(), usTransducerSettings::getScanLinePitch(), usTransducerSettings::getTransducerRadius(), usImagePostScan2D< Type >::getWidthResolution(), and usTransducerSettings::isTransducerConvex().

Referenced by convert(), and usPostScanToPreScan2DConverter().

◆ init() [2/2]

void usPostScanToPreScan2DConverter::init ( const usTransducerSettings transducerSettings,
const int  BModeSampleNumber,
const int  scanLineNumber,
const double  xResolution,
const double  yResolution 
)
protected

Initialize the back-scan converter.

Parameters
transducerSettingsTransducer settings of the pre-scan image.
xResolutionHeight of a pixel
yResolutionWidth of a pixel.
BModeSampleNumberNumber of pre-scan samples you want in output of back conversion.
scanLineNumberNumber of scan lines you want in output of back conversion.

Definition at line 137 of file usPostScanToPreScan2DConverter.cpp.

References usTransducerSettings::getDepth(), usTransducerSettings::getFieldOfView(), usTransducerSettings::getTransducerRadius(), and usTransducerSettings::isTransducerConvex().