Computer Assisted Medical Intervention Tool Kit  version 5.2
Reference Class Reference

A reference is used to compare to simulated data. More...

#include <Reference.h>

+ Collaboration diagram for Reference:

Public Member Functions

bool getDistanceToTriangularMesh (double pos[3], double &dist)
 get distance to a triangular mesh, the target of the reference must contain triangles. More...
 
bool getMonitoredData (std::string type, double ref[])
 get the the values of a given monitor which do not depend of time or an atom (e.g. More...
 
bool getMonitoredData (std::string type, double time, double &realTime, double ref[])
 get the the values of a given monitor at a given time which do not depend an atom (e.g. More...
 
bool getMonitoredData (std::string type, double time, int index, double &realTime, double ref[])
 get the the values of a given monitor at a given time and a given atom's index (e.g. More...
 
bool getNearest (double pos[3], double ref[3])
 get the nearest reference point in the "target" using "Position" monitor of the PML Reference. More...
 
bool getNearest (double pos[3], double time, double ref[3])
 get the nearest reference point in the "target" using "Position" monitor at given time More...
 
 Reference (mml::Reference reference, MonitoringManager *monitoringManager)
 constructor More...
 
std::string toString ()
 return a string relative to Reference type More...
 
virtual ~Reference ()
 destructor More...
 

Detailed Description

A reference is used to compare to simulated data.

An instance of this class corresponds to the data-binding for type Reference of MonitoringModel.xsd.

A reference therefore contains:

  • a MMLout (xml type MonitoringOut)
  • a target to consider inside the MMLout

All MonitoringOut data is also managed by this class. A MonitoringOut contains:

  • the path to a PML document, this is managed by the pml private attribute.
  • vector of timestep that contains (time, vector values), this is managed by inner struct timeStep.

The PML document given in the MMLout is called the PML Reference.

The PML Reference can either be at any state (beginning, rest shape, final step...etc...) It is mainly used to get the list of Structure/Component to be used in correlation with the target field of the reference.

Note
Some monitors are directly using the position of the atoms given in the PML Reference to compute their values. Therefore it is STONGLY advised to give a PML Reference that corresponds to the FINAL step of the simulation (position at the end of the simulation/experiments).

Constructor & Destructor Documentation

◆ Reference()

Reference::Reference ( mml::Reference  reference,
MonitoringManager monitoringManager 
)

constructor

References MonitorFactory::createMonitor(), MonitoringManager::getmmlFileFolder(), and Monitor::getTypeName().

+ Here is the call graph for this function:

◆ ~Reference()

Reference::~Reference ( )
virtual

destructor

Member Function Documentation

◆ getDistanceToTriangularMesh()

bool Reference::getDistanceToTriangularMesh ( double  pos[3],
double &  dist 
)

get distance to a triangular mesh, the target of the reference must contain triangles.

This is a fast method that gives the distance relatively to the triangles in the PML Reference.

Note
This is a heuristic version, which means, it does not test all triangles to find the lowest. It first look for the nearest atom in the PML Reference and then only check the triangles around this nearest atom.
This is not the exact distance to the nearest triangle, but an approximation given by the function distanceToTrianglePlane().
Parameters
posatom's position (with eventual offset)
distthe distance
Returns
true if method succeded (a triangular mesh was found)

References a, AtomIterator::begin(), AtomIterator::currentAtom(), distance(), distanceToTrianglePlane(), AtomIterator::end(), Atom::getPosition(), Cell::getProperties(), StructuralComponent::getStructure(), StructureProperties::getType(), AtomIterator::next(), and StructureProperties::TRIANGLE.

+ Here is the call graph for this function:

◆ getMonitoredData() [1/3]

bool Reference::getMonitoredData ( std::string  type,
double  ref[] 
)

get the the values of a given monitor which do not depend of time or an atom (e.g.

geometrical data)

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
refa table where data will be stored
Returns
true if method succeded (an existing monitor named "type" was found)

Referenced by getNearest().

+ Here is the caller graph for this function:

◆ getMonitoredData() [2/3]

bool Reference::getMonitoredData ( std::string  type,
double  time,
double &  realTime,
double  ref[] 
)

get the the values of a given monitor at a given time which do not depend an atom (e.g.

volume) if there is no corresponding time in reference, it return data for the first higher time.

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
timetime to get the values
realTimethe nearest time found if realTime=infinity, the nearest is the final state
refa table where data will be stored
Returns
true if method succeded

References Monitor::SCALAR.

◆ getMonitoredData() [3/3]

bool Reference::getMonitoredData ( std::string  type,
double  time,
int  index,
double &  realTime,
double  ref[] 
)

get the the values of a given monitor at a given time and a given atom's index (e.g.

position)

Parameters
typename of the monitor, must be a existing monitor in the mmlOut document
timetime to get the values
indexatom's index
realTimethe nearest time found if realTime=infinity, the nearest is the final state
refa table where data will be stored
Returns
true if method succeded

◆ getNearest() [1/2]

bool Reference::getNearest ( double  pos[3],
double  ref[3] 
)

get the nearest reference point in the "target" using "Position" monitor of the PML Reference.

This is a fast method that gives the nearest position relatively to the PML Reference.

Parameters
posatom's position (with eventual offset)
refa table where positon of the nearest atom in reference will be stored
Returns
true if method succeded (a nearest atom was found in reference)

References AtomIterator::begin(), AtomIterator::currentAtom(), distance(), AtomIterator::end(), Atom::getPosition(), and AtomIterator::next().

+ Here is the call graph for this function:

◆ getNearest() [2/2]

bool Reference::getNearest ( double  pos[3],
double  time,
double  ref[3] 
)

get the nearest reference point in the "target" using "Position" monitor at given time

Parameters
posatom's position (with eventual offset)
timetime to get the Position
refa table where positon of the nearest atom in reference will be stored
Returns
true if method succeded (a nearest atom was found in reference)

References AtomIterator::begin(), AtomIterator::currentAtom(), distance(), AtomIterator::end(), Structure::getIndex(), getMonitoredData(), and AtomIterator::next().

+ Here is the call graph for this function:

◆ toString()

std::string Reference::toString ( )

return a string relative to Reference type


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