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 <vector> 00034 00048 class CellProperties 00049 { 00050 private: 00052 std::vector<double>& mrVoltage; 00054 std::vector<double>& mrTime; 00055 00060 bool mUnfinishedActionPotentials; 00061 00067 double mThreshold; 00068 00070 std::vector<double> mOnsets; 00072 std::vector<double> mRestingValues; 00074 std::vector<double> mCycleLengths; 00076 std::vector<double> mPeakValues; 00078 std::vector<double> mMaxUpstrokeVelocities; 00080 std::vector<double> mTimesAtMaxUpstrokeVelocity; 00082 std::vector<unsigned> mCounterOfPlateauDepolarisations; 00083 00087 void CalculateProperties(); 00088 00101 std::vector<double> CalculateActionPotentialDurations(const double percentage); 00102 00107 void CheckExceededThreshold(void); 00108 00114 void CheckReturnedToThreshold(void); 00115 00116 public: 00117 00126 CellProperties(std::vector<double> &rVoltage, std::vector<double> &rTime, double threshold=-30.0) 00127 : mrVoltage(rVoltage), 00128 mrTime(rTime), 00129 mUnfinishedActionPotentials(false), 00130 mThreshold(threshold) 00131 { 00132 CalculateProperties(); 00133 } 00134 00140 std::vector<double> GetMaxUpstrokeVelocities(); 00141 00149 double GetLastMaxUpstrokeVelocity(); 00150 00157 double GetLastCompleteMaxUpstrokeVelocity(); 00158 00164 std::vector<double> GetTimesAtMaxUpstrokeVelocity(); 00165 00173 double GetTimeAtLastMaxUpstrokeVelocity(); 00174 00181 double GetTimeAtLastCompleteMaxUpstrokeVelocity(); 00182 00188 std::vector<double> GetCycleLengths(); 00189 00195 std::vector<double> GetPeakPotentials(); 00196 00202 double GetLastPeakPotential(); 00203 00209 double GetLastCompletePeakPotential(); 00210 00219 std::vector<double> GetRestingPotentials(); 00220 00229 std::vector<double> GetAllActionPotentialDurations(const double percentage); 00230 00240 double GetLastActionPotentialDuration(const double percentage); 00241 00247 std::vector<double> GetActionPotentialAmplitudes(); 00248 00252 std::vector<unsigned> GetNumberOfAboveThresholdDepolarisationsForAllAps(); 00253 00257 unsigned GetNumberOfAboveThresholdDepolarisationsForLastAp(); 00258 }; 00259 00260 #endif //_CELLPROPERTIES_HPP_