tissue Namespace Reference

The tissue module handle cell division in a cell tissue. More...

Classes

struct  CellPinchingParams
 Parameters of the cell pinching algorithm. More...
struct  ClosestMidAlgoParams
 Parameters for the closest mid. More...
struct  ClosestWallAlgoParams
 Parameters for the closest wall algorithm. More...
struct  ShortWallAlgoParams
 Parameters for the shortest wall algorithm. More...
class  Tissue
 Class handling the development and representation of a cell tissue. More...

Typedefs

typedef Tissue::cell_graph cell_graph
 Documentation alias for the type of the cell graph.
typedef Tissue::tissue_graph tissue_graph
 Documentation alias for the type of the tissue graph.
typedef Tissue::vertex vertex
 Documentation alias for the type of a graph vertex.

Enumerations

enum  CELL_DIVISION_ALGORITHM { CLOSEST_MID, SHORT_WALL, CLOSEST_WALL }
 

Enumeration of the provided division algorithms.

More...

Functions

template<class Complex >
void cellPinching (const typename Complex::cell &c, Complex &T, DivisionData< typename Complex::junction_content > &data, const CellPinchingParams &params)
 Pinching algorithm.
template<class Complex >
DivisionData< typename
Complex::junction_content > 
findDivisionPoints (const typename Complex::cell &c, Complex &T, const ClosestWallAlgoParams &params)
 Implementation of the closest wall algorithm.
template<class Complex >
DivisionData< typename
Complex::junction_content > 
findDivisionPoints (const typename Complex::cell &c, Complex &T, const ClosestMidAlgoParams &params)
 Implementation of the closest mid algorithm.
template<class Complex >
DivisionData< typename
Complex::junction_content > 
findDivisionPoints (const typename Complex::cell &c, Complex &T, const ShortWallAlgoParams &params)
 Implementation of the shortest wall algorithm.

Detailed Description

The tissue module handle cell division in a cell tissue.

Compared to the 2d cell complex module, this module provides:


Typedef Documentation

Documentation alias for the type of the cell graph.

Definition at line 63 of file tissue.h.

typedef Tissue::tissue_graph tissue::tissue_graph

Documentation alias for the type of the tissue graph.

Definition at line 67 of file tissue.h.

typedef Tissue::vertex tissue::vertex

Documentation alias for the type of a graph vertex.

Definition at line 59 of file tissue.h.


Enumeration Type Documentation

Enumeration of the provided division algorithms.

Definition at line 48 of file tissue.h.

00049   {
00050     CLOSEST_MID,
00051     SHORT_WALL,
00052     CLOSEST_WALL
00053   };


Function Documentation

template<class Complex >
void tissue::cellPinching ( const typename Complex::cell &  c,
Complex &  T,
DivisionData< typename Complex::junction_content > &  data,
const CellPinchingParams &  params 
) [inline]

Pinching algorithm.

This function displace the position of the newly inserted vertexes to account for the pinching of the cell. The pinching is always in the direction of the newly formed wall. A vertex on the side of the tissue won't be moved. Otherwise, the pinching is proportional to the distance to the closest extremity of the cut segment.

Parameters:
[in] c Cell to be divided
[in] S Tissue graph
[in,out] data Parameters for the division to be updated
[in] params Parameters for the pinching
[in] model Model using the algorithm

Definition at line 117 of file tissue.h.

References tissue::CellPinchingParams::cellMaxPinch, tissue::CellPinchingParams::cellPinch, vvcomplex::DivisionData< JunctionContent >::pu, vvcomplex::DivisionData< JunctionContent >::pv, vvcomplex::DivisionData< JunctionContent >::u1, and vvcomplex::DivisionData< JunctionContent >::v1.

Referenced by findDivisionPoints(), and cell_system::findDivisionPoints().

00121   {
00122     typedef typename Complex::cell cell;
00123     typedef typename Complex::junction junction;
00124     typename Complex::model_t& model = *T.model;
00125     // Calculate cell pinch
00126     double mind = 0.0;
00127     double pinch = 0.0;
00128 
00129     junction p_u1 = data.u1;
00130     junction p_u2 = T.S.nextTo(c, p_u1);
00131 
00132     junction p_v1 = data.v1;
00133     junction p_v2 = T.S.nextTo(c, p_v1);
00134 
00135     Point3d u1 = model.position(p_u1);
00136     Point3d u2 = model.position(p_u2);
00137 
00138     // If on edge, don't pinch
00139     if(!T.border(p_u1, p_u2))
00140     {
00141       Point3d uc = (data.pv - data.pu);
00142       double ucl = norm(uc);
00143       uc /= ucl;
00144       double uu1 = norm(data.pu-u1);
00145       double uu2 = norm(data.pu-u2);
00146       if(uu1 > uu2)
00147         mind = uu2;
00148       else
00149         mind = uu1;
00150       pinch = mind * ucl * params.cellPinch;
00151       if(pinch > params.cellMaxPinch)
00152         pinch = params.cellMaxPinch;
00153       data.pu += uc * pinch;
00154     }
00155 
00156     Point3d v1 = model.position(p_v1);
00157     Point3d v2 = model.position(p_v2);
00158 
00159     if(!T.border(p_v1, p_v2))
00160     {
00161       Point3d vc = (data.pu - data.pv);
00162       double vcl = norm(vc);
00163       vc /= vcl;
00164       double vv1 = norm(data.pv-v1);
00165       double vv2 = norm(data.pv-v2);
00166       if(vv1 > vv2)
00167         mind = vv2;
00168       else
00169         mind = vv1;
00170       pinch = mind * vcl * params.cellPinch;
00171       if(pinch > params.cellMaxPinch)
00172         pinch = params.cellMaxPinch;
00173       data.pv += vc * pinch;
00174     }
00175   }

template<class Complex >
DivisionData<typename Complex::junction_content> tissue::findDivisionPoints ( const typename Complex::cell &  c,
Complex &  T,
const ClosestWallAlgoParams &  params 
) [inline]

Implementation of the closest wall algorithm.

This algorithm defining the new wall as the one starting from the point on the walls the closest to the cell center and going through the cell center.

Parameters:
c Cell to divide
S Tissue graph
params Parameters
model Model using the tissue
Returns:
The parameters for the division
See also:
ClosestWallAlgoParams

Definition at line 459 of file tissue.h.

References cellPinching(), tissue::ClosestWallAlgoParams::cellWallMin, bspline_tissue_model::epsilon, vvcomplex::FindOppositeWall(), forall, IMPORT_COMPLEX_MODEL, IMPORT_COMPLEX_VERTICES, vvcomplex::DivisionData< JunctionContent >::pu, tissue::ClosestWallAlgoParams::strictCellWallMin, vvcomplex::testDivisionOnVertices(), and vvcomplex::DivisionData< JunctionContent >::u1.

00462   {
00463     IMPORT_COMPLEX_VERTICES(Complex);
00464     IMPORT_COMPLEX_MODEL(Complex, T);
00465     DivisionData<typename Complex::junction_content> result;
00466     // p_u1-u2, first edge, p_v1-v2 opposite edge
00467     Point3d cpos = model.position(c);
00468 
00469     // Find center (in case growth has changed it)
00470     //FindCenter(c, S, model);
00471 
00472     // Find closest point on wall
00473     double mindis = 1000000;
00474     double epsilon = 0;
00475     forall( const junction& tu2, T.S.neighbors(c))
00476     {
00477       const junction& tu1 = T.S.prevTo(c, tu2);
00478       Point3d u1 = model.position(tu1);
00479       Point3d u2 = model.position(tu2);
00480       Point3d u1u2 = u2 - u1;
00481       double u1u2l = norm(u1u2);
00482       u1u2 /= u1u2l;
00483       epsilon = max(epsilon, VVE_REL_EPSILON*u1u2l);
00484       Point3d u = u1 + ((cpos - u1) * u1u2) * u1u2;
00485       if(FindWallMin(u, u1, u2, params.cellWallMin) or not params.strictCellWallMin)
00486       {
00487         double dis = norm(u-cpos);
00488         if(dis < mindis)
00489         {
00490           mindis = dis;
00491           result.pu = u;
00492           result.u1 = tu1;
00493         }
00494       }
00495     }
00496 
00497     FindOppositeWall(c, result, T, params.cellWallMin, params.strictCellWallMin);
00498 
00499     if(params.cellWallMin == 0)
00500       testDivisionOnVertices(c, result, T, epsilon);
00501 
00502     cellPinching(c, T, result, params);
00503     return result;
00504   }

template<class Complex >
DivisionData<typename Complex::junction_content> tissue::findDivisionPoints ( const typename Complex::cell &  c,
Complex &  T,
const ClosestMidAlgoParams &  params 
) [inline]

Implementation of the closest mid algorithm.

This algorithm defining the new wall as the one starting from the mid wall the closest to the cell center and going through the cell center.

Parameters:
c Cell to divide
S Tissue graph
params Parameters
model Model using the tissue
Returns:
The parameters for the division
See also:
ClosestMidAlgoParams

Definition at line 406 of file tissue.h.

References cellPinching(), tissue::ClosestMidAlgoParams::cellWallMin, vvcomplex::FindOppositeWall(), forall, IMPORT_COMPLEX_MODEL, IMPORT_COMPLEX_VERTICES, vvcomplex::DivisionData< JunctionContent >::pu, tissue::ClosestMidAlgoParams::strictCellWallMin, and vvcomplex::DivisionData< JunctionContent >::u1.

00409   {
00410     IMPORT_COMPLEX_VERTICES(Complex);
00411     IMPORT_COMPLEX_MODEL(Complex, T);
00412     DivisionData<typename Complex::junction_content> result;
00413     // p_u1-u2, first edge, p_v1-v2 opposite edge
00414     Point3d cpos = model.position(c);
00415 
00416     // Find center (in case growth has changed it)
00417     //FindCenter(c, S, model);
00418 
00419     // Find closest midpoint on wall
00420     double mindis = HUGE_VAL;
00421     forall(const junction& tu2, T.S.neighbors(c))
00422     {
00423       // other end of wall
00424       const junction& tu1 = T.S.prevTo(c, tu2);
00425       Point3d u1 = model.position(tu1);
00426       Point3d u2 = model.position(tu2);
00427       Point3d u = (u1 + u2)/2.0;
00428       double dis = norm(u-cpos);
00429       if(dis < mindis)
00430       {
00431         mindis = dis;
00432         result.pu = u;
00433         result.u1 = tu1;
00434       }
00435     }
00436 
00437     FindOppositeWall(c, result, T, params.cellWallMin, params.strictCellWallMin);
00438 
00439     cellPinching(c, T, result, params);
00440     return result;
00441   }

template<class Complex >
DivisionData<typename Complex::junction_content> tissue::findDivisionPoints ( const typename Complex::cell &  c,
Complex &  T,
const ShortWallAlgoParams &  params 
) [inline]

Implementation of the shortest wall algorithm.

This algorithm search for the shortest segment traversing the cell and going through the cell center.

Parameters:
c Cell to divide
S Tissue graph
params Parameters
model Model using the tissue
Returns:
The parameters for the division
See also:
ShortWallAlgoParams

Definition at line 307 of file tissue.h.

References cellPinching(), tissue::ShortWallAlgoParams::cellWallMin, tissue::ShortWallAlgoParams::cellWallSample, tissue::ShortWallAlgoParams::dx, bspline_tissue_model::epsilon, forall, IMPORT_COMPLEX_MODEL, IMPORT_COMPLEX_VERTICES, geometry::planeLineIntersection(), vvcomplex::DivisionData< JunctionContent >::pu, vvcomplex::DivisionData< JunctionContent >::pv, tissue::ShortWallAlgoParams::strictCellWallMin, vvcomplex::testDivisionOnVertices(), vvcomplex::DivisionData< JunctionContent >::u1, and vvcomplex::DivisionData< JunctionContent >::v1.

00310   {
00311     IMPORT_COMPLEX_VERTICES(Complex);
00312     IMPORT_COMPLEX_MODEL(Complex, T);
00313     DivisionData<typename Complex::junction_content> result;
00314     // p_u1-u2, first edge, p_v1-v2 opposite edge
00315     Point3d minu, minv;
00316 
00317     // Find center (in case growth has changed it)
00318     //FindCenter(c, S, model);
00319 
00320     Point3d cpos = model.position(c);
00321 
00322     // Find shortest line through center
00323     double mindis = HUGE_VAL;
00324     Point3d n;
00325     n = model.normal(c);
00326     double epsilon = 0;
00327     forall(const junction& tu1, T.S.neighbors(c))
00328     {
00329       const junction& tu2 = T.S.nextTo(c, tu1);
00330       Point3d u1 = model.position(tu1);
00331       Point3d u2 = model.position(tu2);
00332       Point3d u1u2 = u2 - u1;
00333       double u1u2l = norm(u1u2);
00334       u1u2 /= u1u2l;
00335       epsilon = max(epsilon, VVE_REL_EPSILON*u1u2l);
00336       forall(const junction& tv1, T.S.neighbors(c))
00337       {
00338         if(tv1 == tu1)
00339         {
00340           continue;
00341         }
00342         const junction& tv2 = T.S.nextTo(c, tv1);
00343         const Point3d& v1 = model.position(tv1);
00344         const Point3d& v2 = model.position(tv2);
00345 
00346         double ule = u1u2l - params.cellWallMin;
00347         for(double ul = params.cellWallMin; ul < ule; ul += params.cellWallSample) 
00348         {
00349           Point3d u = u1 + ul * u1u2;
00350           Point3d uc = cpos - u;
00351           Point3d nu = n^uc;
00352           Point3d v;
00353           double s;
00354           if(geometry::planeLineIntersection(v, s, u, nu, v1, v2))
00355           {
00356             if(s >= -params.dx  && s <= (1.0 + params.dx))
00357             {
00358               if(FindWallMin(v, v1, v2, params.cellWallMin) or not params.strictCellWallMin)
00359               {
00360                 double dis = norm(u-v);
00361                 if(dis < mindis and (u-cpos)*(v-cpos) < 0)
00362                 {
00363                   mindis = dis;
00364                   minu = u;
00365                   minv = v;
00366                   result.u1 = tu1;
00367                   result.v1 = tv1;
00368                 }
00369               }
00370             }
00371           }
00372         } // Samples
00373       } // v1v2
00374     } // u1u2
00375     if(mindis == HUGE_VAL)
00376     {
00377       util::out << "findDivisionPoints::Error:Failed to find divide line" << endl;
00378       return DivisionData<typename Complex::junction_content>();
00379     }
00380     result.pu = minu;
00381     result.pv = minv;
00382 
00383     if(params.cellWallMin == 0)
00384       testDivisionOnVertices(c, result, T, epsilon);
00385 
00386     cellPinching(c, T, result, params);
00387     return result;
00388   }

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:19 2013 for VVE by  doxygen 1.6.3