Chaste  Build::
LQRadiotherapyCellKiller.hpp
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 #ifndef LQRADIOTHERAPYCELLKILLER_HPP_
37 #define LQRADIOTHERAPYCELLKILLER_HPP_
38 
39 #include "AbstractCellKiller.hpp"
40 #include "RandomNumberGenerator.hpp"
41 
42 #include "ChasteSerialization.hpp"
43 #include <boost/serialization/base_object.hpp>
44 #include "UnitCollection.hpp"
45 
50 template<unsigned DIM>
52 {
56  units::quantity<unit::per_absorbed_dose> cancerousLinearRadiosensitivity;
57 
61  units::quantity<unit::per_absorbed_dose_squared> cancerousQuadraticRadiosensitivity;
62 
66  units::quantity<unit::per_absorbed_dose> normalLinearRadiosensitivity;
67 
71  units::quantity<unit::per_absorbed_dose_squared> normalQuadraticRadiosensitivity;
72 
76  units::quantity<unit::absorbed_dose> mDose;
77 
81  std::vector<units::quantity<unit::time> > mRadiationTimes;
82 
86  double mOerAlphaMax;
87 
91  double mOerAlphaMin;
92 
96  double mOerBetaMax;
97 
101  double mOerBetaMin;
102 
106  double mKOer;
107 
111  units::quantity<unit::per_absorbed_dose> mAlphaMax;
112 
116  units::quantity<unit::per_absorbed_dose_squared> mBetaMax;
117 
121  bool mUseOer;
122 
123 private:
124 
133  template<class Archive>
134  void serialize(Archive & archive, const unsigned int version)
135  {
136  archive & boost::serialization::base_object<AbstractCellKiller<DIM> >(*this);
137 
138  // Make sure the random number generator is also archived
139  SerializableSingleton<RandomNumberGenerator>* p_rng_wrapper = RandomNumberGenerator::Instance()->GetSerializationWrapper();
140  archive & p_rng_wrapper;
141  }
142 
143 public:
144 
150  LQRadiotherapyCellKiller(AbstractCellPopulation<DIM>* pCellPopulation);
151 
157  void CheckAndLabelSingleCellForApoptosis(CellPtr pCell);
158 
164 
170  void OutputCellKillerParameters(out_stream& rParamsFile);
171 
176  void SetDoseInjected(units::quantity<unit::absorbed_dose> d);
177 
182  void SetTimeOfRadiation(std::vector<units::quantity<unit::time> > t);
183 
190  void SetCancerousRadiosensitivity(units::quantity<unit::per_absorbed_dose> alpha, units::quantity<unit::per_absorbed_dose_squared> beta);
191 
198  void SetNormalRadiosensitivity(units::quantity<unit::per_absorbed_dose> alpha, units::quantity<unit::per_absorbed_dose_squared> beta);
199 
204  void SetOerAlphaMax(double value);
205 
210  void SetOerAlphaMin(double value);
211 
216  void SetOerBetaMax(double value);
217 
222  void SetOerBetaMin(double value);
223 
228  void SetOerConstant(double value);
229 
234  void SetAlphaMax(units::quantity<unit::per_absorbed_dose> value);
235 
240  void SetBetaMax(units::quantity<unit::per_absorbed_dose_squared> value);
241 
246  void UseOer(bool useOer);
247 
248 };
249 
250 #include "SerializationExportWrapper.hpp"
251 EXPORT_TEMPLATE_CLASS_SAME_DIMS(LQRadiotherapyCellKiller)
252 
253 namespace boost
254 {
255 namespace serialization
256 {
260 template<class Archive, unsigned DIM>
261 inline void save_construct_data(Archive & ar, const LQRadiotherapyCellKiller<DIM> * t, const unsigned int file_version)
262 {
263  // Save data required to construct instance
264  const AbstractCellPopulation<DIM>* const p_cell_population = t->GetCellPopulation();
265  ar << p_cell_population;
266 }
267 
271 template<class Archive, unsigned DIM>
272 inline void load_construct_data(Archive & ar, LQRadiotherapyCellKiller<DIM> * t, const unsigned int file_version)
273 {
274  // Retrieve data from archive required to construct new instance
275  AbstractCellPopulation<DIM>* p_cell_population;
276  ar >> p_cell_population;
277 
278  // Invoke inplace constructor to initialise instance
279  ::new (t) LQRadiotherapyCellKiller<DIM>(p_cell_population);
280 }
281 }
282 } // namespace ...
283 
284 #endif /*LQRADIOTHERAPYCELLKILLER_HPP_*/
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)
friend class boost::serialization::access
units::quantity< unit::per_absorbed_dose > mAlphaMax
void SetDoseInjected(units::quantity< unit::absorbed_dose > d)
void serialize(Archive &archive, const unsigned int version)
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)
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)