ConductionPath#

class ansys.health.heart.pre.conduction_path.ConductionPath(name: ConductionPathType, mesh: ansys.health.heart.objects.Mesh, id: int, is_connected: numpy.ndarray, relying_surface: pyvista.PolyData, material: ansys.health.heart.settings.material.ep_material.EPMaterial = EPMaterial.DummyMaterial(), up_path: ConductionPath | None = None, down_path: ConductionPath | None = None)#

Conduction path class.

Overview#

get_terminal_nodes

Get the terminal nodes of the conduction path.

get_terminal_coordinates

Get the nodal coordinates of the terminal nodes.

plot

Plot the conduction path with its underlying surface.

add_pmj_path

Add Purkinje-Myocardial Junction branches to the current conduction path.

up_path

Get upstream conduction path.

down_path

Get downstream conduction path.

length

Length of the conduction path.

create_from_keypoints

Create a conduction path on a base mesh through a set of keypoints.

create_from_k_file

Build conduction path from LS-DYNA k-file.

Import detail#

from ansys.health.heart.pre.conduction_path import ConductionPath

Property detail#

property ConductionPath.up_path: ConductionPath | None#

Get upstream conduction path.

property ConductionPath.down_path: ConductionPath | None#

Get downstream conduction path.

property ConductionPath.length#

Length of the conduction path.

Attribute detail#

ConductionPath.name#
ConductionPath.mesh#
ConductionPath.id#
ConductionPath.is_connected#
ConductionPath.relying_surface#
ConductionPath.ep_material#

Method detail#

ConductionPath.get_terminal_nodes() numpy.ndarray#

Get the terminal nodes of the conduction path.

Returns:
np.ndarray

Array of terminal node indices.

Notes

The terminal nodes are the points that are referenced only once in the line segments.

ConductionPath.get_terminal_coordinates() numpy.ndarray#

Get the nodal coordinates of the terminal nodes.

Returns:
np.ndarray

Nx3 array with the coordinates of the terminal nodes.

ConductionPath.plot(show_plotter: bool = True) pyvista.Plotter | None#

Plot the conduction path with its underlying surface.

This method creates a PyVista plotter, adds the relying surface (in semi-transparent white) and the conduction path (as a line), and either shows the plot or returns the plotter for further customization.

Parameters:
show_plotterbool, default: True

If True, immediately show the plot window. If False, return the plotter object for further modification (e.g., adding more meshes).

Returns:
plotterpyvista.Plotter or None

The PyVista plotter object if show_plotter is False, otherwise None.

Examples

>>> plotter = conduction_path.plot(show_plotter=False)
>>> plotter.add_mesh(other_mesh, color="red")
>>> plotter.show()
ConductionPath.add_pmj_path(pmj_list: list[int], merge_with: Literal['node', 'cell'] = 'cell') ConductionPath#

Add Purkinje-Myocardial Junction branches to the current conduction path.

Parameters:
pmj_listlist[int]

Indices of points to create a Purkinje-Myocardial Junction.

merge_withLiteral[‘node’,’cell’], default: ‘cell’

Whether to merge with a neighbor node (1 split) or cell (3 splits).

Returns:
ConductionPath

The updated conduction path.

Notes

PMJ resistance is controlled by pmjres in *EM_EP_PURKINJE_NETWORK2.

static ConductionPath.create_from_keypoints(name: ConductionPathType, keypoints: list[numpy.ndarray], id: int, base_mesh: pyvista.PolyData | pyvista.UnstructuredGrid, connection: Literal['first'] | None = None, line_length: float | None = 1.5, center: bool = False) ConductionPath#

Create a conduction path on a base mesh through a set of keypoints.

Parameters:
nameConductionPathType

Name of the conduction path.

keypointslist[np.ndarray]

Keypoints used to construct the path on the base mesh.

idint

ID of the conduction path.

base_meshpv.PolyData | pv.UnstructuredGrid

Base mesh where the conduction path is created. If PolyData, the result is a geodesic path on the surface. If pv.UnstructuredGrid, the result is the shortest path in the solid.

connectionLiteral[“first”] | None, default: None

If “first”, the first point of the path is marked as connected to the solid mesh. If None, no points are marked as connected.

line_lengthfloat | None, default: 1.5

Length of the line element in case of refinement.

centerbool, default: False

Whether to use a geodesic path through the centers of the surface cells. Length of the line element in case of refinement.

centerbool, default: False

If True, the geodesic path passes through the centers of the surface cells.

Returns:
ConductionPath

The created conduction path.

Notes

To add PMJ (Purkinje-Myocardial Junction) points, use the add_pmj_path() method after creating the path.

static ConductionPath.create_from_k_file(name: ConductionPathType, k_file: str, id: int, base_mesh: pyvista.PolyData, model, merge_apex: bool = True) ConductionPath#

Build conduction path from LS-DYNA k-file.

Parameters:
nameConductionPathType

Conduction path name.

k_filestr

Path to LS-DYNA k-file.

idint

ID of the conduction path.

base_meshpv.PolyData

Surface mesh that the conduction path is relying on.

modelHeartModel

HeartModel object.

merge_apexbool, default: True

Whether to merge the apex node with the solid mesh.

Returns:
ConductionPath

Conduction path.