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

#include <visp3/ustk_core/usImagePreScan2D.h>

+ Inheritance diagram for usImagePreScan2D< Type >:

Public Member Functions

 usImagePreScan2D ()
 
 usImagePreScan2D (unsigned int height, unsigned int width)
 
 usImagePreScan2D (const vpImage< Type > &image, const usImagePreScanSettings &preScanSettings)
 
 usImagePreScan2D (const usImagePreScan2D &other)
 
virtual ~usImagePreScan2D ()
 
unsigned int getBModeSampleNumber () const
 
usImagePreScan2D< Type > & operator= (const usImagePreScan2D< Type > &other)
 
bool operator== (const usImagePreScan2D< Type > &other)
 
bool operator!= (const usImagePreScan2D< Type > &other)
 
void setData (const vpImage< Type > image)
 
void setScanLineNumber (unsigned int scanLineNumber)
 
void resize (const unsigned int h, const unsigned int w)
 
void resize (const unsigned int h, const unsigned int w, 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)
 

Detailed Description

template<class Type>
class usImagePreScan2D< Type >

2D pre-scan ultrasound image.

This class represents a 2D pre-scan ultrasound image. This image is nothing more than a vpImage that contains ultrasound 2D pre-scan data and additional settings that give information about the acquisition process done by the transducer. The bitmap storage is done in row-major.

The settings associated to an usImagePreScan2D 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 B-Mode 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 usImagePreScan2D image:

The following example shows how to build a 2D pre-scan ultrasound image from a vpImage and from acquisition settings.

#include <visp3/ustk_core/usImagePreScan2D.h>
int main()
{
// 2D pre-scan image settings
unsigned int BModeSampleNumber = 200;
double transducerRadius = 0.007;
double scanLinePitch = 0.04;
unsigned int scanLineNumber = 256;
bool isTransducerConvex = true;
double axialResolution = 0.005;
vpImage<unsigned char> I(BModeSampleNumber, scanLineNumber);
preScan2d.setTransducerRadius(transducerRadius);
preScan2d.setScanLinePitch(scanLinePitch);
preScan2d.setScanLineNumber(scanLineNumber);
preScan2d.setAxialResolution(axialResolution);
preScan2d.setData(I);
}
void setData(const vpImage< Type > image)
void setScanLineNumber(unsigned int scanLineNumber)
void setAxialResolution(const double axialResolution)
void setTransducerConvexity(const bool isTransducerConvex)
void setScanLinePitch(const double scanLinePitch)
void setTransducerRadius(const double transducerRadius)

Definition at line 105 of file usImagePreScan2D.h.

Constructor & Destructor Documentation

◆ usImagePreScan2D() [1/4]

template<class Type >
usImagePreScan2D< Type >::usImagePreScan2D

Basic constructor, all settings set to default values.

Definition at line 141 of file usImagePreScan2D.h.

◆ usImagePreScan2D() [2/4]

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

Constructor from image size.

Parameters
heightImage height.
widthImage width.

Definition at line 159 of file usImagePreScan2D.h.

References usTransducerSettings::setScanLineNumber().

◆ usImagePreScan2D() [3/4]

template<class Type >
usImagePreScan2D< Type >::usImagePreScan2D ( const vpImage< Type > &  image,
const usImagePreScanSettings preScanSettings 
)

Constructor from an image and pre-scan settings.

Parameters
imageImage you want to set.
preScanSettingsPre-scan settings you want to set.

Definition at line 171 of file usImagePreScan2D.h.

References usTransducerSettings::getScanLineNumber().

◆ usImagePreScan2D() [4/4]

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

Copy constructor.

Parameters
other2D pre-scan image you want to copy.

Definition at line 148 of file usImagePreScan2D.h.

◆ ~usImagePreScan2D()

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

Destructor.

Definition at line 181 of file usImagePreScan2D.h.

Member Function Documentation

◆ getAxialResolution()

◆ getBModeSampleNumber()

template<class Type >
unsigned int usImagePreScan2D< Type >::getBModeSampleNumber

Get the number of A-samples of B-Mode samples in a scan line.

Returns
BModeSampleNumber Number of A-samples in a scan line.

Definition at line 227 of file usImagePreScan2D.h.

Referenced by usPostScanToPreScan2DConverter::convert(), usPreScanToPostScan2DConverter::convert(), usImageIo::read(), and usImageIo::write().

◆ getDepth()

◆ getFieldOfView()

◆ getImagePreScanSettings()

usImagePreScanSettings usImagePreScanSettings::getImagePreScanSettings ( ) const
inherited

Definition at line 122 of file usImagePreScanSettings.cpp.

◆ 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.

◆ 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()

◆ 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().

◆ isTransducerConvex()

◆ operator!=() [1/2]

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

Comparison operator.

Definition at line 208 of file usImagePreScan2D.h.

◆ operator!=() [2/2]

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=()

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

Copy operator.

Definition at line 186 of file usImagePreScan2D.h.

References usImagePreScanSettings::operator=().

◆ operator==() [1/3]

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

Comparison operator.

Definition at line 200 of file usImagePreScan2D.h.

◆ operator==() [2/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==() [3/3]

◆ resize() [1/2]

template<class Type >
void usImagePreScan2D< Type >::resize ( const unsigned int  h,
const unsigned int  w 
)

◆ resize() [2/2]

template<class Type >
void usImagePreScan2D< Type >::resize ( const unsigned int  h,
const unsigned int  w,
const Type  val 
)

Resize the 2D pre-scan image and set all the pixel to a given value.

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

Parameters
hImage height.
wImage width.
valValue set to each pixel.

Definition at line 275 of file usImagePreScan2D.h.

References usTransducerSettings::setScanLineNumber().

◆ 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()

◆ setData()

template<class Type >
void usImagePreScan2D< Type >::setData ( const vpImage< Type >  image)

Setter for the image data.

Parameters
imageThe image to set.

Definition at line 236 of file usImagePreScan2D.h.

◆ 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 usImagePreScan2D< 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 248 of file usImagePreScan2D.h.

References usTransducerSettings::setScanLineNumber().

Referenced by usPostScanToPreScan2DConverter::convert(), and usImageIo::read().

◆ 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()