36 #include "VesselNetworkCellPopulationInteractor.hpp" 38 template<
unsigned DIM>
45 template<
unsigned DIM>
51 template<
unsigned DIM>
53 boost::shared_ptr<AbstractCellMutationState> pTipMutationState,
54 boost::shared_ptr<AbstractCellMutationState> pStalkState,
57 for (
typename AbstractCellPopulation<DIM>::Iterator cell_iter = rCellPopulation.Begin();cell_iter != rCellPopulation.End();++cell_iter)
60 boost::shared_ptr<VesselNode<DIM> > p_nearest_node =
mpNetwork->GetNearestNode(cell_location);
61 units::quantity<unit::length> node_distance = p_nearest_node->
GetDistance(cell_location);
62 std::pair<boost::shared_ptr<VesselSegment<DIM> >, units::quantity<unit::length> > segment_distance_pair =
mpNetwork->GetNearestSegment(cell_location);
63 if (segment_distance_pair.second < threshold * cellLengthScale || node_distance < threshold * cellLengthScale)
65 if(p_nearest_node->IsMigrating())
67 cell_iter->SetMutationState(pTipMutationState);
71 cell_iter->SetMutationState(pStalkState);
77 template<
unsigned DIM>
83 for (
typename AbstractCellPopulation<DIM>::Iterator cell_iter = rCellPopulation.Begin();cell_iter != rCellPopulation.End();++cell_iter)
86 boost::shared_ptr<VesselNode<DIM> > p_nearest_node =
mpNetwork->GetNearestNode(cell_location);
87 units::quantity<unit::length> node_distance = p_nearest_node->
GetDistance(cell_location);
89 std::pair<boost::shared_ptr<VesselSegment<DIM> >, units::quantity<unit::length> > segment_distance_pair =
mpNetwork->GetNearestSegment(cell_location);
90 if (segment_distance_pair.second < threshold*cellLengthScale || node_distance < threshold*cellLengthScale)
92 if (node_distance >= threshold*cellLengthScale)
94 boost::shared_ptr<Vessel<DIM> > pVessel = segment_distance_pair.first->GetVessel();
95 pVessel->DivideSegment(cell_location);
96 pVessel->UpdateNodes();
105 template<
unsigned DIM>
109 for (
typename AbstractCellPopulation<DIM>::Iterator cell_iter = rCellPopulation.Begin();cell_iter != rCellPopulation.End();++cell_iter)
112 boost::shared_ptr<VesselNode<DIM> > p_nearest_node =
mpNetwork->GetNearestNode(cell_location);
113 units::quantity<unit::length> node_distance = p_nearest_node->
GetDistance(cell_location);
115 std::pair<boost::shared_ptr<VesselSegment<DIM> >, units::quantity<unit::length> > segment_distance_pair =
mpNetwork->GetNearestSegment(cell_location);
116 if (segment_distance_pair.second > threshold*cellLengthScale and node_distance > threshold*cellLengthScale)
121 rCellPopulation.RemoveDeadCells();
124 template<
unsigned DIM>
128 for (
typename AbstractCellPopulation<DIM>::Iterator cell_iter = rCellPopulation.Begin();cell_iter != rCellPopulation.End();++cell_iter)
131 boost::shared_ptr<VesselNode<DIM> > p_nearest_node =
mpNetwork->GetNearestNode(cell_location);
132 units::quantity<unit::length> node_distance = p_nearest_node->
GetDistance(cell_location);
134 std::pair<boost::shared_ptr<VesselSegment<DIM> >, units::quantity<unit::length> > segment_distance_pair =
mpNetwork->GetNearestSegment(cell_location);
135 if (segment_distance_pair.second < threshold*cellLengthScale or node_distance < threshold*cellLengthScale)
140 rCellPopulation.RemoveDeadCells();
143 template<
unsigned DIM>
units::quantity< unit::length > GetDistance(const DimensionalChastePoint< DIM > &rLocation) const
virtual ~VesselNetworkCellPopulationInteractor()
void SetVesselNetwork(boost::shared_ptr< VesselNetwork< DIM > > pNetwork)
VesselNetworkCellPopulationInteractor()
void PartitionNetworkOverCells(AbstractCellPopulation< DIM > &rCellPopulation, units::quantity< unit::length > cellLengthScale, double threshold=1.25e-6)
void LabelVesselsInCellPopulation(AbstractCellPopulation< DIM > &cellPopulation, units::quantity< unit::length > cellLengthScale, boost::shared_ptr< AbstractCellMutationState > pTipMutationState, boost::shared_ptr< AbstractCellMutationState > pStalkState, double threshold=1.25e-6)
boost::shared_ptr< VesselNetwork< DIM > > mpNetwork
void KillNonVesselOverlappingCells(AbstractCellPopulation< DIM > &rCellPopulation, units::quantity< unit::length > cellLengthScale, double threshold=1.25e-6)
void KillOverlappingVesselCells(AbstractCellPopulation< DIM > &rCellPopulation, units::quantity< unit::length > cellLengthScale, double threshold=1.25e-6)