00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2010 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 _CELLPROPERTIES_HPP_ 00031 #define _CELLPROPERTIES_HPP_ 00032 00033 #include "OdeSolution.hpp" 00034 00048 class CellProperties 00049 { 00050 private: 00052 std::vector<double>& mrVoltage; 00054 std::vector<double>& mrTime; 00055 00061 double mThreshold; 00062 00064 std::vector<double> mOnsets; 00066 std::vector<double> mRestingValues; 00068 std::vector<double> mCycleLengths; 00070 std::vector<double> mPeakValues; 00072 std::vector<double> mMaxUpstrokeVelocities; 00074 std::vector<double> mTimesAtMaxUpstrokeVelocity; 00076 std::vector<unsigned> mCounterOfPlateauDepolarisations; 00077 00081 void CalculateProperties(); 00082 00094 std::vector<double> CalculateActionPotentialDurations(const double percentage); 00095 00100 void CheckExceededThreshold(void); 00101 00107 void CheckReturnedToThreshold(void); 00108 00109 public: 00110 00119 CellProperties(std::vector<double> &rVoltage, std::vector<double> &rTime, double threshold=-30.0) 00120 : mrVoltage(rVoltage), 00121 mrTime(rTime), 00122 mThreshold(threshold) 00123 { 00124 CalculateProperties(); 00125 } 00126 00132 std::vector<double> GetMaxUpstrokeVelocities(); 00133 00141 double GetLastMaxUpstrokeVelocity(); 00142 00148 std::vector<double> GetTimesAtMaxUpstrokeVelocity(); 00149 00157 double GetTimeAtLastMaxUpstrokeVelocity(); 00158 00164 std::vector<double> GetCycleLengths(); 00165 00171 std::vector<double> GetPeakPotentials(); 00172 00178 double GetLastPeakPotential(); 00179 00188 std::vector<double> GetRestingPotentials(); 00189 00198 std::vector<double> GetAllActionPotentialDurations(const double percentage); 00199 00209 double GetLastActionPotentialDuration(const double percentage); 00210 00216 std::vector<double> GetActionPotentialAmplitudes(); 00217 00218 00224 std::vector<unsigned> GetNumberOfAboveThresholdDepolarisationsForAllAps(); 00225 00231 unsigned GetNumberOfAboveThresholdDepolarisationsForLastAp(); 00232 }; 00233 00234 #endif //_CELLPROPERTIES_HPP_