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

Function _write_morph_map_

mne/morph_map.py:158–177  ·  view source on GitHub ↗
(fid, subject_from, subject_to, mmap_1, mmap_2)

Source from the content-addressed store, hash-verified

156
157
158def _write_morph_map_(fid, subject_from, subject_to, mmap_1, mmap_2):
159 assert len(mmap_1) == 2
160 hemis = [FIFF.FIFFV_MNE_SURF_LEFT_HEMI, FIFF.FIFFV_MNE_SURF_RIGHT_HEMI]
161 for m, hemi in zip(mmap_1, hemis):
162 start_block(fid, FIFF.FIFFB_MNE_MORPH_MAP)
163 write_string(fid, FIFF.FIFF_MNE_MORPH_MAP_FROM, subject_from)
164 write_string(fid, FIFF.FIFF_MNE_MORPH_MAP_TO, subject_to)
165 write_int(fid, FIFF.FIFF_MNE_HEMI, hemi)
166 write_float_sparse_rcs(fid, FIFF.FIFF_MNE_MORPH_MAP, m)
167 end_block(fid, FIFF.FIFFB_MNE_MORPH_MAP)
168 # don't write mmap_2 if it is identical (subject_to == subject_from)
169 if mmap_2 is not None:
170 assert len(mmap_2) == 2
171 for m, hemi in zip(mmap_2, hemis):
172 start_block(fid, FIFF.FIFFB_MNE_MORPH_MAP)
173 write_string(fid, FIFF.FIFF_MNE_MORPH_MAP_FROM, subject_to)
174 write_string(fid, FIFF.FIFF_MNE_MORPH_MAP_TO, subject_from)
175 write_int(fid, FIFF.FIFF_MNE_HEMI, hemi)
176 write_float_sparse_rcs(fid, FIFF.FIFF_MNE_MORPH_MAP, m)
177 end_block(fid, FIFF.FIFFB_MNE_MORPH_MAP)
178
179
180def _make_morph_map(subject_from, subject_to, subjects_dir, xhemi):

Callers 1

_write_morph_mapFunction · 0.85

Calls 5

start_blockFunction · 0.85
write_stringFunction · 0.85
write_intFunction · 0.85
write_float_sparse_rcsFunction · 0.85
end_blockFunction · 0.85

Tested by

no test coverage detected