CardiacMeshDataset#
- class CardiacMeshDataset(mesh, mesh_numbers, timing_ms)[source]#
Cardiac mesh model assuming the continuous node-ordering:
[apex, n_points_per_ring(1st slice, 1st shell), n_points_per_ring(2st slice, 1st shell), …, n_points_per_ring(1st slice, 2nd shell)]
shell –> radial slice –> longitudinal
- Parameters:
Methods:
compute_cylinder_coords
(time_stamp)Computes cylinder coordinates (transmural_depth, polar_angle, z-pos) for all mesh nodes.
compute_local_basis
(time_stamp[, keys])Computes the local coordinate system (radial, circumferential, longitudinal) for a left ventricle mesh.
evaluate_cellsize
(points, connectivity)Evaluates cell centers and cell volumes for the tetra-mesh given as points and connectivity.
evaluate_connectivity
(n_theta, n_radial, ...)Generates connectivity for tetrahedral UnstructuredGrid in vtk format Inputs: - n_theta : number of points along circumferential contour (n points for each ring) - n_radial : number of points along longitudinal direction - n_layers : number of points along radial direction
- type positional_vectors:
from_list_of_arrays
(initial_mesh, ...[, ...])Loads a mesh and its displacements from a list of numpy files each containing the positional vectors for all points in initial_mesh.
from_list_of_meshes
(list_of_files, timing, ...)Loads vti/vtk files that contain the motion states of the same mesh, calculates the displacements from positional differences and returns a CardicMeshDataset instance containing the displacements
from_single_vtk
(file_name, mesh_numbers[, ...])Loads a vtk-file that contains the displacements
interpolate_mesh
(mesh_points[, ...])Function to linear interpolate points of LV meshes in circular, longitudinal and
refine
(longitudinal_factor, ...)Refines the cardiac mesh model assuming the continuous node-ordering:
Attributes:
(n_shells, n_points_per_ring, n_slices)
- compute_cylinder_coords(time_stamp)[source]#
Computes cylinder coordinates (transmural_depth, polar_angle, z-pos) for all mesh nodes.
- Parameters:
time_stamp (
Quantity
) – time Quantity used to determine reference mesh configuration
- compute_local_basis(time_stamp, keys=('e_t', 'e_c', 'e_l'))[source]#
Computes the local coordinate system (radial, circumferential, longitudinal) for a left ventricle mesh. The local basis vectors per point are stored with specified keys
- static evaluate_cellsize(points, connectivity)[source]#
Evaluates cell centers and cell volumes for the tetra-mesh given as points and connectivity.
- static evaluate_connectivity(n_theta, n_radial, n_layers)[source]#
Generates connectivity for tetrahedral UnstructuredGrid in vtk format Inputs:
n_theta : number of points along circumferential contour (n points for each ring)
n_radial : number of points along longitudinal direction
n_layers : number of points along radial direction
- Outputs:
connectivity : connectivity array where row i contains the vertex id of points
defining tetrahedron with index i
Dr. Buoso Stefano (2020) email: buoso@biomed.ee.ethz
- classmethod from_list_of_arrays(initial_mesh, mesh_numbers, list_of_files, timing, time_precision_ms=1)[source]#
Loads a mesh and its displacements from a list of numpy files each containing the positional vectors for all points in initial_mesh.
- Raises:
FileNotFoundError - if not all files in given list of files exist
- Parameters:
- classmethod from_list_of_meshes(list_of_files, timing, mesh_numbers, field_key='displacement', time_precision_ms=1)[source]#
Loads vti/vtk files that contain the motion states of the same mesh, calculates the displacements from positional differences and returns a CardicMeshDataset instance containing the displacements
- Raises:
FileNotFoundError - if not all files in given list of files exist
- Parameters:
list_of_files (
List
) – List of .vtk or .vti files each containing a mesh in which the displacement vectors for each node is stored under the name of specified by the argument field_keytiming (
Quantity
) –field_key (
str
) – key to extracttime_precision_ms (
int
) – number of decimals used in the field name and timepoints (e.g. displacements_0.01ms)
- Return type:
- classmethod from_single_vtk(file_name, mesh_numbers, time_precision_ms=3)[source]#
Loads a vtk-file that contains the displacements
- static interpolate_mesh(mesh_points, points_per_ring=40, n_shells=4, n_slices=30, interp_factor_c=1, interp_factor_l=1, interp_factor_r=1)[source]#
- Function to linear interpolate points of LV meshes in circular, longitudinal and
- radial direction. Indexing of the points is assumed to adhere to the following structure:
0th element -> Apex 1:points_per_ring+1 -> inner most shell most apical slice. Repeated for n_slices. Repeated for n_shells.
- Parameters:
mesh_points (
ndarray
) – np.ndarray - (-1, 3) Flattened array of 3D positional vectors of mesh points.points_per_ring (
int
) – (int) number of points per ring (circumferential direction)n_shells (
int
) – (int) number of shells (radial direction)n_slices (
int
) – (int) number of slices (longitudinal direction)interp_factor_c (
int
) – (int) interpolation multiplier for circumferential directioninterp_factor_l (
int
) – (int) interpolation multiplier for longitudinal directioninterp_factor_r (
int
) – (int) interpolation multiplier for radial direction
- Return type:
- Returns:
np.ndarray - (n_shell_new, 1 + (n_theta_new*n_slices_new), 3), (n_theta_new, n_slices_new, n_shells_new)
- refine(longitudinal_factor, circumferential_factor, radial_factor)[source]#
Refines the cardiac mesh model assuming the continuous node-ordering:
[apex, n_points_per_ring(1st slice, 1st shell), n_points_per_ring(2st slice, 1st shell), …, n_points_per_ring(1st slice, 2nd shell)]
shell –> radial slice –> longitudinal
- Parameters:
- Return type:
- Returns:
New CardiacMeshDataset instance with refined mesh and new in