cedalion.geometry.landmarks

Module for constructing the 10-10-system on the scalp surface.

Functions

normalize_landmarks_labels(geo3d)

Normalize landmark labels to canonical names.

order_ref_points_6(landmarks, twoPoints)

Reorder a set of six landmarks based on spatial relationships and give labels.

Classes

LandmarksBuilder1010(scalp_surface, landmarks)

Construct the 10-10-system on scalp surface based on Oostenveld and Praamstra [OP01].

cedalion.geometry.landmarks.normalize_landmarks_labels(
geo3d: Annotated[DataArray, DataArraySchema(dims='label', coords='label', 'label', 'type')],
) Annotated[DataArray, DataArraySchema(dims='label', coords='label', 'label', 'type')][source]

Normalize landmark labels to canonical names.

Maps commonly used alternative landmark names and capitalizations to canonical names.

When multiple labels normalize to the same canonical name: - If the canonical name already exists, alternative forms are not altered. - If multiple alternatives exist without the canonical form, a ValueError is

raised and the user must resolve the ambiguity.

Parameters:

geo3d – LabeledPoints with potentially non-canonical landmark names.

Returns:

LabeledPoints with normalized landmark labels.

class cedalion.geometry.landmarks.LandmarksBuilder1010(
scalp_surface: Surface,
landmarks: Annotated[DataArray, DataArraySchema(dims='label', coords='label', 'label', 'type')],
)[source]

Bases: object

Construct the 10-10-system on scalp surface based on Oostenveld and Praamstra [OP01].

scalp_surface[source]

a triangle-mesh representing the scalp

Type:

Surface

landmarks_mm[source]

positions of all 10-10 landmarks in mm

Type:

LabeledPoints

vtk_mesh[source]

the scalp surface as a VTK mesh

Type:

vtk.vtkPolyData

lines[source]

points along the lines connecting the landmarks

Type:

List[np.ndarray]

build()[source]

Construct the 10-10-system on the scalp surface.

plot()[source]

Plot scalp surface with landmarks.

cedalion.geometry.landmarks.order_ref_points_6(
landmarks: DataArray,
twoPoints: str,
) DataArray[source]

Reorder a set of six landmarks based on spatial relationships and give labels.

Parameters:
  • landmarks (xr.DataArray) – coordinates for six landmark points

  • twoPoints (str) – two reference points (‘Nz’ or ‘Iz’) for orientation.

Returns:

the landmarks ordered as “Nz”, “Iz”, “RPA”, “LPA”, “Cz”

Return type:

xr.DataArray