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

#include <visp3/ustk_core/usImageSettingsXmlParser.h>

+ Inheritance diagram for usImageSettingsXmlParser:

Public Types

enum  vpXmlCodeType {
  CODE_XML_BAD = -1 , CODE_XML_SETTINGS , CODE_XML_IMAGE_TYPE , CODE_XML_SCANLINE_PITCH ,
  CODE_XML_TRANSDUCER_RADIUS , CODE_XML_IS_TRANSDUCER_CONVEX , CODE_XML_FRAME_PITCH , CODE_XML_MOTOR_RADIUS ,
  CODE_XML_MOTOR_TYPE , CODE_XML_AXIAL_RESOLUTION , CODE_XML_SAMPLING_FREQUENCY , CODE_XML_TRANSMIT_FREQUENCY ,
  CODE_XML_HEIGHT_RESOLUTION , CODE_XML_WIDTH_RESOLUTION , CODE_XML_SCANLINE_NUMBER , CODE_XML_FRAME_NUMBER ,
  CODE_XML_SPACING_X , CODE_XML_SPACING_Y , CODE_XML_SPACING_Z , CODE_XML_ASSOCIATED_IMAGE_FILE_NAME ,
  CODE_XML_SEQUENCE_FRAME_RATE , CODE_XML_SEQUENCE_FIRST_IMAGE_NUMBER , CODE_XML_SEQUENCE_LAST_IMAGE_NUMBER
}
 
enum  vpXmlCodeSequenceType { SEQUENCE_OK , SEQUENCE_ERROR }
 

Public Member Functions

 usImageSettingsXmlParser ()
 
 usImageSettingsXmlParser (const usImageSettingsXmlParser &twinparser)
 
usImageSettingsXmlParseroperator= (const usImageSettingsXmlParser &twinparser)
 
virtual ~usImageSettingsXmlParser ()
 
double getAxialResolution () const
 
double getFrameNumber () const
 
std::string getImageFileName () const
 
double getHeightResolution () const
 
us::ImageType getImageType () const
 
usMotorSettings getMotorSettings () const
 
unsigned int getScanLineNumber () const
 
double getSequenceFrameRate () const
 
int getSequenceStartNumber () const
 
int getSequenceStopNumber () const
 
double getSpacingX () const
 
double getSpacingY () const
 
double getSpacingZ () const
 
double getWidthResolution () const
 
usTransducerSettings getTransducerSettings () const
 
bool isImage3D () const
 
bool isSequence () const
 
void setFrameNumber (unsigned int frameNumber)
 
void setImageFileName (const std::string &imageFileName)
 
void setImageSettings (double transducerRadius, double scanLinePitch, bool isTransducerConvex, double axialResolution, us::ImageType image_type, int samplingFrequency, int transmitFrequency)
 
void setImageSettings (double transducerRadius, double scanLinePitch, bool isTransducerConvex, unsigned int scanLineNumber, double widthResolution, double heightResolution, int samplingFrequency, int transmitFrequency)
 
void setImageType (us::ImageType image_type)
 
void setMotorSettings (const usMotorSettings &motorSettings)
 
void setScanLineNumber (unsigned int scanLineNumber)
 
void setSequenceFrameRate (double sequenceFrameRate)
 
void setSequenceStartNumber (int sequenceStartNumber)
 
void setSequenceStopNumber (int sequenceStopNumber)
 
void setSequenceType (bool isSequence)
 
void setSpacing (double spacingX, double spacingY, double spacingZ)
 
void setTransducerSettings (const usTransducerSettings transducerSettings)
 

Protected Member Functions

void readMainClass (xmlDocPtr doc, xmlNodePtr node)
 
void writeMainClass (xmlNodePtr node)
 

Detailed Description

Input/output operations between ultrasound image settings and the assiciated xml files.

Definition at line 62 of file usImageSettingsXmlParser.h.

Member Enumeration Documentation

◆ vpXmlCodeSequenceType

Enumerator
SEQUENCE_OK 
SEQUENCE_ERROR 

Definition at line 98 of file usImageSettingsXmlParser.h.

◆ vpXmlCodeType

Enumerator
CODE_XML_BAD 
CODE_XML_SETTINGS 
CODE_XML_IMAGE_TYPE 
CODE_XML_SCANLINE_PITCH 
CODE_XML_TRANSDUCER_RADIUS 
CODE_XML_IS_TRANSDUCER_CONVEX 
CODE_XML_FRAME_PITCH 
CODE_XML_MOTOR_RADIUS 
CODE_XML_MOTOR_TYPE 
CODE_XML_AXIAL_RESOLUTION 
CODE_XML_SAMPLING_FREQUENCY 
CODE_XML_TRANSMIT_FREQUENCY 
CODE_XML_HEIGHT_RESOLUTION 
CODE_XML_WIDTH_RESOLUTION 
CODE_XML_SCANLINE_NUMBER 
CODE_XML_FRAME_NUMBER 
CODE_XML_SPACING_X 
CODE_XML_SPACING_Y 
CODE_XML_SPACING_Z 
CODE_XML_ASSOCIATED_IMAGE_FILE_NAME 
CODE_XML_SEQUENCE_FRAME_RATE 
CODE_XML_SEQUENCE_FIRST_IMAGE_NUMBER 
CODE_XML_SEQUENCE_LAST_IMAGE_NUMBER 

Definition at line 71 of file usImageSettingsXmlParser.h.

Constructor & Destructor Documentation

◆ usImageSettingsXmlParser() [1/2]

◆ usImageSettingsXmlParser() [2/2]

usImageSettingsXmlParser::usImageSettingsXmlParser ( const usImageSettingsXmlParser twinparser)

Copy constructor.

Definition at line 76 of file usImageSettingsXmlParser.cpp.

◆ ~usImageSettingsXmlParser()

usImageSettingsXmlParser::~usImageSettingsXmlParser ( )
virtual

Destructor.

Definition at line 106 of file usImageSettingsXmlParser.cpp.

Member Function Documentation

◆ getAxialResolution()

double usImageSettingsXmlParser::getAxialResolution ( ) const
inline

Definition at line 101 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ getFrameNumber()

double usImageSettingsXmlParser::getFrameNumber ( ) const
inline

Definition at line 102 of file usImageSettingsXmlParser.h.

◆ getHeightResolution()

double usImageSettingsXmlParser::getHeightResolution ( ) const
inline

Definition at line 104 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ getImageFileName()

std::string usImageSettingsXmlParser::getImageFileName ( ) const
inline

Definition at line 103 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ getImageType()

us::ImageType usImageSettingsXmlParser::getImageType ( ) const
inline

Definition at line 105 of file usImageSettingsXmlParser.h.

Referenced by operator=().

◆ getMotorSettings()

usMotorSettings usImageSettingsXmlParser::getMotorSettings ( ) const
inline

Definition at line 106 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ getScanLineNumber()

unsigned int usImageSettingsXmlParser::getScanLineNumber ( ) const
inline

Definition at line 107 of file usImageSettingsXmlParser.h.

◆ getSequenceFrameRate()

double usImageSettingsXmlParser::getSequenceFrameRate ( ) const
inline

Definition at line 108 of file usImageSettingsXmlParser.h.

◆ getSequenceStartNumber()

int usImageSettingsXmlParser::getSequenceStartNumber ( ) const
inline

Definition at line 109 of file usImageSettingsXmlParser.h.

◆ getSequenceStopNumber()

int usImageSettingsXmlParser::getSequenceStopNumber ( ) const
inline

Definition at line 110 of file usImageSettingsXmlParser.h.

◆ getSpacingX()

double usImageSettingsXmlParser::getSpacingX ( ) const
inline

Definition at line 111 of file usImageSettingsXmlParser.h.

Referenced by operator=().

◆ getSpacingY()

double usImageSettingsXmlParser::getSpacingY ( ) const
inline

Definition at line 112 of file usImageSettingsXmlParser.h.

Referenced by operator=().

◆ getSpacingZ()

double usImageSettingsXmlParser::getSpacingZ ( ) const
inline

Definition at line 113 of file usImageSettingsXmlParser.h.

Referenced by operator=().

◆ getTransducerSettings()

usTransducerSettings usImageSettingsXmlParser::getTransducerSettings ( ) const
inline

Definition at line 115 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ getWidthResolution()

double usImageSettingsXmlParser::getWidthResolution ( ) const
inline

Definition at line 114 of file usImageSettingsXmlParser.h.

Referenced by operator=(), and usImageIo::read().

◆ isImage3D()

bool usImageSettingsXmlParser::isImage3D ( ) const
inline

Definition at line 117 of file usImageSettingsXmlParser.h.

Referenced by operator=().

◆ isSequence()

bool usImageSettingsXmlParser::isSequence ( ) const
inline

Definition at line 118 of file usImageSettingsXmlParser.h.

◆ operator=()

◆ readMainClass()

◆ setFrameNumber()

void usImageSettingsXmlParser::setFrameNumber ( unsigned int  frameNumber)
inline

Definition at line 121 of file usImageSettingsXmlParser.h.

◆ setImageFileName()

void usImageSettingsXmlParser::setImageFileName ( const std::string &  imageFileName)

Setter for image file name associated to the settings wrote in the xml file.

Parameters
imageFileName: image file name with extestion.

Definition at line 392 of file usImageSettingsXmlParser.cpp.

Referenced by usSequenceWriter< ImageType >::close(), and usImageIo::write().

◆ setImageSettings() [1/2]

void usImageSettingsXmlParser::setImageSettings ( double  transducerRadius,
double  scanLinePitch,
bool  isTransducerConvex,
double  axialResolution,
us::ImageType  image_type,
int  samplingFrequency,
int  transmitFrequency 
)

Setter for pre-scan settings. Each transducer setting available.

Parameters
transducerRadius: the Transducer rabius.
scanLinePitch: the scan line pitch.
isTransducerConvex: the transducer type (true if convex transducer, false if linear).
axialResolution: the image axial resolution.
image_type: image type (rf or pre-scan).
samplingFrequency: frequency used to sample the ultrasound wave during the acquisition.
transmitFrequency: frequency of the ultrasound wave used to create the image.

Definition at line 335 of file usImageSettingsXmlParser.cpp.

References us::PRESCAN_2D, us::RF_2D, usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().

Referenced by usSequenceWriter< ImageType >::close(), and usImageIo::write().

◆ setImageSettings() [2/2]

void usImageSettingsXmlParser::setImageSettings ( double  transducerRadius,
double  scanLinePitch,
bool  isTransducerConvex,
unsigned int  scanLineNumber,
double  widthResolution,
double  heightResolution,
int  samplingFrequency,
int  transmitFrequency 
)

Setter for post-scan settings. Each transducer setting available.

Parameters
transducerRadius: the transducer rabius.
scanLinePitch: the scan line pitch.
isTransducerConvex: the transducer type (true if convex transducer, false if linear).
scanLineNumber: the number of scan lines of the probe used.
widthResolution: the image width resolution.
heightResolution: the image height resolution.
samplingFrequency: frequency used to sample the ultrasound wave during the acquisition.
transmitFrequency: frequency of the ultrasound wave used to create the image.

Definition at line 363 of file usImageSettingsXmlParser.cpp.

References us::POSTSCAN_2D, usTransducerSettings::setSamplingFrequency(), usTransducerSettings::setScanLineNumber(), usTransducerSettings::setScanLinePitch(), usTransducerSettings::setTransducerConvexity(), usTransducerSettings::setTransducerRadius(), and usTransducerSettings::setTransmitFrequency().

◆ setImageType()

void usImageSettingsXmlParser::setImageType ( us::ImageType  image_type)
inline

◆ setMotorSettings()

void usImageSettingsXmlParser::setMotorSettings ( const usMotorSettings motorSettings)

Setter for motor settings (3D images).

Parameters
motorSettings: motor settings to write in the xml file.

Definition at line 382 of file usImageSettingsXmlParser.cpp.

◆ setScanLineNumber()

void usImageSettingsXmlParser::setScanLineNumber ( unsigned int  scanLineNumber)
inline

Definition at line 130 of file usImageSettingsXmlParser.h.

◆ setSequenceFrameRate()

void usImageSettingsXmlParser::setSequenceFrameRate ( double  sequenceFrameRate)
inline

Definition at line 131 of file usImageSettingsXmlParser.h.

Referenced by usSequenceWriter< ImageType >::close().

◆ setSequenceStartNumber()

void usImageSettingsXmlParser::setSequenceStartNumber ( int  sequenceStartNumber)
inline

Definition at line 136 of file usImageSettingsXmlParser.h.

Referenced by usSequenceWriter< ImageType >::close().

◆ setSequenceStopNumber()

void usImageSettingsXmlParser::setSequenceStopNumber ( int  sequenceStopNumber)
inline

Definition at line 141 of file usImageSettingsXmlParser.h.

Referenced by usSequenceWriter< ImageType >::close().

◆ setSequenceType()

void usImageSettingsXmlParser::setSequenceType ( bool  isSequence)
inline

Definition at line 146 of file usImageSettingsXmlParser.h.

◆ setSpacing()

void usImageSettingsXmlParser::setSpacing ( double  spacingX,
double  spacingY,
double  spacingZ 
)
inline

Definition at line 147 of file usImageSettingsXmlParser.h.

◆ setTransducerSettings()

void usImageSettingsXmlParser::setTransducerSettings ( const usTransducerSettings  transducerSettings)

◆ writeMainClass()