void SloughingCellKiller<DIM>::CheckAndLabelCellsForApoptosisOrDeath() { switch (DIM) { case 1: { for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin(); cell_iter != this->mpCellPopulation->End(); ++cell_iter) { double x = this->mpCellPopulation->GetLocationOfCellCentre(*cell_iter)[0]; if (x > mSloughHeight) { cell_iter->Kill(); } } break; } case 2: { for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin(); cell_iter != this->mpCellPopulation->End(); ++cell_iter) { c_vector<double, 2> location; location = this->mpCellPopulation->GetLocationOfCellCentre(*cell_iter); double x = location[0]; double y = location[1]; if ((y>mSloughHeight) || (mSloughSides && ((x<0.0) || (x>mSloughWidth)))) { cell_iter->Kill(); } } break; } case 3: { EXCEPTION("SloughingCellKiller is not yet implemented in 3D"); break; } default: // This can't happen NEVER_REACHED; } }
void PlaneBasedCellKiller<DIM>::CheckAndLabelCellsForApoptosisOrDeath() { for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin(); cell_iter != this->mpCellPopulation->End(); ++cell_iter) { c_vector<double, DIM> cell_location = this->mpCellPopulation->GetLocationOfCellCentre(*cell_iter); if (inner_prod(cell_location - mPointOnPlane, mNormalToPlane) > 0.0) { cell_iter->Kill(); } } }
void TimedPlaneBasedCellKiller<DIM>::CheckAndLabelCellsForApoptosisOrDeath() { for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin(); cell_iter != this->mpCellPopulation->End(); ++cell_iter) { c_vector<double, DIM> cell_location = this->mpCellPopulation->GetLocationOfCellCentre(*cell_iter); if (inner_prod(cell_location - mPointOnPlane, mNormalToPlane) > 0.0 && SimulationTime::Instance()->GetTime()>=mStartTime) { OUTPUT<<SimulationTime::Instance()->GetTime()<<" "<<(*cell_iter)->GetCellId()<<std::endl; cell_iter->Kill(); } } }
void IsolatedLabelledCellKiller<DIM>::CheckAndLabelCellsForApoptosisOrDeath() { MutableVertexMesh<DIM, DIM>& vertex_mesh = static_cast<VertexBasedCellPopulation<DIM>*>(this->mpCellPopulation)->rGetMesh(); unsigned num_labelled_cells = this->mpCellPopulation->GetCellPropertyRegistry()->template Get<CellLabel>()->GetCellCount(); // If there is more than one labelled cell... if (num_labelled_cells > 1) { // Iterate over cell population for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin(); cell_iter != this->mpCellPopulation->End(); ++cell_iter) { // Only consider cells with the CellLabel property if (cell_iter->template HasCellProperty<CellLabel>()) { // Get the element index corresponding to this cell unsigned elem_index = this->mpCellPopulation->GetLocationIndexUsingCell(*cell_iter); // Get the set of neighbouring element indices std::set<unsigned> neighbouring_elem_indices = vertex_mesh.GetNeighbouringElementIndices(elem_index); // Check if any of the corresponding cells have the CellLabel property... unsigned num_labelled_neighbours = 0; for (std::set<unsigned>::iterator elem_iter = neighbouring_elem_indices.begin(); elem_iter != neighbouring_elem_indices.end(); ++elem_iter) { if (this->mpCellPopulation->GetCellUsingLocationIndex(*elem_iter)->template HasCellProperty<CellLabel>()) { num_labelled_neighbours++; } } // ...and if none do, then kill this cell if (num_labelled_neighbours == 0) { cell_iter->Kill(); } } } } }