tyssue.geometry package#
Submodules#
tyssue.geometry.base_geometry module#
- class tyssue.geometry.base_geometry.BaseGeometry[source]#
Bases:
object
- static center(eptm)[source]#
Transates the epithelium vertices so that the center of mass is at the center of the coordinate system, and updates the geometry
- static dist_to_point(vert_df, point, coords)[source]#
Returns the distance of all vertices from point over the coordinates
- Parameters
vert_df (a
pandas.DataFrame
with the points coordinates) – in the columns given by the coords argumentpoint (a doublet (in 2D) or triplet (in 3D) giving the reference point) – coordinates
coords (list of 2 or 3 strings giving the column names) –
- Returns
distance – as the input vert_df
- Return type
a
pandas.Series
with the same length
- static update_centroid(sheet)[source]#
Updates the face_df coords columns as the face’s vertices center of mass. Also updates the edge_df fx, fy, fz columns with their upcasted values
tyssue.geometry.bulk_geometry module#
- class tyssue.geometry.bulk_geometry.BulkGeometry[source]#
Bases:
SheetGeometry
Geometry functions for 3D cell arangements
- classmethod update_all(eptm)[source]#
Updates the eptm geometry by updating: * the edge vector coordinates * the edge lengths * the face centroids * the normals to each edge associated face * the face areas * the cell areas * the vertices heights (depends on geometry) * the face volumes (depends on geometry)
- static update_centroid(eptm)[source]#
Updates the face_df coords columns as the face’s vertices center of mass. Also updates the edge_df fx, fy, fz columns with their upcasted values
- class tyssue.geometry.bulk_geometry.ClosedMonolayerGeometry[source]#
Bases:
MonolayerGeometry
- classmethod update_all(eptm)[source]#
Updates the eptm geometry by updating: * the edge vector coordinates * the edge lengths * the face centroids * the normals to each edge associated face * the face areas * the cell areas * the vertices heights (depends on geometry) * the face volumes (depends on geometry)
- class tyssue.geometry.bulk_geometry.MonoLayerGeometry[source]#
Bases:
MonolayerGeometry
- class tyssue.geometry.bulk_geometry.MonolayerGeometry[source]#
Bases:
RNRGeometry
- class tyssue.geometry.bulk_geometry.RNRGeometry[source]#
Bases:
BulkGeometry
tyssue.geometry.multisheetgeometry module#
tyssue.geometry.planar_geometry module#
- class tyssue.geometry.planar_geometry.AnnularGeometry[source]#
Bases:
PlanarGeometry
- class tyssue.geometry.planar_geometry.PlanarGeometry[source]#
Bases:
BaseGeometry
Geomtetry methods for 2D planar cell arangements
- static face_projected_pos(sheet, face, psi)[source]#
returns the sheet vertices position translated to center the face face at (0, 0) and rotated in the (x, y) plane by and angle psi radians
- class tyssue.geometry.planar_geometry.WeightedPerimeterPlanarGeometry[source]#
Bases:
PlanarGeometry
Geometry methods for 2D planar cell arangements with a calculation of perimeter is based on weight of each junction.
Meaning if all junction of a cell have the same weight, perimeter is calculated as a usual perimeter calculation: .. math:
p = \sum_{ij} l_{ij}
Otherwise, weight parameter allowed more or less importance of a junction in the perimeter calculation .. math:
p = \sum_{ij} w_{ij} \, l_{ij}
- static normalize_weights(sheet)[source]#
Normalize weight of each cell. Sum of all weights of one cell equals to one.
tyssue.geometry.sheet_geometry module#
- class tyssue.geometry.sheet_geometry.ClosedSheetGeometry[source]#
Bases:
SheetGeometry
Geometry for a closed 2.5D sheet.
Apart from the geometry update from a normal sheet, the enclosed volume is also computed. The value is stored in sheet.settings[“lumen_vol”]
- class tyssue.geometry.sheet_geometry.EllipsoidGeometry[source]#
Bases:
ClosedSheetGeometry
- static update_height(eptm)[source]#
Update the height of the sheet vertices, based on the geometry specified in the sheet settings:
sheet.settings[‘geometry’] can be set to
- cylindrical: the vertex height is
measured with respect to the distance to the the axis specified in sheet.settings[‘height_axis’] (e.g z)
- flat: the vertex height is
measured with respect to the position on the axis specified in sheet.settings[‘height_axis’]
- ‘spherical’: the vertex height is measured with respect to its
distance to the coordinate system centers
- ‘rod’: the vertex height is measured with respect to its
distance to the coordinate height axis if between the focii, and from the closest focus otherwise. The focii positions are updated before the height update.
In all the cases, this distance is shifted by an amount of sheet.vert_df[‘basal_shift’]
- class tyssue.geometry.sheet_geometry.MidlineBoundaryGeometry[source]#
Bases:
ClosedSheetGeometry
- class tyssue.geometry.sheet_geometry.SheetGeometry[source]#
Bases:
PlanarGeometry
Geometry definitions for 2D sheets in 3D
- static face_projected_pos(sheet, face, psi=0)[source]#
Returns the position of a face vertices projected on a plane perpendicular to the face normal, and translated so that the face center is at the center of the coordinate system
- Parameters
sheet (a :class:Sheet object) –
face (int,) – the index of the face on which to rotate the sheet
psi (float,) – Optional angle giving the rotation along the z axis
- Returns
rot_pos – The rotated, relative positions of the face’s vertices
- Return type
pd.DataFrame
- static face_rotation(sheet, face, psi=0)[source]#
Returns a 3D rotation matrix such that the face normal points in the z axis
- Parameters
sheet (a :class:Sheet object) –
face (int,) – the index of the face on which to rotate the sheet
psi (float,) – Optional angle giving the rotation along the new z axis
- Returns
rotation – The rotation matrix
- Return type
(3, 3) np.ndarray
- classmethod face_rotations(sheet, method='normal', output_as='edge')[source]#
Returns the (sheet.Ne, 3, 3) array of rotation matrices such that each rotation returns a coordinate system (u, v, w) where the face vertices are mostly in the u, v plane.
If method is ‘normal’, face is oriented with it’s normal along w if method is ‘svd’, the u, v, w is determined through singular value decompostion of the face vertices relative positions.
svd is slower but more effective at reducing face dimensionality.
- Parameters
output_as (string, default 'edge' Return the (sheet.Ne, 3, 3),) – else ‘face’ Return the (sheet.Nf, 3, 3)
- classmethod get_phis(sheet, method='normal')[source]#
Returns the angle of the vertices in the plane perpendicular to each face normal. For not-too-deformed faces, sorting vertices by this gives clockwize orientation.
I think not-too-deformed means starconvex here.
The ‘method’ argument is passed to face_rotations
- static normal_rotations(sheet, output_as='edge')[source]#
Returns the (sheet.Ne, 3, 3) array of rotation matrices such that each rotation aligns the coordinate system along each face normals
- Parameters
output_as (string, default 'edge' Return the (sheet.Ne, 3, 3),) – else ‘face’ Return the (sheet.Nf, 3, 3)
- classmethod reset_scafold(sheet)[source]#
Re-centers and (in the case of a rod sheet) resets the a-b parameters and tip masks
- static svd_rotations(sheet, output_as='edge')[source]#
Returns the (sheet.Ne, 3, 3) array of rotation matrices such that each rotation aligns the coordinate system according to each face vertex SVD
- Parameters
output_as (string, default 'edge' Return the (sheet.Ne, 3, 3),) – else ‘face’ Return the (sheet.Nf, 3, 3)
- classmethod update_all(sheet)[source]#
Updates the sheet geometry by updating: * the edge vector coordinates * the edge lengths * the face centroids * the normals to each edge associated face * the face areas * the vertices heights (depends on geometry) * the face volumes (depends on geometry)
- classmethod update_height(sheet)[source]#
Update the height of the sheet vertices, based on the geometry specified in the sheet settings:
sheet.settings[‘geometry’] can be set to
- cylindrical: the vertex height is
measured with respect to the distance to the the axis specified in sheet.settings[‘height_axis’] (e.g z)
- flat: the vertex height is
measured with respect to the position on the axis specified in sheet.settings[‘height_axis’]
- ‘spherical’: the vertex height is measured with respect to its
distance to the coordinate system centers
- ‘rod’: the vertex height is measured with respect to its
distance to the coordinate height axis if between the focii, and from the closest focus otherwise. The focii positions are updated before the height update.
In all the cases, this distance is shifted by an amount of sheet.vert_df[‘basal_shift’]
- class tyssue.geometry.sheet_geometry.WeightedPerimeterEllipsoidLameGeometry[source]#
Bases:
ClosedSheetGeometry
EllipsoidLameGeometry correspond to a super-egg geometry with a calculation of perimeter is based on weight of each junction.
Meaning if all junction of a cell have the same weight, perimeter is calculated as a usual perimeter calculation .. math:
p = \sum l_{ij}
Otherwise, weight parameter allowed more or less importance of a junction in the perimeter calculation .. math:
p = \sum w_{ij} \, l_{ij}
In this geometry, a sphere surrounding the tissue, meaning a force is apply only at the extremity of the tissue; eptm.vert_df[‘delta_rho’] is computed as the difference between the vertex radius in a spherical frame of reference and eptm.settings[‘barrier_radius’]
- static normalize_weights(sheet)[source]#
Normalize weight of each cell. Sum of all weights of one cell equals to one.
- classmethod update_all(eptm)[source]#
Updates the sheet geometry by updating: * the edge vector coordinates * the edge lengths * the face centroids * the normals to each edge associated face * the face areas * the vertices heights (depends on geometry) * the face volumes (depends on geometry)
- static update_height(eptm)[source]#
Update the height of the sheet vertices, based on the geometry specified in the sheet settings:
sheet.settings[‘geometry’] can be set to
- cylindrical: the vertex height is
measured with respect to the distance to the the axis specified in sheet.settings[‘height_axis’] (e.g z)
- flat: the vertex height is
measured with respect to the position on the axis specified in sheet.settings[‘height_axis’]
- ‘spherical’: the vertex height is measured with respect to its
distance to the coordinate system centers
- ‘rod’: the vertex height is measured with respect to its
distance to the coordinate height axis if between the focii, and from the closest focus otherwise. The focii positions are updated before the height update.
In all the cases, this distance is shifted by an amount of sheet.vert_df[‘basal_shift’]
tyssue.geometry.utils module#
- tyssue.geometry.utils.rotation_matrices(angle, direction)[source]#
Return an (N, 3, 3) array of rotation matrices along N angles and N directions
- Parameters
angle (np.ndarray of shape (N,)) – array of rotation angles
directions (np.ndarray of shape (N, 3)) – array of rotation vectors
- Returns
rots – the array of rotation matrices
- Return type
np.ndarray of shape (N, 3, 3)
- tyssue.geometry.utils.rotation_matrix(angle, direction)[source]#
Returns the 3X3 rotation matrix around direction by angle
adapted from http://www.lfd.uci.edu/~gohlke/code/transformations.py.html