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)
| 178 | |
| 179 | |
| 180 | def _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 | |
| 207 | def _make_morph_map_hemi(subject_from, subject_to, subjects_dir, reg_from, reg_to): |
no test coverage detected