The landmark_utils.py module#

Summary#

compute_anatomy_axis

Compute the long and short axes of the left ventricle.

compute_aha17_points

Compute 26 AHA17 landmark points on the left ventricle surface.

compute_aha17_lines

Compute AHA 17 segment horizontal and vertical lines.

compute_aha17

Compute the AHA17 label for left ventricle elements.

compute_element_cs

Compute elemental coordinate system for AHA elements.

Description#

Module for computing heart anatomical landmarks.

This module provides utilities for computing heart anatomical landmarks including:

  • Long and short axes of the left ventricle

  • AHA17 segment landmarks and segmentation

  • Coordinate systems for strain calculations

Module detail#

landmark_utils.compute_anatomy_axis(mv_center: numpy.ndarray, av_center: numpy.ndarray, apex: numpy.ndarray, first_cut_short_axis: float = 0.2) tuple[dict, dict, dict]#

Compute the long and short axes of the left ventricle.

Parameters:
mv_centernp.ndarray

Mitral valve center.

av_centernp.ndarray

Aortic valve center.

apexnp.ndarray

Left ventricle epicardium apex point.

first_cut_short_axisfloat, default: 0.2

Relative distance between the mitral valve center and apex, which is used for defining the center of the short axis.

Returns:
tuple[dict, dict, dict]

4CV, 2CV, and short-axis. Each dictionary contains center and normal.

landmark_utils.compute_aha17_points(model: ansys.health.heart.models.HeartModel, short_axis: dict, long_axis: dict, surface: pyvista.PolyData = None) list[numpy.ndarray]#

Compute 26 AHA17 landmark points on the left ventricle surface.

The AHA17 landmark points define the geometry for the 17-segment model of the left ventricle. These 26 points are distributed across three levels (basal, mid, apical) and are located at specific angular positions around the circumference.

Segment layout diagram:

P1---H1---P2---H2---P3----H3--P4---H4---P5---H5---P6---H6---P1
|          |         |         |         |         |         |
|          |         |         |         |         |         |
V1   S4   V2    S5  V3    S6  V4    S1  V5   S2   V6   S3   V1
|          |         |         |         |         |         |
|          |         |         |         |         |         |
P7---H7---P8---H8---P9----H9--P10--H10--P11--H11--P12--H12--P7
|          |         |         |         |         |         |
|          |         |         |         |         |         |
V7  S10   V8   S11  V9   S12  V10  S7   V11  S8   V12  S9   V7
|          |         |         |         |         |         |
|          |         |         |         |         |         |
P13--H13--P14--H14--P15--H15--P16--H16--P17--H17--P18--H18--P13
      P19---H19---P20---H20---P21---H21---P22---H22---P19
       |           |           |           |           |
       |           |           |           |           |
       V13  S15   V14   S16   V15   S13   V16   S14   V13
       |           |           |           |           |
       |           |           |           |           |
      P23---H23---P24---H24---P25---H25---P26---H26---P23
Parameters:
modelHeartModel

Heart model containing the left ventricle geometry.

short_axisdict

Short axis definition with ‘center’ and ‘normal’ keys.

long_axisdict

Long axis (4CV) definition with ‘center’ and ‘normal’ keys.

surfacepv.PolyData, optional

Endocardial surface on which to compute landmarks. If None, the endocardium from the heart model is used.

Returns:
list[np.ndarray]

List of 26 landmark point coordinates on the endocardial surface.

landmark_utils.compute_aha17_lines(surface: pyvista.PolyData, points: list[numpy.ndarray]) tuple[list[pyvista.PolyData], list[pyvista.PolyData]]#

Compute AHA 17 segment horizontal and vertical lines.

Parameters:
surfacepv.PolyData

The endocardial surface to project the lines onto.

pointslist[np.ndarray]

The list of AHA17 landmark points defining the lines.

Returns:
tuple[list[pv.PolyData], list[pv.PolyData]]

Tuple of horizontal and vertical line segments projected onto the surface.

landmark_utils.compute_aha17(model: ansys.health.heart.models.HeartModel, short_axis: dict, l4cv_axis: dict, seg: Literal[16, 17] = 17, p_junction: numpy.ndarray = None) numpy.ndarray#

Compute the AHA17 label for left ventricle elements.

Parameters:
modelHeartModel

Heart model.

short_axisdict

Short axis.

l4cv_axisdict

Long 4CV axis.

segLiteral[16, 17], default: 17

Compute 16 or 17 segments.

p_junctionnp.ndarray, default: None

LV and RV junction points. If these points are given, they defines the start of segment 1. If they are not given, the start point is defined by rotating 60 degrees from the 4CV axis.

Returns:
np.ndarray

AHA17 IDs. No concerned elements are assigned with np.nan.

landmark_utils.compute_element_cs(model: ansys.health.heart.models.HeartModel, short_axis: dict, aha_element: numpy.ndarray) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]#

Compute elemental coordinate system for AHA elements.

Parameters:
modelHeartModel

Heart model.

short_axisdict

Short axis.

aha_elementnp.ndarray

Elements with AHA labels. Compute only on these elements.

Returns:
tuple[np.ndarray, np.ndarray, np.ndarray]

Longitudinal, radial, and circumferential vectors of each AHA element.