PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes
PlusSpatialModel Class Reference

#include <src/PlusUsSimulator/PlusSpatialModel.h>

Classes

struct  LineIntersectionInfo
 

Public Member Functions

void CalculateIntensity (std::vector< double > &reflectedIntensity, unsigned int numberOfFilledPixels, double distanceBetweenScanlineSamplePointsMm, double previousModelAcousticImpedanceMegarayls, double incidentIntensity, double &transmittedIntensity, double incidenceAngleRad)
 
double GetAcousticImpedanceMegarayls ()
 
void GetLineIntersections (std::deque< LineIntersectionInfo > &lineIntersections, double *scanLineStartPoint_Reference, double *scanLineEndPoint_Reference)
 
vtkMatrix4x4 * GetModelToObjectTransform ()
 
 GetStdStringMacro (Name)
 
 GetStdStringMacro (ObjectCoordinateFrame)
 
void operator= (const PlusSpatialModel &model)
 
 PlusSpatialModel ()
 
 PlusSpatialModel (const PlusSpatialModel &model)
 
virtual PlusStatus ReadConfiguration (vtkXMLDataElement *spatialModelElement)
 
 SetMacro (ImagingFrequencyMhz, double)
 
 SetMacro (DensityKgPerM3, double)
 
 SetMacro (SoundVelocityMPerSec, double)
 
 SetMacro (AttenuationCoefficientDbPerCmMhz, double)
 
 SetMacro (SurfaceReflectionIntensityDecayDbPerMm, double)
 
 SetMacro (BackscatterDiffuseReflectionCoefficient, double)
 
 SetMacro (SurfaceDiffuseReflectionCoefficient, double)
 
 SetMacro (SurfaceSpecularReflectionCoefficient, double)
 
 SetMacro (TransducerSpatialModelMaxOverlapMm, double)
 
void SetModelFile (const std::string &modelFile)
 
void SetReferenceToObjectTransform (vtkMatrix4x4 *referenceToObjectTransform)
 
 SetStdStringMacro (Name)
 
 SetStdStringMacro (ObjectCoordinateFrame)
 
virtual ~PlusSpatialModel ()
 

Protected Member Functions

void SetModelLocalizer (vtkModifiedBSPTree *modelLocalizer)
 
void SetModelToObjectTransform (vtkMatrix4x4 *modelToObjectTransform)
 
void SetModelToObjectTransform (double *matrixElements)
 
void SetPolyData (vtkPolyData *polyData)
 
PlusStatus UpdateModelFile ()
 
void UpdatePrecomputedAttenuations (double intensityTransmittedFractionPerPixelTwoWay, int numberOfElements)
 

Protected Attributes

double AttenuationCoefficientDbPerCmMhz
 
double BackscatterDiffuseReflectionCoefficient
 
double DensityKgPerM3
 
double ImagingFrequencyMhz
 
std::string ModelFile
 
bool ModelFileNeedsUpdate
 
vtkModifiedBSPTree * ModelLocalizer
 
vtkMatrix4x4 * ModelToObjectTransform
 
std::string Name
 
std::string ObjectCoordinateFrame
 
vtkPolyData * PolyData
 
std::vector< double > PrecomputedAttenuations
 
vtkMatrix4x4 * ReferenceToObjectTransform
 
double SoundVelocityMPerSec
 
double SurfaceDiffuseReflectionCoefficient
 
double SurfaceReflectionIntensityDecayDbPerMm
 
double SurfaceSpecularReflectionCoefficient
 
double TransducerSpatialModelMaxOverlapMm
 

Detailed Description

Definition at line 23 of file PlusSpatialModel.h.

Constructor & Destructor Documentation

◆ PlusSpatialModel() [1/2]

PlusSpatialModel::PlusSpatialModel ( )

Definition at line 30 of file PlusSpatialModel.cxx.

◆ ~PlusSpatialModel()

PlusSpatialModel::~PlusSpatialModel ( )
virtual

Definition at line 52 of file PlusSpatialModel.cxx.

◆ PlusSpatialModel() [2/2]

PlusSpatialModel::PlusSpatialModel ( const PlusSpatialModel model)

Copy constructor. Performs shallow-copy.

Definition at line 61 of file PlusSpatialModel.cxx.

Member Function Documentation

◆ CalculateIntensity()

void PlusSpatialModel::CalculateIntensity ( std::vector< double > &  reflectedIntensity,
unsigned int  numberOfFilledPixels,
double  distanceBetweenScanlineSamplePointsMm,
double  previousModelAcousticImpedanceMegarayls,
double  incidentIntensity,
double &  transmittedIntensity,
double  incidenceAngleRad 
)

Computes relative intensities inside the model

Parameters
incidentIntensityDimensionless value, if there is 100% reflection at the surface then this fraction of the beam intensity would be sensed at the transducer. It includes the effect of attenuation of both incoming and reflected direction.
transmittedIntensityintensity when the beam leaves the model

Definition at line 211 of file PlusSpatialModel.cxx.

◆ GetAcousticImpedanceMegarayls()

double PlusSpatialModel::GetAcousticImpedanceMegarayls ( )

Definition at line 204 of file PlusSpatialModel.cxx.

◆ GetLineIntersections()

void PlusSpatialModel::GetLineIntersections ( std::deque< LineIntersectionInfo > &  lineIntersections,
double *  scanLineStartPoint_Reference,
double *  scanLineEndPoint_Reference 
)

Get all the intersection points of the model and a line. Input and output points are all in Model coordinate system. The results are appended to the lineIntersections structure. If the line starts inside the model then the first intersection position is 0. The unit of the reference coordinate system must be in mm.

Definition at line 317 of file PlusSpatialModel.cxx.

◆ GetModelToObjectTransform()

vtkMatrix4x4* PlusSpatialModel::GetModelToObjectTransform ( )

◆ GetStdStringMacro() [1/2]

PlusSpatialModel::GetStdStringMacro ( Name  )

◆ GetStdStringMacro() [2/2]

PlusSpatialModel::GetStdStringMacro ( ObjectCoordinateFrame  )

◆ operator=()

void PlusSpatialModel::operator= ( const PlusSpatialModel model)

Assignment operator. Performs shallow-copy.

Definition at line 88 of file PlusSpatialModel.cxx.

◆ ReadConfiguration()

PlusStatus PlusSpatialModel::ReadConfiguration ( vtkXMLDataElement *  spatialModelElement)
virtual

Definition at line 183 of file PlusSpatialModel.cxx.

◆ SetMacro() [1/9]

PlusSpatialModel::SetMacro ( ImagingFrequencyMhz  ,
double   
)

Set US imaging frequency for generated image

◆ SetMacro() [2/9]

PlusSpatialModel::SetMacro ( DensityKgPerM3  ,
double   
)

◆ SetMacro() [3/9]

PlusSpatialModel::SetMacro ( SoundVelocityMPerSec  ,
double   
)

◆ SetMacro() [4/9]

PlusSpatialModel::SetMacro ( AttenuationCoefficientDbPerCmMhz  ,
double   
)

◆ SetMacro() [5/9]

PlusSpatialModel::SetMacro ( SurfaceReflectionIntensityDecayDbPerMm  ,
double   
)

◆ SetMacro() [6/9]

PlusSpatialModel::SetMacro ( BackscatterDiffuseReflectionCoefficient  ,
double   
)

◆ SetMacro() [7/9]

PlusSpatialModel::SetMacro ( SurfaceDiffuseReflectionCoefficient  ,
double   
)

◆ SetMacro() [8/9]

PlusSpatialModel::SetMacro ( SurfaceSpecularReflectionCoefficient  ,
double   
)

◆ SetMacro() [9/9]

PlusSpatialModel::SetMacro ( TransducerSpatialModelMaxOverlapMm  ,
double   
)

◆ SetModelFile()

void PlusSpatialModel::SetModelFile ( const std::string &  modelFile)

Set the surface model file name (STL or VTP). It can be used to override the model file name specified in the XML configuration.

Definition at line 524 of file PlusSpatialModel.cxx.

◆ SetModelLocalizer()

void PlusSpatialModel::SetModelLocalizer ( vtkModifiedBSPTree *  modelLocalizer)
protected

Definition at line 165 of file PlusSpatialModel.cxx.

◆ SetModelToObjectTransform() [1/2]

void PlusSpatialModel::SetModelToObjectTransform ( vtkMatrix4x4 *  modelToObjectTransform)
protected

Definition at line 111 of file PlusSpatialModel.cxx.

◆ SetModelToObjectTransform() [2/2]

void PlusSpatialModel::SetModelToObjectTransform ( double *  matrixElements)
protected

Definition at line 546 of file PlusSpatialModel.cxx.

◆ SetPolyData()

void PlusSpatialModel::SetPolyData ( vtkPolyData *  polyData)
protected

Definition at line 147 of file PlusSpatialModel.cxx.

◆ SetReferenceToObjectTransform()

void PlusSpatialModel::SetReferenceToObjectTransform ( vtkMatrix4x4 *  referenceToObjectTransform)

Definition at line 129 of file PlusSpatialModel.cxx.

◆ SetStdStringMacro() [1/2]

PlusSpatialModel::SetStdStringMacro ( Name  )

◆ SetStdStringMacro() [2/2]

PlusSpatialModel::SetStdStringMacro ( ObjectCoordinateFrame  )

◆ UpdateModelFile()

PlusStatus PlusSpatialModel::UpdateModelFile ( )
protected

Definition at line 455 of file PlusSpatialModel.cxx.

◆ UpdatePrecomputedAttenuations()

void PlusSpatialModel::UpdatePrecomputedAttenuations ( double  intensityTransmittedFractionPerPixelTwoWay,
int  numberOfElements 
)
protected

Definition at line 534 of file PlusSpatialModel.cxx.

Member Data Documentation

◆ AttenuationCoefficientDbPerCmMhz

double PlusSpatialModel::AttenuationCoefficientDbPerCmMhz
protected

Attenuation coefficient of the model material (dB / cm / MHz). Includes both absorption and scattering. Positive number.

Definition at line 144 of file PlusSpatialModel.h.

◆ BackscatterDiffuseReflectionCoefficient

double PlusSpatialModel::BackscatterDiffuseReflectionCoefficient
protected

The fraction of the attenuated intensity that is reflected (backscattered) to all directions. Rough surfaces have higher values (range: 0.0-1.0). Usually not just scattering occurs (there are various ways of scattering) but also absorption, so the value is much less than 1.0.

Definition at line 158 of file PlusSpatialModel.h.

◆ DensityKgPerM3

double PlusSpatialModel::DensityKgPerM3
protected

Density in kg/m^3 of the material the model is comprised of

Definition at line 138 of file PlusSpatialModel.h.

◆ ImagingFrequencyMhz

double PlusSpatialModel::ImagingFrequencyMhz
protected

Ultrasound frequency

Definition at line 135 of file PlusSpatialModel.h.

◆ ModelFile

std::string PlusSpatialModel::ModelFile
protected

Name of the STL or VTP model file. If no ModelFile is defined then it means that the model is everywhere (background material).

Definition at line 111 of file PlusSpatialModel.h.

◆ ModelFileNeedsUpdate

bool PlusSpatialModel::ModelFileNeedsUpdate
protected

It is true if the model file needs to be updated (re-read from the ModelFile)

Definition at line 114 of file PlusSpatialModel.h.

◆ ModelLocalizer

vtkModifiedBSPTree* PlusSpatialModel::ModelLocalizer
protected

Definition at line 187 of file PlusSpatialModel.h.

◆ ModelToObjectTransform

vtkMatrix4x4* PlusSpatialModel::ModelToObjectTransform
protected

Transformation matrix from the native coordinate system (as points are stored in the file) to spatial object coordinate system (ObjectCoordinateFrame)

Definition at line 120 of file PlusSpatialModel.h.

◆ Name

std::string PlusSpatialModel::Name
protected

Identifying name of Model

Definition at line 108 of file PlusSpatialModel.h.

◆ ObjectCoordinateFrame

std::string PlusSpatialModel::ObjectCoordinateFrame
protected

This variable defines the name of the spatial object's coordinate frame

Definition at line 130 of file PlusSpatialModel.h.

◆ PolyData

vtkPolyData* PlusSpatialModel::PolyData
protected

Surface mesh. Points are stored in the Model coordinate system (as in the input file)

Definition at line 190 of file PlusSpatialModel.h.

◆ PrecomputedAttenuations

std::vector<double> PlusSpatialModel::PrecomputedAttenuations
protected

List of attenuations: intensityTransmittedFractionPerPixelTwoWay, intensityTransmittedFractionPerPixelTwoWay^2, intensityTransmittedFractionPerPixelTwoWay^3, ...

Definition at line 193 of file PlusSpatialModel.h.

◆ ReferenceToObjectTransform

vtkMatrix4x4* PlusSpatialModel::ReferenceToObjectTransform
protected

Transformation matrix from the reference coordinate system (that is used by external methods) to the object coordinate system (ObjectCoordinateFrame). This transform is not serialized to/from the XML configuration.

Definition at line 127 of file PlusSpatialModel.h.

◆ SoundVelocityMPerSec

double PlusSpatialModel::SoundVelocityMPerSec
protected

Velocity of sound in the model material (m/s)

Definition at line 141 of file PlusSpatialModel.h.

◆ SurfaceDiffuseReflectionCoefficient

double PlusSpatialModel::SurfaceDiffuseReflectionCoefficient
protected

The fraction of the attenuated intensity that is reflected (backscattered) in an incidence-angle indepentent way.

Definition at line 185 of file PlusSpatialModel.h.

◆ SurfaceReflectionIntensityDecayDbPerMm

double PlusSpatialModel::SurfaceReflectionIntensityDecayDbPerMm
protected

Attenuation coefficient of the surface reflection (dB / mm). Positive number. We model the reflection from the surface as intensity reflected from a small region with an exponential decay. The decay coefficient refers to the dispersion of the signal in the material and the signal processing electronics.

Definition at line 151 of file PlusSpatialModel.h.

◆ SurfaceSpecularReflectionCoefficient

double PlusSpatialModel::SurfaceSpecularReflectionCoefficient
protected

The fraction of the attenuated intensity that is reflected (backscattered) in a mirror-like way. Smooth, polished surfaces have higher values (range: 0.0-1.0). A value of one means all the attenuation is caused by a perfect reflection. Usually not just scattering occurs (there are various ways of scattering) but also absorption, so the value is much less than 1.0.

Definition at line 180 of file PlusSpatialModel.h.

◆ TransducerSpatialModelMaxOverlapMm

double PlusSpatialModel::TransducerSpatialModelMaxOverlapMm
protected

TransducerSpatialModelMaxOverlapMm determines how far from the transducer surface (inside the transducer) we start searching for scanline/SpatialModel intersections. If the value is too small then inside/outside segments may be inverted for the overlapping model. If the value is too large then it may slightly slow down the simulation. When it is decided if a certain part of a scanline is inside or outside of a model it is assumed that after 1 (or 3, 5, 7, ...) intersections we are inside the model and after 2 (or 4, 6, 8, ...) intersections we are outside the model. This is only true if the scanline start point is outside every spatial model. This is always true in theory, but in practice, due to slight registration errors or deformations the transducer surface may get inside a spatial model by a few mm. To avoid inversion of inside/outside, we start the scanline a few mm away from the true transducer surface so that we can detect intersections that are very close to the transducer surface.

Definition at line 172 of file PlusSpatialModel.h.


The documentation for this class was generated from the following files: