MCPcopy Index your code
hub / github.com/mne-tools/mne-python / _make_morph_map

Function _make_morph_map

mne/morph_map.py:180–204  ·  view source on GitHub ↗

Construct morph map from one subject to another. Note that this is close, but not exactly like the C version. For example, parts are more accurate due to double precision, so expect some small morph-map differences! Note: This seems easily parallelizable, but the overhead of pi

(subject_from, subject_to, subjects_dir, xhemi)

Source from the content-addressed store, hash-verified

178
179
180def _make_morph_map(subject_from, subject_to, subjects_dir, xhemi):
181 """Construct morph map from one subject to another.
182
183 Note that this is close, but not exactly like the C version.
184 For example, parts are more accurate due to double precision,
185 so expect some small morph-map differences!
186
187 Note: This seems easily parallelizable, but the overhead
188 of pickling all the data structures makes it less efficient
189 than just running on a single core :(
190 """
191 subjects_dir = get_subjects_dir(subjects_dir)
192 if xhemi:
193 reg = "%s.sphere.left_right"
194 hemis = (("lh", "rh"), ("rh", "lh"))
195 else:
196 reg = "%s.sphere.reg"
197 hemis = (("lh", "lh"), ("rh", "rh"))
198
199 return [
200 _make_morph_map_hemi(
201 subject_from, subject_to, subjects_dir, reg % hemi_from, reg % hemi_to
202 )
203 for hemi_from, hemi_to in hemis
204 ]
205
206
207def _make_morph_map_hemi(subject_from, subject_to, subjects_dir, reg_from, reg_to):

Callers 1

read_morph_mapFunction · 0.85

Calls 2

get_subjects_dirFunction · 0.85
_make_morph_map_hemiFunction · 0.85

Tested by

no test coverage detected