MCPcopy
hub / github.com/mne-tools/mne-python / _load_vert_pos

Function _load_vert_pos

mne/label.py:2235–2245  ·  view source on GitHub ↗
(subject, subjects_dir, surf_name, hemi, n_expected, extra="")

Source from the content-addressed store, hash-verified

2233
2234
2235def _load_vert_pos(subject, subjects_dir, surf_name, hemi, n_expected, extra=""):
2236 fname_surf = op.join(subjects_dir, subject, "surf", f"{hemi}.{surf_name}")
2237 vert_pos, _ = read_surface(fname_surf)
2238 vert_pos /= 1e3 # the positions in labels are in meters
2239 if len(vert_pos) != n_expected:
2240 raise RuntimeError(
2241 f"Number of surface vertices ({len(vert_pos)}) for subject {subject}"
2242 " does not match the expected number of vertices"
2243 f"({n_expected}){extra}"
2244 )
2245 return vert_pos
2246
2247
2248@verbose

Callers 3

test_morph_labelsFunction · 0.90
read_labels_from_annotFunction · 0.85
morph_labelsFunction · 0.85

Calls 1

read_surfaceFunction · 0.85

Tested by 1

test_morph_labelsFunction · 0.72