Skip to content

Commit

Permalink
Cast fwd["info"] to mne.Info and fwd["src"] to mne.SourceSpaces when …
Browse files Browse the repository at this point in the history
…loading a forward solution with h5io (mne-tools#12804)

Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
mscheltienne and larsoner authored Aug 21, 2024
1 parent 223d4aa commit 99dd0e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/_includes/institutional-partners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Current partners
- `Children’s Hospital of Philadelphia Research Institute <https://www.research.chop.edu/imaging/>`_
- `Donders Institute for Brain, Cognition and Behaviour at Radboud University <https://www.ru.nl/donders/>`_
- `Harvard Medical School <https://hms.harvard.edu/>`_
- `Human Neuroscience Platform at Fondation Campus Biotech Geneva <https://hnp.fcbg.ch/>`_
- `Fondation Campus Biotech Geneva <https://fcbg.ch/>`_
- `Institut national de recherche en informatique et en automatique <https://www.inria.fr/>`_
- `Karl-Franzens-Universität Graz <https://www.uni-graz.at/>`_
- `Massachusetts General Hospital <https://www.massgeneral.org/>`_
Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel/12804.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cast ``fwd["info"]`` to :class:`~mne.Info` and ``fwd["src"]`` to :class:`~mne.SourceSpaces` when loading a forward solution from an HDF5 file, by `Mathieu Scheltienne`_.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,9 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
size=xl,
),
dict(
name="Human Neuroscience Platforn at Fondation Campus Biotech Geneva", # noqa E501
name="Fondation Campus Biotech Geneva",
img="FCBG.svg",
url="https://hnp.fcbg.ch/",
url="https://fcbg.ch/",
size=sm,
),
],
Expand Down
6 changes: 5 additions & 1 deletion mne/forward/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
from ..label import Label
from ..source_estimate import _BaseSourceEstimate, _BaseVectorSourceEstimate
from ..source_space._source_space import (
SourceSpaces,
_get_src_nn,
_read_source_spaces_from_tree,
_set_source_space_vertices,
Expand Down Expand Up @@ -913,7 +914,10 @@ def _write_forward_hdf5(fname, fwd):

def _read_forward_hdf5(fname):
read_hdf5, _ = _import_h5io_funcs()
return Forward(read_hdf5(fname)["fwd"])
fwd = Forward(read_hdf5(fname)["fwd"])
fwd["info"] = Info(fwd["info"])
fwd["src"] = SourceSpaces(fwd["src"])
return fwd


def _write_forward_solution(fid, fwd):
Expand Down

0 comments on commit 99dd0e1

Please sign in to comment.