UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usImageRF2D< Type > Class Template Reference

#include <visp3/ustk_core/usImageRF2D.h>

+ Inheritance diagram for usImageRF2D< Type >:

Public Member Functions

 usImageRF2D ()
 
 usImageRF2D (unsigned int height, unsigned int width)
 
 usImageRF2D (unsigned int height, unsigned int width, const usImagePreScanSettings &preScanSettings)
 
 usImageRF2D (const usImageRF2D &other)
 
virtual ~usImageRF2D ()
 
const Type * getBitmap () const
 
unsigned int getHeight () const
 
unsigned int getNumberOfPixel () const
 
unsigned int getRFSampleNumber () const
 
const Type * getSignal (unsigned int scanlineIndex) const
 
unsigned int getWidth () const
 
void init (unsigned int height, unsigned int width)
 
usImageRF2D< Type > & operator= (const usImageRF2D< Type > &other)
 
bool operator== (const usImageRF2D< Type > &other)
 
Type operator() (unsigned int i, unsigned int j) const
 
void operator() (unsigned int i, unsigned int j, const Type &value)
 
void setScanLineNumber (unsigned int scanLineNumber)
 
void resize (const unsigned int height, const unsigned int width)
 
void resize (const unsigned int height, const unsigned int width, const Type &val)
 
Inherited functionalities from usImagePreScanSettings
double getAxialResolution () const
 
usImagePreScanSettings getImagePreScanSettings () const
 
bool operator== (const usImagePreScanSettings &other)
 
void setAxialResolution (const double axialResolution)
 
void setImagePreScanSettings (const usImagePreScanSettings &preScanSettings)
 
Inherited functionalities from usTransducerSettings
bool operator== (usTransducerSettings const &other)
 
double getDepth () const
 
double getFieldOfView () const
 
std::string getProbeName () const
 
int getSamplingFrequency () const
 
unsigned int getScanLineNumber () const
 
double getScanLinePitch () const
 
double getTransducerRadius () const
 
usTransducerSettings getTransducerSettings () const
 
int getTransmitFrequency () const
 
bool isTransducerConvex () const
 
bool operator!= (usTransducerSettings const &other)
 
bool scanLineNumberIsSet () const
 
void setDepth (double depth)
 
void setFieldOfView (double fieldOfView)
 
void setProbeName (std::string probeName)
 
void setSamplingFrequency (const int samplingFrequency)
 
void setScanLinePitch (const double scanLinePitch)
 
void setTransducerConvexity (const bool isTransducerConvex)
 
void setTransducerSettings (const usTransducerSettings &other)
 
void setTransducerRadius (const double transducerRadius)
 
void setTransmitFrequency (const int transmitFrequency)
 

Friends

class usRawFileParser
 
class usNetworkGrabberRF2D
 
class usNetworkGrabberRF3D
 
class usVirtualServer
 

Detailed Description

template<class Type>
class usImageRF2D< Type >

2D Radio Frequence (RF) ultrasound image.

This class represents a 2D RF ultrasound image. This image is nothing more than an image (respecting column-major bitmap storage) that contains additional settings that give information about the acquisition process done by the transducer.

The settings associated to an usImageRF2D image are the one implemented in usImagePreScanSettings. We recall that these settings are:

  • and an additional axial resolution parameter called $a_{_R}$ which corresponds to the distance (in meters) between two consecutive RF samples along a scan line. To set this value use setAxialResolution() and to retrieve this value use getAxialResolution().

The following figure summarize these settings and shows the structure of an usImageRF2D image:

The following example shows how to read a 2D RF ultrasound image, and set the image settings of your choice.

#include <visp3/ustk_core/usImageIo.h>
#include <visp3/ustk_core/usImageRF2D.h>
int main()
{
// 2D RF image settings
unsigned int RFSampleNumber = 2000;
double transducerRadius = 0.007;
double scanLinePitch = 0.0006;
unsigned int scanLineNumber = 256;
bool isTransducerConvex = true;
double axialResolution = 0.002;
usImageRF2D<short> rf2d(RFSampleNumber, scanLineNumber);
// sets the RF samples values contained in the .raw file in the bitmap of
//the usImageRF2D, and the settings contained in the mhd header.
usImageIo::read(rf2d, "path/to/file.mhd");
//sets your own settings
rf2d.setTransducerRadius(transducerRadius);
rf2d.setScanLinePitch(scanLinePitch);
rf2d.setScanLineNumber(scanLineNumber);
rf2d.setTransducerConvexity(isTransducerConvex);
rf2d.setAxialResolution(axialResolution);
return 0;
}
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
Definition: usImageIo.cpp:153
2D Radio Frequence (RF) ultrasound image.
Definition: usImageRF2D.h:112
Examples
testUsImageRf2DMhdParser.cpp.

Definition at line 111 of file usImageRF2D.h.

Constructor & Destructor Documentation

◆ usImageRF2D() [1/4]

template<class Type >
usImageRF2D< Type >::usImageRF2D

Constructor.

No memory allocation is done

Definition at line 164 of file usImageRF2D.h.

◆ usImageRF2D() [2/4]

template<class Type >
usImageRF2D< Type >::usImageRF2D ( unsigned int  height,
unsigned int  width 
)

Initializing constructor.

Parameters
heightImage height.
widthImage width.

Definition at line 174 of file usImageRF2D.h.

References usImageRF2D< Type >::init().

◆ usImageRF2D() [3/4]

template<class Type >
usImageRF2D< Type >::usImageRF2D ( unsigned int  height,
unsigned int  width,
const usImagePreScanSettings preScanSettings 
)

Initializing constructor.

Parameters
heightImage height.
widthImage width.
preScanSettingsPre-scan image settings.

Definition at line 187 of file usImageRF2D.h.

References usTransducerSettings::getScanLineNumber(), usImageRF2D< Type >::init(), and usImagePreScanSettings::setImagePreScanSettings().

◆ usImageRF2D() [4/4]

template<class Type >
usImageRF2D< Type >::usImageRF2D ( const usImageRF2D< Type > &  other)

Copy constructor.

Parameters
other2D RF image to copy

Definition at line 202 of file usImageRF2D.h.

References usImageRF2D< Type >::getBitmap(), usImageRF2D< Type >::getHeight(), usImageRF2D< Type >::getWidth(), and usImageRF2D< Type >::resize().

◆ ~usImageRF2D()

template<class Type >
usImageRF2D< Type >::~usImageRF2D
virtual

Destructor.

Definition at line 215 of file usImageRF2D.h.

Member Function Documentation

◆ getAxialResolution()

◆ getBitmap()

template<class Type >
const Type * usImageRF2D< Type >::getBitmap

Getter for a const pointer on the image bitmap.

Returns
Pointer on image bitmap.

Definition at line 430 of file usImageRF2D.h.

Referenced by usImageRF2D< Type >::operator=(), and usImageRF2D< Type >::usImageRF2D().

◆ getDepth()

◆ getFieldOfView()

◆ getHeight()

◆ getImagePreScanSettings()

usImagePreScanSettings usImagePreScanSettings::getImagePreScanSettings ( ) const
inherited

Definition at line 122 of file usImagePreScanSettings.cpp.

◆ getNumberOfPixel()

template<class Type >
unsigned int usImageRF2D< Type >::getNumberOfPixel

Getter for the number of pixels in the image.

Returns
Total count of pixels in the image.

Definition at line 418 of file usImageRF2D.h.

Referenced by usNetworkGrabberRF3D::dataArrived().

◆ getProbeName()

std::string usTransducerSettings::getProbeName ( ) const
inherited

Getter for the probe name.

Returns
Name of the probe.

Definition at line 232 of file usTransducerSettings.cpp.

◆ getRFSampleNumber()

template<class Type >
unsigned int usImageRF2D< Type >::getRFSampleNumber

Get the number of RF samples in a scan line.

Returns
Number of RF samples in a scan line.

Definition at line 305 of file usImageRF2D.h.

Referenced by usImageIo::write().

◆ getSamplingFrequency()

int usTransducerSettings::getSamplingFrequency ( ) const
inherited

Getter for sampling frequency : frequency used to sample the echo of the ultrasound wave.

Returns
Sampling frequency Frequency in Hz.

Definition at line 305 of file usTransducerSettings.cpp.

Referenced by usTransducerSettings::operator=(), usTransducerSettings::operator==(), usImageIo::read(), usImageIo::write(), usMHDSequenceWriter::write(), and usImageSettingsXmlParser::writeMainClass().

◆ getScanLineNumber()

◆ getScanLinePitch()

◆ getSignal()

template<class Type >
const Type * usImageRF2D< Type >::getSignal ( unsigned int  scanlineIndex) const

Getter for the RF signal at a certain scanline index.

Parameters
scanlineIndexThe index of the scanline to acess.
Returns
The RF signal.

Definition at line 437 of file usImageRF2D.h.

Referenced by usRFToPreScan2DConverter::convert().

◆ getTransducerRadius()

◆ getTransducerSettings()

usTransducerSettings usTransducerSettings::getTransducerSettings ( ) const
inherited

Getter for transducer settings : allows heritating classes to get the transducer settings.

Returns
The transducer settings.

Definition at line 295 of file usTransducerSettings.cpp.

◆ getTransmitFrequency()

int usTransducerSettings::getTransmitFrequency ( ) const
inherited

Getter for transmit frequency : frequency of the ultrasound wave used.

Returns
Transmit frequency in Hz.

Definition at line 311 of file usTransducerSettings.cpp.

Referenced by usTransducerSettings::operator=(), usTransducerSettings::operator==(), usImageIo::read(), usImageIo::write(), usMHDSequenceWriter::write(), and usImageSettingsXmlParser::writeMainClass().

◆ getWidth()

◆ init()

template<class Type >
void usImageRF2D< Type >::init ( unsigned int  height,
unsigned int  width 
)

Set the size of the image.

Image initialization.

Allocate memory for an [h x w] image, using column major image convention.

Parameters
width: Image width.
height: Image height.

Element of the bitmap are not initialized

If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

Exceptions
vpException::memoryAllocationError

Definition at line 371 of file usImageRF2D.h.

Referenced by usImageRF2D< Type >::usImageRF2D(), and usNetworkGrabberRF3D::usNetworkGrabberRF3D().

◆ isTransducerConvex()

◆ operator!=()

bool usTransducerSettings::operator!= ( usTransducerSettings const &  other)
inherited

Compare two probe transducer settings.

Returns
False if the settings are the same, true otherwise.

Definition at line 125 of file usTransducerSettings.cpp.

References usTransducerSettings::operator==().

◆ operator()() [1/2]

template<class Type >
Type usImageRF2D< Type >::operator() ( unsigned int  i,
unsigned int  j 
) const

operator() allows to access/modify RF samples values in the image.

Access operator.

Parameters
iRow index of the pixel to access.
jColumn index of the pixel to access.
Returns
The value of the pixel.

Definition at line 267 of file usImageRF2D.h.

◆ operator()() [2/2]

template<class Type >
void usImageRF2D< Type >::operator() ( unsigned int  i,
unsigned int  j,
const Type &  value 
)

Pixel writing operator.

Parameters
iRow index of the pixel to write.
jColumn index of the pixel to write.
valueThe value to write.

Definition at line 281 of file usImageRF2D.h.

◆ operator=()

template<class Type >
usImageRF2D< Type > & usImageRF2D< Type >::operator= ( const usImageRF2D< Type > &  other)

◆ operator==() [1/3]

bool usImagePreScanSettings::operator== ( const usImagePreScanSettings other)
inherited

Comparison operator.

Parameters
otherusImagePreScanSettings to compare with.

Definition at line 97 of file usImagePreScanSettings.cpp.

References usImagePreScanSettings::getAxialResolution().

Referenced by usImageRF2D< Type >::operator==().

◆ operator==() [2/3]

template<class Type >
bool usImageRF2D< Type >::operator== ( const usImageRF2D< Type > &  other)

◆ operator==() [3/3]

◆ resize() [1/2]

template<class Type >
void usImageRF2D< Type >::resize ( const unsigned int  height,
const unsigned int  width 
)

Resize the 2D RF image.

Updates also the transducer scan line number that corresponds to the image width.

Parameters
heightImage height.
widthImage width.

Definition at line 328 of file usImageRF2D.h.

Referenced by usMHDSequenceReader::acquire(), usNetworkGrabberRF3D::dataArrived(), usImageRF3D< Type >::getFrame(), usMHDSequenceReader::getImage(), usImageIo::read(), and usImageRF2D< Type >::usImageRF2D().

◆ resize() [2/2]

template<class Type >
void usImageRF2D< Type >::resize ( const unsigned int  height,
const unsigned int  width,
const Type &  val 
)

Resize the 2D RF image.

Updates also the transducer scan line number that corresponds to the image width.

Parameters
heightImage height.
widthImage width.
valValue to set in every pixel.

Definition at line 343 of file usImageRF2D.h.

◆ scanLineNumberIsSet()

bool usTransducerSettings::scanLineNumberIsSet ( ) const
inherited

Getter to know if the scan line number is set (usefull in case of field of view setter call).

Returns
Boolean to know if the scan line number is set or not.

Definition at line 277 of file usTransducerSettings.cpp.

Referenced by usTransducerSettings::operator=().

◆ setAxialResolution()

◆ setDepth()

◆ setFieldOfView()

void usTransducerSettings::setFieldOfView ( double  fieldOfView)
inherited

Setter for the transducer field of view (updates the scan line pitch).

Parameters
fieldOfViewThe transducer field of view in radians if the transducer is convex, in meters if the transducer is linear.
Warning
Be sure to use setScanLineNumber() to update the scan line number before the field of view since this method computes the scan line pitch from the field of view and the scan line pitch.
usTransducerSettings transducerSettings;
transducerSettings.setScanLineNumber(128);
transducerSettings.setFieldOfView(vpMath::rad(57.0)); // field of view is 57 deg
Generic class for 2D ultrasound data common settings associated to the type of probe transducer used ...
void setFieldOfView(double fieldOfView)
void setScanLineNumber(unsigned int scanLineNumber)
Examples
tutorial-servo-target-confidence.cpp, tutorial-servo-target.cpp, tutorial-sonosite-confidence-control.cpp, and tutorial-sonosite-confidence-map.cpp.

Definition at line 265 of file usTransducerSettings.cpp.

Referenced by usPostScanToPreScan2DConverter::convert().

◆ setImagePreScanSettings()

◆ setProbeName()

void usTransducerSettings::setProbeName ( std::string  probeName)
inherited

◆ setSamplingFrequency()

◆ setScanLineNumber()

template<class Type >
void usImageRF2D< Type >::setScanLineNumber ( unsigned int  scanLineNumber)

Set the transducer scan line number.

Resize also the image width that is equal to the scan line number.

Parameters
scanLineNumberNumber of scan lines acquired by the transducer.

Definition at line 313 of file usImageRF2D.h.

References usTransducerSettings::setScanLineNumber().

◆ setScanLinePitch()

void usTransducerSettings::setScanLinePitch ( const double  scanLinePitch)
inherited

◆ setTransducerConvexity()

◆ setTransducerRadius()

◆ setTransducerSettings()

void usTransducerSettings::setTransducerSettings ( const usTransducerSettings other)
inherited

Assignment operator.

Parameters
otherSettings you want to assign.
See also
operator=()
Examples
tutorial-ultrasonix-qt-grabbing-RF-scan-conversion.cpp.

Definition at line 210 of file usTransducerSettings.cpp.

Referenced by usPreScanToPostScan3DConverter::convert().

◆ setTransmitFrequency()

Friends And Related Function Documentation

◆ usNetworkGrabberRF2D

template<class Type >
friend class usNetworkGrabberRF2D
friend

Definition at line 114 of file usImageRF2D.h.

◆ usNetworkGrabberRF3D

template<class Type >
friend class usNetworkGrabberRF3D
friend

Definition at line 115 of file usImageRF2D.h.

◆ usRawFileParser

template<class Type >
friend class usRawFileParser
friend

Definition at line 113 of file usImageRF2D.h.

◆ usVirtualServer

template<class Type >
friend class usVirtualServer
friend

Definition at line 116 of file usImageRF2D.h.