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
-
static
tyssue.geometry.bulk_geometry module¶
-
class
tyssue.geometry.bulk_geometry.
BulkGeometry
[source]¶ Bases:
tyssue.geometry.sheet_geometry.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
-
classmethod
-
class
tyssue.geometry.bulk_geometry.
ClosedMonolayerGeometry
[source]¶ Bases:
tyssue.geometry.bulk_geometry.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)
-
classmethod
-
class
tyssue.geometry.bulk_geometry.
MonolayerGeometry
[source]¶
tyssue.geometry.multisheetgeometry module¶
tyssue.geometry.planar_geometry module¶
-
class
tyssue.geometry.planar_geometry.
AnnularGeometry
[source]¶
-
class
tyssue.geometry.planar_geometry.
PlanarGeometry
[source]¶ Bases:
tyssue.geometry.base_geometry.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
-
static
tyssue.geometry.sheet_geometry module¶
-
class
tyssue.geometry.sheet_geometry.
ClosedSheetGeometry
[source]¶ Bases:
tyssue.geometry.sheet_geometry.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:
tyssue.geometry.sheet_geometry.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’]
-
static
-
class
tyssue.geometry.sheet_geometry.
SheetGeometry
[source]¶ Bases:
tyssue.geometry.planar_geometry.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')[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.
-
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)[source]¶ Returns the (sheet.Ne, 3, 3) array of rotation matrices such that each rotation aligns the coordinate system along each face normals
-
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)[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
-
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’]
-
static
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