Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
PropagationPropertiesCalculator Class Reference

#include <PropagationPropertiesCalculator.hpp>

+ Collaboration diagram for PropagationPropertiesCalculator:

Public Member Functions

 PropagationPropertiesCalculator (Hdf5DataReader *pDataReader, const std::string voltageName="V")
 
virtual ~PropagationPropertiesCalculator ()
 
double CalculateMaximumUpstrokeVelocity (unsigned globalNodeIndex)
 
std::vector< doubleCalculateAllMaximumUpstrokeVelocities (unsigned globalNodeIndex, double threshold)
 
std::vector< doubleCalculateUpstrokeTimes (unsigned globalNodeIndex, double threshold)
 
double CalculateConductionVelocity (unsigned globalNearNodeIndex, unsigned globalFarNodeIndex, const double euclideanDistance)
 
std::vector< doubleCalculateAllConductionVelocities (unsigned globalNearNodeIndex, unsigned globalFarNodeIndex, const double euclideanDistance)
 
double CalculateActionPotentialDuration (const double percentage, unsigned globalNodeIndex)
 
double CalculatePeakMembranePotential (unsigned globalNodeIndex)
 
std::vector< doubleCalculateAllActionPotentialDurations (const double percentage, unsigned globalNodeIndex, double threshold)
 
std::vector< std::vector< double > > CalculateAllActionPotentialDurationsForNodeRange (const double percentage, unsigned lowerNodeIndex, unsigned upperNodeIndex, double threshold)
 
std::vector< unsignedCalculateAllAboveThresholdDepolarisations (unsigned globalNodeIndex, double threshold)
 
unsigned CalculateAboveThresholdDepolarisationsForLastAp (unsigned globalNodeIndex, double threshold)
 
void SetHdf5DataReader (Hdf5DataReader *pDataReader)
 

Protected Member Functions

std::vector< double > & rGetCachedVoltages (unsigned globalNodeIndex)
 

Private Attributes

Hdf5DataReadermpDataReader
 
const std::string mVoltageName
 
std::vector< doublemTimes
 
unsigned mCachedNodeGlobalIndex
 
std::vector< doublemCachedVoltages
 

Detailed Description

Calculate physiological properties at given global mesh indices

  • maximum upstroke velocity at a single cell
  • times of upstroke at a single cell
  • (all) conduction velocities between two cells
  • (all) action potential duration at a single cell (node)
  • (all) action potential durations for a range of nodes
  • maximum transmembrane potential (maximum systolic potential) at a single cell.

Definition at line 53 of file PropagationPropertiesCalculator.hpp.

Constructor & Destructor Documentation

◆ PropagationPropertiesCalculator()

PropagationPropertiesCalculator::PropagationPropertiesCalculator ( Hdf5DataReader pDataReader,
const std::string  voltageName = "V" 
)

Constructor.

Parameters
pDataReaderPointer to the data reader containing the simulation.
voltageNameOptionally the name of the variable representing the membrane potential. Defaults to "V".

Definition at line 43 of file PropagationPropertiesCalculator.cpp.

◆ ~PropagationPropertiesCalculator()

PropagationPropertiesCalculator::~PropagationPropertiesCalculator ( )
virtual

Destructor

Definition at line 51 of file PropagationPropertiesCalculator.cpp.

Member Function Documentation

◆ CalculateAboveThresholdDepolarisationsForLastAp()

unsigned PropagationPropertiesCalculator::CalculateAboveThresholdDepolarisationsForLastAp ( unsigned  globalNodeIndex,
double  threshold 
)
Returns
the depolarisations that occur above threshold at a single cell during the last recorded Ap
Parameters
globalNodeIndexthe cell at which to calculate
thresholdthe threshold above which the depolarisations are counted

Definition at line 300 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetNumberOfAboveThresholdDepolarisationsForLastAp(), mTimes, and rGetCachedVoltages().

◆ CalculateActionPotentialDuration()

double PropagationPropertiesCalculator::CalculateActionPotentialDuration ( const double  percentage,
unsigned  globalNodeIndex 
)
Returns
the action potential duration at a single cell. We calculate for the last AP found in the simulation data.
Parameters
percentageThe percentage of the amplitude to calculate for.
globalNodeIndexThe cell at which to calculate.

Definition at line 77 of file PropagationPropertiesCalculator.cpp.

References EXCEPTION, CellProperties::GetLastActionPotentialDuration(), mTimes, and rGetCachedVoltages().

Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge().

◆ CalculateAllAboveThresholdDepolarisations()

std::vector< unsigned > PropagationPropertiesCalculator::CalculateAllAboveThresholdDepolarisations ( unsigned  globalNodeIndex,
double  threshold 
)
Returns
all the depolarisations that occur above threshold at a single cell.
Parameters
globalNodeIndexthe cell at which to calculate
thresholdthe threshold above which the depolarisations are counted

Definition at line 292 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetNumberOfAboveThresholdDepolarisationsForAllAps(), mTimes, and rGetCachedVoltages().

◆ CalculateAllActionPotentialDurations()

std::vector< double > PropagationPropertiesCalculator::CalculateAllActionPotentialDurations ( const double  percentage,
unsigned  globalNodeIndex,
double  threshold 
)
Returns
all the action potentials duration at a single cell.
Parameters
percentageThe percentage of the amplitude to calculate for.
globalNodeIndexThe cell at which to calculate.
thresholdThe voltage threshold for APD calculation (we count this as the start of an AP)

Definition at line 89 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetAllActionPotentialDurations(), mTimes, and rGetCachedVoltages().

◆ CalculateAllActionPotentialDurationsForNodeRange()

std::vector< std::vector< double > > PropagationPropertiesCalculator::CalculateAllActionPotentialDurationsForNodeRange ( const double  percentage,
unsigned  lowerNodeIndex,
unsigned  upperNodeIndex,
double  threshold 
)
Returns
all the action potentials duration at cells [lowerNodeIndex, upperNodeIndex-1].
Parameters
percentageThe percentage of the amplitude to calculate for.
lowerNodeIndexFirst cell at which to calculate.
upperNodeIndexOne past the last cell at which to calculate.
thresholdThe voltage threshold for APD calculation (we count this as the start of an AP)

Definition at line 98 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetAllActionPotentialDurations(), Hdf5DataReader::GetVariableOverTimeOverMultipleNodes(), mpDataReader, mTimes, and mVoltageName.

◆ CalculateAllConductionVelocities()

std::vector< double > PropagationPropertiesCalculator::CalculateAllConductionVelocities ( unsigned  globalNearNodeIndex,
unsigned  globalFarNodeIndex,
const double  euclideanDistance 
)
Returns
all the conduction velocities between two cells, i.e. the time taken for all APs to propagate from one to the other. It returns a vector containing all the conduction velocities for each of the APs that reached the two nodes (only the APs that reached both nodes). Throws exceptions if an AP never reached one of the nodes.
Parameters
globalNearNodeIndexThe cell to measure from.
globalFarNodeIndexThe cell to measure to.
euclideanDistanceThe distance the AP travels between the cells, along the tissue.
Todo:
remove magic number? (#1884)

Definition at line 227 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetTimesAtMaxUpstrokeVelocity(), Hdf5DataReader::GetVariableOverTime(), mpDataReader, mTimes, mVoltageName, and rGetCachedVoltages().

◆ CalculateAllMaximumUpstrokeVelocities()

std::vector< double > PropagationPropertiesCalculator::CalculateAllMaximumUpstrokeVelocities ( unsigned  globalNodeIndex,
double  threshold 
)
Returns
the maximum upstroke velocity at a single cell. We return all the max upstroke velocities for all APs.
Parameters
globalNodeIndexThe cell at which to calculate.
thresholdThe voltage threshold (we use this for marking the end of an AP)

Definition at line 63 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetMaxUpstrokeVelocities(), mTimes, and rGetCachedVoltages().

◆ CalculateConductionVelocity()

double PropagationPropertiesCalculator::CalculateConductionVelocity ( unsigned  globalNearNodeIndex,
unsigned  globalFarNodeIndex,
const double  euclideanDistance 
)
Returns
the conduction velocity between two cells, i.e. the time taken for an AP to propagate from one to the other. It returns the value of conduction velocity of the LAST action potential that reached both nodes. Throws exceptions if an AP never reached one of the nodes.
Parameters
globalNearNodeIndexThe cell to measure from.
globalFarNodeIndexThe cell to measure to.
euclideanDistanceThe distance the AP travels between the cells, along the tissue.
Todo:
remove magic number? (#1884)

Definition at line 171 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetMaxUpstrokeVelocities(), CellProperties::GetTimeAtLastMaxUpstrokeVelocity(), CellProperties::GetTimesAtMaxUpstrokeVelocity(), Hdf5DataReader::GetVariableOverTime(), mpDataReader, mTimes, mVoltageName, and rGetCachedVoltages().

Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge().

◆ CalculateMaximumUpstrokeVelocity()

double PropagationPropertiesCalculator::CalculateMaximumUpstrokeVelocity ( unsigned  globalNodeIndex)
Returns
the maximum upstroke velocity at a single cell. We calculate for the last upstroke found in the simulation data.
Parameters
globalNodeIndexThe cell at which to calculate.

Definition at line 56 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetLastMaxUpstrokeVelocity(), mTimes, and rGetCachedVoltages().

◆ CalculatePeakMembranePotential()

double PropagationPropertiesCalculator::CalculatePeakMembranePotential ( unsigned  globalNodeIndex)
Returns
the maximum transmembrane potential (maximum systolic potential) at a single cell. We calculate for the last AP found in the simulation data.
Parameters
globalNodeIndexThe cell at which to calculate.

Definition at line 157 of file PropagationPropertiesCalculator.cpp.

References rGetCachedVoltages().

◆ CalculateUpstrokeTimes()

std::vector< double > PropagationPropertiesCalculator::CalculateUpstrokeTimes ( unsigned  globalNodeIndex,
double  threshold 
)
Returns
the times of upstroke at a single cell. We return all the times of upstroke velocities for all APs.
Parameters
globalNodeIndexThe cell at which to calculate.
thresholdThe voltage threshold for APD calculation (we count this as the start of an AP)

Definition at line 70 of file PropagationPropertiesCalculator.cpp.

References CellProperties::GetTimesAtMaxUpstrokeVelocity(), mTimes, and rGetCachedVoltages().

◆ rGetCachedVoltages()

std::vector< double > & PropagationPropertiesCalculator::rGetCachedVoltages ( unsigned  globalNodeIndex)
protected
Returns
the voltages vector for the given node and cache it, returning a reference to the cached vector. If subsequently called with the same index, will return the cached vector without re-reading from file.

Note: will only cache the last node index used.

Parameters
globalNodeIndexthe index of the node to cache voltages for

Definition at line 308 of file PropagationPropertiesCalculator.cpp.

References Hdf5DataReader::GetVariableOverTime(), mCachedNodeGlobalIndex, mCachedVoltages, mpDataReader, and mVoltageName.

Referenced by CalculateAboveThresholdDepolarisationsForLastAp(), CalculateActionPotentialDuration(), CalculateAllAboveThresholdDepolarisations(), CalculateAllActionPotentialDurations(), CalculateAllConductionVelocities(), CalculateAllMaximumUpstrokeVelocities(), CalculateConductionVelocity(), CalculateMaximumUpstrokeVelocity(), CalculatePeakMembranePotential(), and CalculateUpstrokeTimes().

◆ SetHdf5DataReader()

void PropagationPropertiesCalculator::SetHdf5DataReader ( Hdf5DataReader pDataReader)

Provide a new pointer to an HDF5 data reader

Parameters
pDataReaderAn HDF5 data reader to use (needed if the existing one is deleted and a new one opened)

Definition at line 318 of file PropagationPropertiesCalculator.cpp.

References mpDataReader.

Member Data Documentation

◆ mCachedNodeGlobalIndex

unsigned PropagationPropertiesCalculator::mCachedNodeGlobalIndex
private

Which node voltages have been cached for, if any

Definition at line 63 of file PropagationPropertiesCalculator.hpp.

Referenced by rGetCachedVoltages().

◆ mCachedVoltages

std::vector<double> PropagationPropertiesCalculator::mCachedVoltages
private

The cached voltages vector

Definition at line 65 of file PropagationPropertiesCalculator.hpp.

Referenced by rGetCachedVoltages().

◆ mpDataReader

Hdf5DataReader* PropagationPropertiesCalculator::mpDataReader
private

◆ mTimes

◆ mVoltageName

const std::string PropagationPropertiesCalculator::mVoltageName
private

Name of the variable representing the membrane potential.

Definition at line 59 of file PropagationPropertiesCalculator.hpp.

Referenced by CalculateAllActionPotentialDurationsForNodeRange(), CalculateAllConductionVelocities(), CalculateConductionVelocity(), and rGetCachedVoltages().


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