Chaste  Build::
LQRadiotherapyCellKiller.cpp
1 /*
2 
3  Copyright (c) 2005-2016, University of Oxford.
4  All rights reserved.
5 
6  University of Oxford means the Chancellor, Masters and Scholars of the
7  University of Oxford, having an administrative office at Wellington
8  Square, Oxford OX1 2JD, UK.
9 
10  This file is part of Chaste.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34  */
35 
36 #include "LQRadiotherapyCellKiller.hpp"
37 #include "CancerCellMutationState.hpp"
38 #include "StalkCellMutationState.hpp"
39 #include "BaseUnits.hpp"
40 
41 template<unsigned DIM>
42 LQRadiotherapyCellKiller<DIM>::LQRadiotherapyCellKiller(AbstractCellPopulation<DIM>* pCellPopulation) :
43  AbstractCellKiller<DIM>(pCellPopulation),
44  cancerousLinearRadiosensitivity(0.3 * unit::per_gray),
45  cancerousQuadraticRadiosensitivity(0.03 * unit::per_gray_squared),
46  normalLinearRadiosensitivity(0.15 * unit::per_gray),
47  normalQuadraticRadiosensitivity(0.05 * unit::per_gray_squared),
48  mDose(2.0 * unit::gray),
49  mRadiationTimes(),
50  mOerAlphaMax(1.75),
51  mOerAlphaMin(1.0),
52  mOerBetaMax(3.25),
53  mOerBetaMin(1.0),
54  mKOer(3.28),
55  mAlphaMax(0.3 * unit::per_gray),
56  mBetaMax(0.03 * unit::per_gray_squared),
57  mUseOer(false)
58 {
59 
60 }
61 
62 template<unsigned DIM>
63 void LQRadiotherapyCellKiller<DIM>::SetDoseInjected(units::quantity<unit::absorbed_dose> d)
64 {
65  mDose = d;
66 }
67 
68 template<unsigned DIM>
69 void LQRadiotherapyCellKiller<DIM>::SetTimeOfRadiation(std::vector<units::quantity<unit::time> > t)
70 {
71  mRadiationTimes = t;
72 }
73 
74 template<unsigned DIM>
76 {
77  mOerAlphaMax = value;
78 }
79 
80 template<unsigned DIM>
82 {
83  mOerAlphaMin = value;
84 }
85 
86 template<unsigned DIM>
88 {
89  mOerBetaMax = value;
90 }
91 
92 template<unsigned DIM>
94 {
95  mOerBetaMin = value;
96 }
97 
98 template<unsigned DIM>
100 {
101  mKOer = value;
102 }
103 
104 template<unsigned DIM>
105 void LQRadiotherapyCellKiller<DIM>::SetAlphaMax(units::quantity<unit::per_absorbed_dose> value)
106 {
107  mAlphaMax = value;
108 }
109 
110 template<unsigned DIM>
111 void LQRadiotherapyCellKiller<DIM>::SetBetaMax(units::quantity<unit::per_absorbed_dose_squared> value)
112 {
113  mBetaMax = value;
114 }
115 
116 template<unsigned DIM>
118 {
119  mUseOer = useOer;
120 }
121 
122 template<unsigned DIM>
123 void LQRadiotherapyCellKiller<DIM>::SetCancerousRadiosensitivity(units::quantity<unit::per_absorbed_dose> alpha,
124  units::quantity<unit::per_absorbed_dose_squared> beta)
125 {
128 }
129 
130 template<unsigned DIM>
131 void LQRadiotherapyCellKiller<DIM>::SetNormalRadiosensitivity(units::quantity<unit::per_absorbed_dose> alpha,
132  units::quantity<unit::per_absorbed_dose_squared> beta)
133 {
136 }
137 
138 template<unsigned DIM>
140 {
141  if (!pCell->GetMutationState()->IsType<StalkCellMutationState>())
142  {
143  for (unsigned idx = 0; idx < mRadiationTimes.size(); idx++)
144  {
145  if (SimulationTime::Instance()->GetTime()*BaseUnits::Instance()->GetReferenceTimeScale() == mRadiationTimes[idx])
146  {
147  // Model radiation hit
148  if (mUseOer)
149  {
150  double oxygen = pCell->GetCellData()->GetItem("oxygen");
151  double oer_alpha = (mOerAlphaMax - mOerAlphaMin) * mKOer / (oxygen + mKOer) + mOerAlphaMin;
152  double oer_beta = (mOerBetaMax - mOerBetaMin) * mKOer / (oxygen + mKOer) + mOerBetaMin;
153  units::quantity<unit::per_absorbed_dose> alpha = mAlphaMax / oer_alpha;
154  units::quantity<unit::per_absorbed_dose_squared> beta = mBetaMax / (oer_beta * oer_beta);
155  double death_prob = (1.0 - exp(-alpha * mDose - beta * mDose * mDose));
156 
157  if (!pCell->HasApoptosisBegun() && RandomNumberGenerator::Instance()->ranf() < death_prob)
158  {
159  pCell->StartApoptosis();
160  }
161  }
162  else
163  {
164  double death_prob = (1.0
167 
168  if (!pCell->HasApoptosisBegun() && RandomNumberGenerator::Instance()->ranf() < death_prob)
169  {
170  pCell->StartApoptosis();
171  }
172  }
173  }
174  }
175  }
176 
177 }
178 
179 template<unsigned DIM>
181 {
182  for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin();
183  cell_iter != this->mpCellPopulation->End(); ++cell_iter)
184  {
186  }
187 }
188 
189 template<unsigned DIM>
191 {
192  *rParamsFile;
193 
194  // Call method on direct parent class
196 }
197 
199 // Explicit instantiation
201 
202 template class LQRadiotherapyCellKiller<1> ;
203 template class LQRadiotherapyCellKiller<2> ;
204 template class LQRadiotherapyCellKiller<3> ;
205 
206 // Serialization for Boost >= 1.36
207 #include "SerializationExportWrapperForCpp.hpp"
208 EXPORT_TEMPLATE_CLASS_SAME_DIMS(LQRadiotherapyCellKiller)
void CheckAndLabelSingleCellForApoptosis(CellPtr pCell)
std::vector< units::quantity< unit::time > > mRadiationTimes
void SetTimeOfRadiation(std::vector< units::quantity< unit::time > > t)
void OutputCellKillerParameters(out_stream &rParamsFile)
void SetAlphaMax(units::quantity< unit::per_absorbed_dose > value)
void SetBetaMax(units::quantity< unit::per_absorbed_dose_squared > value)
units::quantity< unit::time > GetReferenceTimeScale()
Definition: BaseUnits.cpp:72
units::quantity< unit::per_absorbed_dose > mAlphaMax
void SetDoseInjected(units::quantity< unit::absorbed_dose > d)
units::quantity< unit::per_absorbed_dose_squared > cancerousQuadraticRadiosensitivity
units::quantity< unit::absorbed_dose > mDose
LQRadiotherapyCellKiller(AbstractCellPopulation< DIM > *pCellPopulation)
units::quantity< unit::per_absorbed_dose_squared > normalQuadraticRadiosensitivity
void SetCancerousRadiosensitivity(units::quantity< unit::per_absorbed_dose > alpha, units::quantity< unit::per_absorbed_dose_squared > beta)
static BaseUnits * Instance()
Definition: BaseUnits.cpp:53
units::quantity< unit::per_absorbed_dose_squared > mBetaMax
units::quantity< unit::per_absorbed_dose > normalLinearRadiosensitivity
units::quantity< unit::per_absorbed_dose > cancerousLinearRadiosensitivity
void SetNormalRadiosensitivity(units::quantity< unit::per_absorbed_dose > alpha, units::quantity< unit::per_absorbed_dose_squared > beta)