Skip to content

Commit

Permalink
[BUG][MRG] Fix surface finding for mne.viz.Brain (#11361) [circle dep…
Browse files Browse the repository at this point in the history
…loy]
  • Loading branch information
alexrockhill authored Dec 21, 2022
1 parent 654248a commit 5346534
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Bugs
- Multitaper spectral estimation now uses periodic (rather than symmetric) taper windows. This also necessitated changing the default ``max_iter`` of our cross-spectral density functions from 150 to 250. (:gh:`11293` by `Daniel McCloy`_)
- Fix :meth:`mne.Epochs.plot_image` and :func:`mne.viz.plot_epochs_image` when using EMG signals (:gh:`11322` by `Alex Gramfort`_)
- Fix selection of ICA components in :func:`mne.viz.plot_ica_components` and :meth:`mne.preprocessing.ICA.plot_components` (:gh:`11369` by `Mathieu Scheltienne`_)
- Fix bug where a Freesurfer reconstruction run with both a T1 and a T2 caused :class:`mne.viz.Brain` not to initialize pial surfaces properly (:gh:`11361` by `Alex Rockhill`_)

API changes
~~~~~~~~~~~
Expand Down
11 changes: 8 additions & 3 deletions mne/viz/_brain/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ def load_geometry(self):
coords = coords[:, [1, 0, 2]]
coords[:, 1] *= -1
else:
coords, faces = read_surface(
path.join(self.data_path, 'surf',
'%s.%s' % (self.hemi, self.surf)))
# allow ?h.pial.T1 if ?h.pial doesn't exist for instance
# end with '' for better file not found error
for img in ('', '.T1', '.T2', ''):
surf_fname = path.join(self.data_path, 'surf',
f'{self.hemi}.{self.surf}{img}')
if path.isfile(surf_fname):
break
coords, faces = read_surface(surf_fname)
orig_faces = faces
if self.units == 'm':
coords /= 1000.
Expand Down

0 comments on commit 5346534

Please sign in to comment.