UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-11-21)
usPreScanToPostScan2DConverter Class Reference

#include <visp3/ustk_core/usPreScanToPostScan2DConverter.h>

Public Member Functions

 usPreScanToPostScan2DConverter ()
 
 ~usPreScanToPostScan2DConverter ()
 
void convert (const usImagePreScan2D< unsigned char > &preScanImage, usImagePostScan2D< unsigned char > &postScanImage, double xResolution=0., double yResolution=0.)
 

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)
 

Friends

class usRFToPostScan2DConverter
 

Detailed Description

2D scan-converter

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

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

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

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

#include <visp3/ustk_core/usPreScanToPostScan2DConverter.h>
int main()
{
// example of 2D pre-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 axialResolution = 0.002;
vpImage<unsigned char> I(height, width);
usImagePreScan2D <unsigned char> preScan; // your input pre-scan image
// then you can fill the preScan image and settings
preScan.setTransducerRadius(transducerRadius);
preScan.setScanLinePitch(scanLinePitch);
preScan.setScanLineNumber(scanLineNumber);
preScan.setTransducerConvexity(isTransducerConvex);
preScan.setAxialResolution(axialResolution);
preScan.setData(I);
// converter output
scanConverter.convert(preScan,postScan,0.0005,0.0005); // now postScan is filled from preScan, with pixels of 0.5mm
}
void setData(const vpImage< Type > image)
void setScanLineNumber(unsigned int scanLineNumber)
void setAxialResolution(const double axialResolution)
void convert(const usImagePreScan2D< unsigned char > &preScanImage, usImagePostScan2D< unsigned char > &postScanImage, double xResolution=0., double yResolution=0.)
void setTransducerConvexity(const bool isTransducerConvex)
void setScanLinePitch(const double scanLinePitch)
void setTransducerRadius(const double transducerRadius)
Examples
tutorial-servo-target-confidence.cpp, tutorial-sonosite-confidence-control.cpp, tutorial-sonosite-confidence-map.cpp, tutorial-ultrasonix-qt-grabbing-RF-scan-conversion.cpp, and tutorial-ultrasonix-servo-target-confidence.cpp.

Definition at line 92 of file usPreScanToPostScan2DConverter.h.

Constructor & Destructor Documentation

◆ usPreScanToPostScan2DConverter()

usPreScanToPostScan2DConverter::usPreScanToPostScan2DConverter ( )

Definition at line 36 of file usPreScanToPostScan2DConverter.cpp.

◆ ~usPreScanToPostScan2DConverter()

usPreScanToPostScan2DConverter::~usPreScanToPostScan2DConverter ( )

Definition at line 38 of file usPreScanToPostScan2DConverter.cpp.

Member Function Documentation

◆ convert()

void usPreScanToPostScan2DConverter::convert ( const usImagePreScan2D< unsigned char > &  preScanImage,
usImagePostScan2D< unsigned char > &  postScanImage,
double  xResolution = 0.,
double  yResolution = 0. 
)

◆ init() [1/2]

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

Initialize the scan-converter.

Parameters
inputSettingsPost-scan settings : transducer radius, pitch, depth, and resolutions.
BModeSampleNumberNumber of samples along a scan line : height of the pre-scan image to convert.
scanLineNumberNumber of scan lines : width of the pre-scan image to convert.

Definition at line 47 of file usPreScanToPostScan2DConverter.cpp.

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

Referenced by convert(), and usRFToPostScan2DConverter::setConversionParameters().

◆ init() [2/2]

void usPreScanToPostScan2DConverter::init ( const usTransducerSettings inputSettings,
const int  BModeSampleNumber,
const int  scanLineNumber,
const double  xResolution,
const double  yResolution 
)
protected

Initialize the scan-converter.

Parameters
inputSettingsPost-scan settings : transducer radius, pitch, depth, and resolutions.
BModeSampleNumberNumber of samples along a scan line : height of the pre-scan image to convert.
scanLineNumberNumber of scan lines : width of the pre-scan image to convert.
xResolutionSize of a pixel in x direction of the post scan image built.
yResolutionSize of a pixel in y direction of the post scan image built.

Definition at line 122 of file usPreScanToPostScan2DConverter.cpp.

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

Friends And Related Function Documentation

◆ usRFToPostScan2DConverter

friend class usRFToPostScan2DConverter
friend

Definition at line 94 of file usPreScanToPostScan2DConverter.h.