Chaste  Release::2017.1
CellProperties Class Reference

#include <CellProperties.hpp>

+ Collaboration diagram for CellProperties:

Public Member Functions

 CellProperties (const std::vector< double > &rVoltage, const std::vector< double > &rTime, double threshold=-30.0)
 
std::vector< doubleGetMaxUpstrokeVelocities ()
 
double GetLastMaxUpstrokeVelocity ()
 
double GetLastCompleteMaxUpstrokeVelocity ()
 
std::vector< doubleGetTimesAtMaxUpstrokeVelocity ()
 
double GetTimeAtLastMaxUpstrokeVelocity ()
 
double GetTimeAtLastCompleteMaxUpstrokeVelocity ()
 
std::vector< doubleGetCycleLengths ()
 
std::vector< doubleGetPeakPotentials ()
 
std::vector< doubleGetTimesAtPeakPotentials ()
 
double GetTimeAtLastPeakPotential ()
 
double GetLastPeakPotential ()
 
double GetLastCompletePeakPotential ()
 
double GetTimeAtLastCompletePeakPotential ()
 
std::vector< doubleGetRestingPotentials ()
 
double GetLastRestingPotential ()
 
std::vector< doubleGetAllActionPotentialDurations (const double percentage)
 
double GetLastActionPotentialDuration (const double percentage)
 
std::vector< doubleGetActionPotentialAmplitudes ()
 
double GetLastActionPotentialAmplitude ()
 
std::vector< unsignedGetNumberOfAboveThresholdDepolarisationsForAllAps ()
 
unsigned GetNumberOfAboveThresholdDepolarisationsForLastAp ()
 

Private Member Functions

void CalculateProperties ()
 
std::vector< doubleCalculateActionPotentialDurations (const double percentage)
 
void CheckExceededThreshold (void)
 
void CheckReturnedToThreshold (void)
 

Private Attributes

const std::vector< double > & mrVoltage
 
const std::vector< double > & mrTime
 
bool mUnfinishedActionPotentials
 
double mThreshold
 
std::vector< doublemOnsets
 
std::vector< doublemRestingValues
 
std::vector< doublemCycleLengths
 
std::vector< doublemPeakValues
 
std::vector< doublemTimesAtPeakValues
 
std::vector< doublemMaxUpstrokeVelocities
 
std::vector< doublemTimesAtMaxUpstrokeVelocity
 
std::vector< unsignedmCounterOfPlateauDepolarisations
 

Detailed Description

Class to calculate various physiological properties from the results of a cardiac simulation.

It will calculate for a single cell: All the Action potential durations (at any percentage) Max. upstroke velocity for each AP Action potential amplitudes for each AP Peak & Resting membrane potentials for all AP Cycle lengths (time between onset of APs)

Definition at line 53 of file CellProperties.hpp.

Constructor & Destructor Documentation

Member Function Documentation

std::vector< double > CellProperties::CalculateActionPotentialDurations ( const double  percentage)
private

Actually calculate APD.

target voltage = resting +'percentage'*(amplitude-resting).

APD is taken to be the time from when the target voltage is crossed upwards to the time voltage crosses the target voltage downwards.

Parameters
percentageThe percentage of the amplitude to calculate for.
Returns
a vector containing the APDs.

Definition at line 220 of file CellProperties.cpp.

References CheckExceededThreshold(), DOUBLE_UNSET, EXCEPTION, mOnsets, mPeakValues, mRestingValues, mrTime, mrVoltage, mThreshold, and UNSIGNED_UNSET.

Referenced by GetAllActionPotentialDurations(), and GetLastActionPotentialDuration().

void CellProperties::CalculateProperties ( )
private

Calculate all the cacheable values.

Todo:
#1495 a horrible magic number but seems to work OK.

Definition at line 55 of file CellProperties.cpp.

References EXCEPTION, mCounterOfPlateauDepolarisations, mCycleLengths, mMaxUpstrokeVelocities, mOnsets, mPeakValues, mRestingValues, mrTime, mrVoltage, mThreshold, mTimesAtMaxUpstrokeVelocity, mTimesAtPeakValues, and mUnfinishedActionPotentials.

Referenced by CellProperties().

void CellProperties::CheckExceededThreshold ( void  )
private

Throw an exception if we are asking for information which is not present, because upstroke was never detected (the voltage trace never exceeded the threshold voltage).

Definition at line 340 of file CellProperties.cpp.

References EXCEPTION, and mOnsets.

Referenced by CalculateActionPotentialDurations(), GetActionPotentialAmplitudes(), and GetRestingPotentials().

void CellProperties::CheckReturnedToThreshold ( void  )
private

Throw an exception if we are asking for information which is not present, because an AP was never detected (the voltage trace never exceeded the threshold voltage and then returned past it).

Definition at line 351 of file CellProperties.cpp.

References EXCEPTION, and mMaxUpstrokeVelocities.

Referenced by GetLastCompleteMaxUpstrokeVelocity(), GetLastCompletePeakPotential(), GetLastMaxUpstrokeVelocity(), GetLastPeakPotential(), GetMaxUpstrokeVelocities(), GetPeakPotentials(), GetTimeAtLastCompleteMaxUpstrokeVelocity(), GetTimeAtLastCompletePeakPotential(), GetTimeAtLastMaxUpstrokeVelocity(), GetTimeAtLastPeakPotential(), GetTimesAtMaxUpstrokeVelocity(), and GetTimesAtPeakPotentials().

std::vector< double > CellProperties::GetActionPotentialAmplitudes ( )

Returns the amplitude of all the action potentials calculated.

Returns
a vector containing all the AP amplitudes

Definition at line 323 of file CellProperties.cpp.

References CheckExceededThreshold(), mPeakValues, and mRestingValues.

Referenced by CellProperties(), and GetLastActionPotentialAmplitude().

std::vector< double > CellProperties::GetAllActionPotentialDurations ( const double  percentage)

Returns all the action potentials durations

Parameters
percentageis the repolarisation percentage that the APD will be calculated for. e.g. percentage = 90 for APD90.
Returns
a vector containing all the APDs

Definition at line 400 of file CellProperties.cpp.

References CalculateActionPotentialDurations().

Referenced by PropagationPropertiesCalculator::CalculateAllActionPotentialDurations(), PropagationPropertiesCalculator::CalculateAllActionPotentialDurationsForNodeRange(), and CellProperties().

std::vector< double > CellProperties::GetCycleLengths ( )

Returns the cycle lengths for all APs.

Returns
a vector containing the cycle lengths for all APs

Definition at line 365 of file CellProperties.cpp.

References mCycleLengths.

Referenced by CellProperties().

double CellProperties::GetLastActionPotentialAmplitude ( )

Returns the amplitude of the last action potential that was recorded.

Returns
The amplitude of the last action potential that was recorded.

Definition at line 335 of file CellProperties.cpp.

References GetActionPotentialAmplitudes().

Referenced by CellProperties().

double CellProperties::GetLastActionPotentialDuration ( const double  percentage)

Returns the amplitude of the last action potential generated. Throws an exception if no AP is generated.

Parameters
percentageis the repolarisation percentage that the APD will be calculated for. e.g. percentage = 90 for APD90.
Returns
the APD of the last AP

Definition at line 513 of file CellProperties.cpp.

References CalculateActionPotentialDurations().

Referenced by PropagationPropertiesCalculator::CalculateActionPotentialDuration(), and CellProperties().

double CellProperties::GetLastCompleteMaxUpstrokeVelocity ( )

Returns the maximum upstroke velocity for the last complete AP. If the threshold is never crossed, it throws an exception.

Returns
the upstroke velocity of the last complete AP

Definition at line 463 of file CellProperties.cpp.

References CheckReturnedToThreshold(), EXCEPTION, mMaxUpstrokeVelocities, and mUnfinishedActionPotentials.

Referenced by CellProperties().

double CellProperties::GetLastCompletePeakPotential ( )

Returns the last complete AP's peak potential.

Returns
last peak potential V_max

Definition at line 419 of file CellProperties.cpp.

References CheckReturnedToThreshold(), EXCEPTION, mPeakValues, and mUnfinishedActionPotentials.

Referenced by CellProperties().

double CellProperties::GetLastMaxUpstrokeVelocity ( )

Returns the maximum upstroke velocity for the last AP. If only one incomplete AP is generated, it returns the maximal upstroke so far. If the threshold is never crossed, it throws an exception.

Returns
the upstroke velocity of the last AP

Definition at line 457 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mMaxUpstrokeVelocities.

Referenced by PropagationPropertiesCalculator::CalculateMaximumUpstrokeVelocity(), and CellProperties().

double CellProperties::GetLastPeakPotential ( )

Returns the last peak potential.

Returns
last peak potential V_max

Definition at line 413 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mPeakValues.

Referenced by CellProperties().

double CellProperties::GetLastRestingPotential ( )

Returns the last resting potential (that would be the last entry of vector returned by GetRestingPotentials())

Returns
the resting potential BEFORE the last upstroke.

Definition at line 524 of file CellProperties.cpp.

References GetRestingPotentials().

Referenced by CellProperties().

std::vector< double > CellProperties::GetMaxUpstrokeVelocities ( )

Returns the maximum upstroke velocity for all APs.

Returns
a vector containing the maximum upstroke velocity for all APs

Definition at line 388 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mMaxUpstrokeVelocities.

Referenced by PropagationPropertiesCalculator::CalculateAllMaximumUpstrokeVelocities(), PropagationPropertiesCalculator::CalculateConductionVelocity(), and CellProperties().

std::vector< unsigned > CellProperties::GetNumberOfAboveThresholdDepolarisationsForAllAps ( )
Returns
a vector containing the number of above-threshold depolarisations for each Ap.

Definition at line 405 of file CellProperties.cpp.

References mCounterOfPlateauDepolarisations.

Referenced by PropagationPropertiesCalculator::CalculateAllAboveThresholdDepolarisations(), and CellProperties().

unsigned CellProperties::GetNumberOfAboveThresholdDepolarisationsForLastAp ( )
Returns
the number of above-threshold depolarisations for the last Ap.

Definition at line 519 of file CellProperties.cpp.

References mCounterOfPlateauDepolarisations.

Referenced by PropagationPropertiesCalculator::CalculateAboveThresholdDepolarisationsForLastAp(), and CellProperties().

std::vector< double > CellProperties::GetPeakPotentials ( )

Returns the peak potentials for all APs.

Returns
a vector containing the peak potentials for all APs

Definition at line 376 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mPeakValues.

Referenced by CellProperties().

std::vector< double > CellProperties::GetRestingPotentials ( )

Returns the minimum resting potential BEFORE each AP.

These are calculated as the point where the derivative of the potential is lowest, i.e. when the profile is flattest in between two APs.

Or just the minimum voltage before an upstroke if we can't find a flat bit.

So this vector should be the same length as the other AP property vectors.

Returns
a vector containing the resting potentials for all APs

Definition at line 370 of file CellProperties.cpp.

References CheckExceededThreshold(), and mRestingValues.

Referenced by CellProperties(), and GetLastRestingPotential().

double CellProperties::GetTimeAtLastCompleteMaxUpstrokeVelocity ( )

Returns the time at which the maximum upstroke velocity for the last complete AP occurred. If the threshold is never crossed, it throws an exception.

Returns
the time of the upstroke velocity of the last full AP

Definition at line 494 of file CellProperties.cpp.

References CheckReturnedToThreshold(), EXCEPTION, mTimesAtMaxUpstrokeVelocity, and mUnfinishedActionPotentials.

Referenced by CellProperties().

double CellProperties::GetTimeAtLastCompletePeakPotential ( )

Returns the time of the last complete AP's peak potential.

Returns
last peak potential time.

Definition at line 438 of file CellProperties.cpp.

References CheckReturnedToThreshold(), EXCEPTION, mTimesAtPeakValues, and mUnfinishedActionPotentials.

Referenced by CellProperties().

double CellProperties::GetTimeAtLastMaxUpstrokeVelocity ( )

Returns the time at which the maximum upstroke velocity for the last AP occurred. If only one incomplete AP is generated, it returns the time of the maximal upstroke so far. If the threshold is never crossed, it throws an exception.

Returns
the time of the upstroke velocity of the last AP

Definition at line 482 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mTimesAtMaxUpstrokeVelocity.

Referenced by PropagationPropertiesCalculator::CalculateConductionVelocity(), and CellProperties().

double CellProperties::GetTimeAtLastPeakPotential ( )

Returns the time of the final peak potential.

Returns
the times of the final peak potentials

Definition at line 488 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mTimesAtPeakValues.

Referenced by CellProperties().

std::vector< double > CellProperties::GetTimesAtMaxUpstrokeVelocity ( )

Returns the time at which the maximum upstroke velocity occurred for all APs.

Returns
a vector containing the times of maximum upstroke velocity for all APs

Definition at line 394 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mTimesAtMaxUpstrokeVelocity.

Referenced by PropagationPropertiesCalculator::CalculateAllConductionVelocities(), PropagationPropertiesCalculator::CalculateConductionVelocity(), PropagationPropertiesCalculator::CalculateUpstrokeTimes(), and CellProperties().

std::vector< double > CellProperties::GetTimesAtPeakPotentials ( )

Returns the times of all the peak potentials for all APs.

Returns
a vector containing the times of peak potentials for all APs

Definition at line 382 of file CellProperties.cpp.

References CheckReturnedToThreshold(), and mTimesAtPeakValues.

Referenced by CellProperties().

Member Data Documentation

std::vector<unsigned> CellProperties::mCounterOfPlateauDepolarisations
private

Cached vector containing the number of recorded depolarisations while above threshold

Definition at line 96 of file CellProperties.hpp.

Referenced by CalculateProperties(), GetNumberOfAboveThresholdDepolarisationsForAllAps(), and GetNumberOfAboveThresholdDepolarisationsForLastAp().

std::vector<double> CellProperties::mCycleLengths
private

Cached vector containing AP cycle lengths properties

Definition at line 81 of file CellProperties.hpp.

Referenced by CalculateProperties(), and GetCycleLengths().

std::vector<double> CellProperties::mMaxUpstrokeVelocities
private

Cached vector containing AP upstroke properties

Definition at line 90 of file CellProperties.hpp.

Referenced by CalculateProperties(), CheckReturnedToThreshold(), GetLastCompleteMaxUpstrokeVelocity(), GetLastMaxUpstrokeVelocity(), and GetMaxUpstrokeVelocities().

std::vector<double> CellProperties::mOnsets
private

Cached vector containing AP onset properties

Definition at line 75 of file CellProperties.hpp.

Referenced by CalculateActionPotentialDurations(), CalculateProperties(), and CheckExceededThreshold().

std::vector<double> CellProperties::mPeakValues
private
std::vector<double> CellProperties::mRestingValues
private

Cached vector containing AP resting properties

Definition at line 78 of file CellProperties.hpp.

Referenced by CalculateActionPotentialDurations(), CalculateProperties(), GetActionPotentialAmplitudes(), and GetRestingPotentials().

const std::vector<double>& CellProperties::mrTime
private

The simulation results to process, time

Definition at line 59 of file CellProperties.hpp.

Referenced by CalculateActionPotentialDurations(), and CalculateProperties().

const std::vector<double>& CellProperties::mrVoltage
private

The simulation results to process, voltage

Definition at line 57 of file CellProperties.hpp.

Referenced by CalculateActionPotentialDurations(), and CalculateProperties().

double CellProperties::mThreshold
private

Threshold for determining what counts as an action potential. This is a value part way between the min & max potential, to avoid problems due to 'notches' in an action potential.

Definition at line 72 of file CellProperties.hpp.

Referenced by CalculateActionPotentialDurations(), and CalculateProperties().

std::vector<double> CellProperties::mTimesAtMaxUpstrokeVelocity
private

Cached vector containing the times of AP upstrokes

Definition at line 93 of file CellProperties.hpp.

Referenced by CalculateProperties(), GetTimeAtLastCompleteMaxUpstrokeVelocity(), GetTimeAtLastMaxUpstrokeVelocity(), and GetTimesAtMaxUpstrokeVelocity().

std::vector<double> CellProperties::mTimesAtPeakValues
private

Cached vector containing the times of AP peaks

Definition at line 87 of file CellProperties.hpp.

Referenced by CalculateProperties(), GetTimeAtLastCompletePeakPotential(), GetTimeAtLastPeakPotential(), and GetTimesAtPeakPotentials().

bool CellProperties::mUnfinishedActionPotentials
private

Whether we have any unfinished action potentials i.e. the trace ends ABOVE_THRESHOLD.

Definition at line 65 of file CellProperties.hpp.

Referenced by CalculateProperties(), GetLastCompleteMaxUpstrokeVelocity(), GetLastCompletePeakPotential(), GetTimeAtLastCompleteMaxUpstrokeVelocity(), and GetTimeAtLastCompletePeakPotential().


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