PropagationPropertiesCalculator.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 
00030 #ifndef _PROPAGATIONPROPERTIESCALCULATOR_HPP_
00031 #define _PROPAGATIONPROPERTIESCALCULATOR_HPP_
00032 
00033 #include "Hdf5DataReader.hpp"
00034 #include <string>
00035 
00036 
00046 class PropagationPropertiesCalculator
00047 {
00048 private:
00050     Hdf5DataReader *mpDataReader;
00052     const std::string mVoltageName;
00054     std::vector<double> mTimes;
00056     unsigned mCachedNodeGlobalIndex;
00058     std::vector<double> mCachedVoltages;
00059 
00069     std::vector<double>& rCacheVoltages(unsigned globalNodeIndex);
00070 
00071 public:
00079     PropagationPropertiesCalculator(Hdf5DataReader* pDataReader,
00080                                     const std::string voltageName = "V");
00081 
00083     virtual ~PropagationPropertiesCalculator();
00084 
00091     double CalculateMaximumUpstrokeVelocity(unsigned globalNodeIndex);
00092 
00100     std::vector<double> CalculateAllMaximumUpstrokeVelocities(unsigned globalNodeIndex, double threshold);
00101 
00109     std::vector<double> CalculateUpstrokeTimes(unsigned globalNodeIndex, double threshold);
00110 
00122     double CalculateConductionVelocity(unsigned globalNearNodeIndex,
00123                                        unsigned globalFarNodeIndex,
00124                                        const double euclideanDistance);
00125 
00137      std::vector<double> CalculateAllConductionVelocities(unsigned globalNearNodeIndex,
00138                                                           unsigned globalFarNodeIndex,
00139                                                           const double euclideanDistance);
00147     double CalculateActionPotentialDuration(const double percentage,
00148                                             unsigned globalNodeIndex);
00156     double CalculatePeakMembranePotential(unsigned globalNodeIndex);
00157 
00165     std::vector<double> CalculateAllActionPotentialDurations(const double percentage,
00166                                                              unsigned globalNodeIndex,
00167                                                              double threshold);
00168 
00177     std::vector<std::vector<double> > CalculateAllActionPotentialDurationsForNodeRange(const double percentage,
00178                                                                                        unsigned lowerNodeIndex,
00179                                                                                        unsigned upperNodeIndex,
00180                                                                                        double threshold);
00181 
00189     std::vector<unsigned> CalculateAllAboveThresholdDepolarisations(unsigned globalNodeIndex,
00190                                                                     double threshold);
00191 
00199     unsigned CalculateAboveThresholdDepolarisationsForLastAp(unsigned globalNodeIndex,
00200                                                              double threshold);
00201 
00202 };
00203 
00204 #endif //_PROPAGATIONPROPERTIESCALCULATOR_HPP_
Generated on Thu Dec 22 13:00:06 2011 for Chaste by  doxygen 1.6.3