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

#include <visp3/ustk_core/usRFToPostScan2DConverter.h>

Public Member Functions

 usRFToPostScan2DConverter (int decimationFactor=10)
 
 ~usRFToPostScan2DConverter ()
 
void convert (const usImageRF2D< short int > &rfImage, usImagePostScan2D< unsigned char > &postScanImage)
 
void setConversionParameters (const usImagePostScan2D< unsigned char > &inputSettings, const int BModeSampleNumber, const int scanLineNumber, const int decimationFactor)
 

Detailed Description

2D conversion from RF signal to post-scan image

This class allows to convert 2D RF ultrasound images to post-scan. Here is an example to show how to use it :

#include <visp3/core/vpImage.h>
#include <visp3/ustk_core/usRFToPostScan2DConverter.h>
#include <visp3/ustk_core/usImageRF2D.h>
#include <visp3/ustk_core/usImagePostScan2D.h>
int main()
{
#if defined(USTK_HAVE_FFTW)
// 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 axialResolution = 0.002;
vpImage<short int> I(height, width);
usImageRF2D<short int> rfImage; // to fill (image + settings)
rfImage.setTransducerRadius(transducerRadius);
rfImage.setScanLinePitch(scanLinePitch);
rfImage.setScanLineNumber(scanLineNumber);
rfImage.setTransducerConvexity(isTransducerConvex);
rfImage.setAxialResolution(axialResolution);
postscanImage.setHeightResolution(0.0005);
postscanImage.setWidthResolution(0.0005); // pixels of 0.5*0.5 mm in output
converter.setConversionParameters(postscanImage,rfImage.getRFSampleNumber()/10,rfImage.getScanLineNumber(),10);
converter.convert(rfImage,postscanImage);
#endif
return 0;
}
void setHeightResolution(double heightResolution)
void setWidthResolution(double widthResolution)
void setAxialResolution(const double axialResolution)
void setScanLineNumber(unsigned int scanLineNumber)
Definition: usImageRF2D.h:313
unsigned int getRFSampleNumber() const
Definition: usImageRF2D.h:305
2D conversion from RF signal to post-scan image
void convert(const usImageRF2D< short int > &rfImage, usImagePostScan2D< unsigned char > &postScanImage)
void setConversionParameters(const usImagePostScan2D< unsigned char > &inputSettings, const int BModeSampleNumber, const int scanLineNumber, const int decimationFactor)
void setTransducerConvexity(const bool isTransducerConvex)
void setScanLinePitch(const double scanLinePitch)
void setTransducerRadius(const double transducerRadius)
unsigned int getScanLineNumber() const

Definition at line 100 of file usRFToPostScan2DConverter.h.

Constructor & Destructor Documentation

◆ usRFToPostScan2DConverter()

usRFToPostScan2DConverter::usRFToPostScan2DConverter ( int  decimationFactor = 10)

Constructor.

Parameters
decimationFactorDecimation factor : keep only 1 pre-scan sample every N sample (N = decimationFactor)

Definition at line 47 of file usRFToPostScan2DConverter.cpp.

◆ ~usRFToPostScan2DConverter()

usRFToPostScan2DConverter::~usRFToPostScan2DConverter ( )

Destructor.

Definition at line 55 of file usRFToPostScan2DConverter.cpp.

Member Function Documentation

◆ convert()

void usRFToPostScan2DConverter::convert ( const usImageRF2D< short int > &  rfImage,
usImagePostScan2D< unsigned char > &  postScanImage 
)

Convert method : performs the conversion from RF frame to a post-scan frame using the following processes :

  • Enveloppe detector
  • Logarithmic compression
  • Decimation
  • Scan conversion
Parameters
rfImageRF frame to convert
postScanImagepost-scan image : result of convertion

Definition at line 67 of file usRFToPostScan2DConverter.cpp.

References usPreScanToPostScan2DConverter::convert(), and usRFToPreScan2DConverter::convert().

◆ setConversionParameters()

void usRFToPostScan2DConverter::setConversionParameters ( const usImagePostScan2D< unsigned char > &  inputSettings,
const int  BModeSampleNumber,
const int  scanLineNumber,
const int  decimationFactor 
)

(Re-)Initialize the converter.

Parameters
inputSettingsPost-scan settings : transducer radius, pitch, depth, and resolutions.
BModeSampleNumberNumber of samples along a scan line in pre-scan image.
scanLineNumberNumber of scan lines : width of the RF image to convert.
decimationFactorDecimation factor : keep only 1 pre-scan sample every N sample from RF signal (N = decimationFactor).
Warning
Make sure RFsampleNumer / decimationFactor = BModeSampleNumber

Definition at line 84 of file usRFToPostScan2DConverter.cpp.

References usPreScanToPostScan2DConverter::init(), and usRFToPreScan2DConverter::setDecimationFactor().