#include <CryptStatistics.hpp>
Public Member Functions | |
CryptStatistics (MeshBasedTissue< 2 > &rCrypt) | |
virtual | ~CryptStatistics () |
std::vector< TissueCell * > | GetCryptSection (double xBottom=DBL_MAX, double xTop=DBL_MAX, double yTop=CancerParameters::Instance()->GetCryptLength()+2.0, bool periodic=false) |
std::vector< TissueCell * > | GetCryptSectionPeriodic (double xBottom=DBL_MAX, double xTop=DBL_MAX, double yTop=CancerParameters::Instance()->GetCryptLength()+2.0) |
Protected Member Functions | |
bool | CellIsInSection (double xBottom, double xTop, double yTop, const c_vector< double, 2 > &cellPosition, double widthOfSection=0.5) |
bool | CellIsInSectionPeriodic (double xBottom, double xTop, double yTop, const c_vector< double, 2 > &cellPosition, double widthOfSection=1.0) |
Definition at line 36 of file CryptStatistics.hpp.
CryptStatistics::CryptStatistics | ( | MeshBasedTissue< 2 > & | rCrypt | ) | [inline] |
virtual CryptStatistics::~CryptStatistics | ( | ) | [inline, virtual] |
Free any memory allocated by the constructor
Definition at line 85 of file CryptStatistics.hpp.
bool CryptStatistics::CellIsInSection | ( | double | xBottom, | |
double | xTop, | |||
double | yTop, | |||
const c_vector< double, 2 > & | cellPosition, | |||
double | widthOfSection = 0.5 | |||
) | [protected] |
Method computing the perpendicular distance from the cell to the line from (xBottom,0) to (xTop,yTop), and returning if the distance is within the specified width to the section (defaults to 0.5)
xBottom | ||
xTop | ||
yTop | ||
cellPosition | ||
widthOfSection |
Definition at line 42 of file CryptStatistics.cpp.
References AbstractCryptStatistics::mrCrypt, and MeshBasedTissue< DIM >::rGetMesh().
Referenced by GetCryptSection().
bool CryptStatistics::CellIsInSectionPeriodic | ( | double | xBottom, | |
double | xTop, | |||
double | yTop, | |||
const c_vector< double, 2 > & | cellPosition, | |||
double | widthOfSection = 1.0 | |||
) | [protected] |
Method computing the perpendicular distance from the cell to the line from (xBottom,0) to (xTop,yTop), taking into account periodicity, and returning if the distance is within the specified width to the section (defaults to 1.0). Done by considering the two possible lines and checking if cells are within range.
xBottom | ||
xTop | ||
yTop | ||
cellPosition | ||
widthOfSection |
Definition at line 65 of file CryptStatistics.cpp.
References CancerParameters::GetCryptWidth(), CancerParameters::Instance(), AbstractCryptStatistics::mrCrypt, and MeshBasedTissue< DIM >::rGetMesh().
Referenced by GetCryptSection().
std::vector< TissueCell * > CryptStatistics::GetCryptSection | ( | double | xBottom = DBL_MAX , |
|
double | xTop = DBL_MAX , |
|||
double | yTop = CancerParameters::Instance()->GetCryptLength() + 2.0 , |
|||
bool | periodic = false | |||
) |
Get all cells within a cell width of the section defined as the line between points (xBottom,0) and (xTop,yTop)
Periodicity can be taken into account (if xTop and xBottom are more than half a crypt width apart then a more realistic section will be across the periodic boundary), using the final parameter. This obviously requires the mesh to be cylindrical.
xBottom | (defaults to a random number U[0,crypt_width]) | |
xTop | (defaults to a random number U[0,crypt_width]) | |
yTop | (defaults to crypt_length +2, to get the cells near the top) | |
periodic | (defaults to false) |
Definition at line 116 of file CryptStatistics.cpp.
References AbstractTissue< DIM >::Begin(), CellIsInSection(), CellIsInSectionPeriodic(), AbstractTissue< DIM >::End(), CancerParameters::GetCryptWidth(), AbstractCellCentreBasedTissue< DIM >::GetLocationOfCellCentre(), CancerParameters::Instance(), and AbstractCryptStatistics::mrCrypt.
Referenced by GetCryptSectionPeriodic().
std::vector< TissueCell * > CryptStatistics::GetCryptSectionPeriodic | ( | double | xBottom = DBL_MAX , |
|
double | xTop = DBL_MAX , |
|||
double | yTop = CancerParameters::Instance()->GetCryptLength() + 2.0 | |||
) |
Get all cells with a cell width of the line defined by the points (xBottom,0) and (xTop,yTop), taking into account periodicity
If xTop and xBottom are more than half a crypt width apart then a more realistic section will be across the periodic boundary.
Note that placing calls to functions with side-effects (eg. changing the random seed) in the default arguments is DANGEROUS. There is no guarantee that the compiler will execute these in a sensible order. It appears that Intel goes left-to-right and Gcc goes right-to-left.
xBottom | (defaults to a random number U[0,crypt_width]) | |
xTop | (defaults to a random number U[0,crypt_width]) | |
yTop | (defaults to crypt_length +2, to get the cells near the top) |
Definition at line 180 of file CryptStatistics.cpp.
References GetCryptSection().