Chaste  Release::2017.1
CryptStatistics Class Reference

#include <CryptStatistics.hpp>

+ Inheritance diagram for CryptStatistics:
+ Collaboration diagram for CryptStatistics:

Public Member Functions

 CryptStatistics (MeshBasedCellPopulation< 2 > &rCrypt)
 
std::vector< CellPtr > GetCryptSection (double yTop, double xBottom=DBL_MAX, double xTop=DBL_MAX, bool periodic=false)
 
std::vector< CellPtr > GetCryptSectionPeriodic (double yTop, double xBottom=DBL_MAX, double xTop=DBL_MAX)
 
- Public Member Functions inherited from AbstractCryptStatistics
 AbstractCryptStatistics (MeshBasedCellPopulation< 2 > &rCrypt)
 
virtual ~AbstractCryptStatistics ()
 
void LabelSPhaseCells ()
 
void LabelAllCellsAsHealthy ()
 
std::vector< boolAreCryptSectionCellsLabelled (std::vector< CellPtr > &rCryptSection)
 

Private Member Functions

bool CellIsInSection (double xBottom, double xTop, double yTop, const c_vector< double, 2 > &rCellPosition, double widthOfSection=0.5)
 
bool CellIsInSectionPeriodic (double xBottom, double xTop, double yTop, const c_vector< double, 2 > &rCellPosition, double widthOfSection=1.0)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractCryptStatistics
MeshBasedCellPopulation< 2 > & mrCrypt
 

Detailed Description

Concrete statistics class for the cylindrical crypt model.

Definition at line 44 of file CryptStatistics.hpp.

Constructor & Destructor Documentation

CryptStatistics::CryptStatistics ( MeshBasedCellPopulation< 2 > &  rCrypt)

Constructor

Parameters
rCryptThe crypt

Definition at line 47 of file CryptStatistics.cpp.

Member Function Documentation

bool CryptStatistics::CellIsInSection ( double  xBottom,
double  xTop,
double  yTop,
const c_vector< double, 2 > &  rCellPosition,
double  widthOfSection = 0.5 
)
private

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).

Parameters
xBottomthe x coordinate of the bottom of the line
xTopthe x coordinate of the top of the line
yTopthe y coordinate of the top of the line
rCellPositionthe location of the cell centre
widthOfSectionthe width of the line
Returns
whether the cell is in the section

Definition at line 120 of file CryptStatistics.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), AbstractCryptStatistics::mrCrypt, and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::rGetMesh().

Referenced by GetCryptSection().

bool CryptStatistics::CellIsInSectionPeriodic ( double  xBottom,
double  xTop,
double  yTop,
const c_vector< double, 2 > &  rCellPosition,
double  widthOfSection = 1.0 
)
private

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.

Parameters
xBottomthe x coordinate of the bottom of the line
xTopthe x coordinate of the top of the line
yTopthe y coordinate of the top of the line
rCellPositionthe location of the cell centre
widthOfSectionthe width of the line
Returns
whether the cell is in the section

Definition at line 143 of file CryptStatistics.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), AbstractCryptStatistics::mrCrypt, and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::rGetMesh().

Referenced by GetCryptSection().

std::vector< CellPtr > CryptStatistics::GetCryptSection ( double  yTop,
double  xBottom = DBL_MAX,
double  xTop = DBL_MAX,
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.

Parameters
yTopthe y coordinate of the top of the line
xBottomthe x coordinate of the bottom of the line (defaults to a random number U[0,crypt_width])
xTopthe x coordinate of the top of the line (defaults to a random number U[0,crypt_width])
periodicwhether periodicity is accounted for (defaults to false)
Returns
an ordered list of CellPtrs from the bottom to the top of the crypt.

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.

Definition at line 52 of file CryptStatistics.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::Begin(), CellIsInSection(), CellIsInSectionPeriodic(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::End(), AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationOfCellCentre(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), RandomNumberGenerator::Instance(), AbstractCryptStatistics::mrCrypt, RandomNumberGenerator::ranf(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::rGetMesh().

Referenced by GetCryptSectionPeriodic().

std::vector< CellPtr > CryptStatistics::GetCryptSectionPeriodic ( double  yTop,
double  xBottom = DBL_MAX,
double  xTop = DBL_MAX 
)

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.

Parameters
yTopthe y coordinate of the top of the line
xBottomthe x coordinate of the bottom of the line (defaults to a random number U[0,crypt_width])
xTopthe x coordinate of the top of the line (defaults to a random number U[0,crypt_width])
Returns
an ordered list of CellPtrs from the bottom to the top of the crypt.

Definition at line 116 of file CryptStatistics.cpp.

References GetCryptSection().


The documentation for this class was generated from the following files: