The landmark_utils.py module#

Summary#

compute_anatomy_axis

Compute the long and short axes of the left ventricle.

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.

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(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.