We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
update path handling in examples/inverse/morph_surface_stc.py
all of our `data_path` functions now return `pathlib.Path` objects, which allows things like the following:

https://github.com/mne-tools/mne-python/blob/37a9e5587443109515a85cdc4396af4e014ecf82/examples/datasets/brainstorm_data.py#L32-L35

Compare this to the old pattern (using `os.path.join`, often imported as `op.join`):

```py
raw_path = os.path.join(data_path, 'MEG', 'bst_raw',
                        'subj001_somatosensory_20111109_01_AUX-f.ds')
```

or the *really* old pattern (using the `+` operator on plain strings):

```py
raw_path = (data_path + '/MEG/bst_raw/' +
            'subj001_somatosensory_20111109_01_AUX-f.ds')
```

Update the paths in the file mentioned in the issue title to use the new pathlib-style, which is considered the modern, best-practice way to handle file paths.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/inverse/morph_surface_stc.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 .. _ex-morph-surface:
4 
5 =============================
6 Morph surface source estimate
7 =============================
8 
9 This example demonstrates how to morph an individual subject's
10 :class:`mne.SourceEstimate` to a common reference space. We achieve this using
11 :class:`mne.SourceMorph`. Pre-computed data will be morphed based on
12 a spherical representation of the cortex computed using the spherical
13 registration of :ref:`FreeSurfer <tut-freesurfer-mne>`
14 (https://surfer.nmr.mgh.harvard.edu/fswiki/SurfaceRegAndTemplates)
15 :footcite:`GreveEtAl2013`. This
16 transform will be used to morph the surface vertices of the subject towards the
17 reference vertices. Here we will use 'fsaverage' as a reference space (see
18 https://surfer.nmr.mgh.harvard.edu/fswiki/FsAverage).
19 
20 The transformation will be applied to the surface source estimate. A plot
21 depicting the successful morph will be created for the spherical and inflated
22 surface representation of ``'fsaverage'``, overlaid with the morphed surface
23 source estimate.
24 
25 .. note:: For background information about morphing see :ref:`ch_morph`.
26 """
27 # Author: Tommy Clausner <tommy.clausner@gmail.com>
28 #
29 # License: BSD-3-Clause
30 
31 # %%
32 import os
33 import os.path as op
34 
35 import mne
36 from mne.datasets import sample
37 
38 print(__doc__)
39 
40 # %%
41 # Setup paths
42 
43 data_path = sample.data_path()
44 sample_dir = op.join(data_path, 'MEG', 'sample')
45 subjects_dir = op.join(data_path, 'subjects')
46 fname_src = op.join(subjects_dir, 'sample', 'bem', 'sample-oct-6-src.fif')
47 fname_fwd = op.join(sample_dir, 'sample_audvis-meg-oct-6-fwd.fif')
48 fname_fsaverage_src = os.path.join(subjects_dir, 'fsaverage', 'bem',
49                                    'fsaverage-ico-5-src.fif')
50 
51 fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')
52 
53 # %%
54 # Load example data
55 
56 # Read stc from file
57 stc = mne.read_source_estimate(fname_stc, subject='sample')
58 
59 # %%
60 # Setting up SourceMorph for SourceEstimate
61 # -----------------------------------------
62 #
63 # In MNE, surface source estimates represent the source space simply as
64 # lists of vertices (see :ref:`tut-source-estimate-class`).
65 # This list can either be obtained from :class:`mne.SourceSpaces` (src) or from
66 # the ``stc`` itself. If you use the source space, be sure to use the
67 # source space from the forward or inverse operator, because vertices
68 # can be excluded during forward computation due to proximity to the BEM
69 # inner skull surface:
70 
71 src_orig = mne.read_source_spaces(fname_src)
72 print(src_orig)  # n_used=4098, 4098
73 fwd = mne.read_forward_solution(fname_fwd)
74 print(fwd['src'])  # n_used=3732, 3766
75 print([len(v) for v in stc.vertices])
76 
77 # %%
78 # We also need to specify the set of vertices to morph to. This can be done
79 # using the ``spacing`` parameter, but for consistency it's better to pass the
80 # ``src_to`` parameter.
81 #
82 # .. note::
83 #      Since the default values of :func:`mne.compute_source_morph` are
84 #      ``spacing=5, subject_to='fsaverage'``, in this example
85 #      we could actually omit the ``src_to`` and ``subject_to`` arguments
86 #      below. The ico-5 ``fsaverage`` source space contains the
87 #      special values ``[np.arange(10242)] * 2``, but in general this will
88 #      not be true for other spacings or other subjects. Thus it is recommended
89 #      to always pass the destination ``src`` for consistency.
90 #
91 # Initialize SourceMorph for SourceEstimate
92 
93 src_to = mne.read_source_spaces(fname_fsaverage_src)
94 print(src_to[0]['vertno'])  # special, np.arange(10242)
95 morph = mne.compute_source_morph(stc, subject_from='sample',
96                                  subject_to='fsaverage', src_to=src_to,
97                                  subjects_dir=subjects_dir)
98 
99 # %%
100 # Apply morph to (Vector) SourceEstimate
101 # --------------------------------------
102 #
103 # The morph will be applied to the source estimate data, by giving it as the
104 # first argument to the morph we computed above.
105 
106 stc_fsaverage = morph.apply(stc)
107 
108 # %%
109 # Plot results
110 # ------------
111 
112 # Define plotting parameters
113 surfer_kwargs = dict(
114     hemi='lh', subjects_dir=subjects_dir,
115     clim=dict(kind='value', lims=[8, 12, 15]), views='lateral',
116     initial_time=0.09, time_unit='s', size=(800, 800),
117     smoothing_steps=5)
118 
119 # As spherical surface
120 brain = stc_fsaverage.plot(surface='sphere', **surfer_kwargs)
121 
122 # Add title
123 brain.add_text(0.1, 0.9, 'Morphed to fsaverage (spherical)', 'title',
124                font_size=16)
125 
126 # %%
127 # As inflated surface
128 brain_inf = stc_fsaverage.plot(surface='inflated', **surfer_kwargs)
129 
130 # Add title
131 brain_inf.add_text(0.1, 0.9, 'Morphed to fsaverage (inflated)', 'title',
132                    font_size=16)
133 
134 # %%
135 # Reading and writing SourceMorph from and to disk
136 # ------------------------------------------------
137 #
138 # An instance of SourceMorph can be saved, by calling
139 # :meth:`morph.save <mne.SourceMorph.save>`.
140 #
141 # This method allows for specification of a filename under which the ``morph``
142 # will be save in ".h5" format. If no file extension is provided, "-morph.h5"
143 # will be appended to the respective defined filename::
144 #
145 #     >>> morph.save('my-file-name')
146 #
147 # Reading a saved source morph can be achieved by using
148 # :func:`mne.read_source_morph`::
149 #
150 #     >>> morph = mne.read_source_morph('my-file-name-morph.h5')
151 #
152 # Once the environment is set up correctly, no information such as
153 # ``subject_from`` or ``subjects_dir`` must be provided, since it can be
154 # inferred from the data and use morph to 'fsaverage' by default. SourceMorph
155 # can further be used without creating an instance and assigning it to a
156 # variable. Instead :func:`mne.compute_source_morph` and
157 # :meth:`mne.SourceMorph.apply` can be
158 # easily chained into a handy one-liner. Taking this together the shortest
159 # possible way to morph data directly would be:
160 
161 stc_fsaverage = mne.compute_source_morph(stc,
162                                          subjects_dir=subjects_dir).apply(stc)
163 
164 # %%
165 # For more examples, check out :ref:`examples using SourceMorph.apply
166 # <sphx_glr_backreferences_mne.SourceMorph.apply>`.
167 #
168 #
169 # References
170 # ----------
171 # .. footbibliography::
172
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/inverse/morph_surface_stc.py b/examples/inverse/morph_surface_stc.py
--- a/examples/inverse/morph_surface_stc.py
+++ b/examples/inverse/morph_surface_stc.py
@@ -29,9 +29,6 @@
 # License: BSD-3-Clause
 
 # %%
-import os
-import os.path as op
-
 import mne
 from mne.datasets import sample
 
@@ -41,14 +38,13 @@
 # Setup paths
 
 data_path = sample.data_path()
-sample_dir = op.join(data_path, 'MEG', 'sample')
-subjects_dir = op.join(data_path, 'subjects')
-fname_src = op.join(subjects_dir, 'sample', 'bem', 'sample-oct-6-src.fif')
-fname_fwd = op.join(sample_dir, 'sample_audvis-meg-oct-6-fwd.fif')
-fname_fsaverage_src = os.path.join(subjects_dir, 'fsaverage', 'bem',
-                                   'fsaverage-ico-5-src.fif')
-
-fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')
+sample_dir = data_path / 'MEG' / 'sample'
+subjects_dir = data_path / 'subjects'
+fname_src = subjects_dir / 'sample' / 'bem' / 'sample-oct-6-src.fif'
+fname_fwd = sample_dir / 'sample_audvis-meg-oct-6-fwd.fif'
+fname_fsaverage_src = (subjects_dir / 'fsaverage' / 'bem' /
+                       'fsaverage-ico-5-src.fif')
+fname_stc = sample_dir / 'sample_audvis-meg'
 
 # %%
 # Load example data

{"golden_diff": "diff --git a/examples/inverse/morph_surface_stc.py b/examples/inverse/morph_surface_stc.py\n--- a/examples/inverse/morph_surface_stc.py\n+++ b/examples/inverse/morph_surface_stc.py\n@@ -29,9 +29,6 @@\n # License: BSD-3-Clause\n \n # %%\n-import os\n-import os.path as op\n-\n import mne\n from mne.datasets import sample\n \n@@ -41,14 +38,13 @@\n # Setup paths\n \n data_path = sample.data_path()\n-sample_dir = op.join(data_path, 'MEG', 'sample')\n-subjects_dir = op.join(data_path, 'subjects')\n-fname_src = op.join(subjects_dir, 'sample', 'bem', 'sample-oct-6-src.fif')\n-fname_fwd = op.join(sample_dir, 'sample_audvis-meg-oct-6-fwd.fif')\n-fname_fsaverage_src = os.path.join(subjects_dir, 'fsaverage', 'bem',\n-                                   'fsaverage-ico-5-src.fif')\n-\n-fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')\n+sample_dir = data_path / 'MEG' / 'sample'\n+subjects_dir = data_path / 'subjects'\n+fname_src = subjects_dir / 'sample' / 'bem' / 'sample-oct-6-src.fif'\n+fname_fwd = sample_dir / 'sample_audvis-meg-oct-6-fwd.fif'\n+fname_fsaverage_src = (subjects_dir / 'fsaverage' / 'bem' /\n+                       'fsaverage-ico-5-src.fif')\n+fname_stc = sample_dir / 'sample_audvis-meg'\n \n # %%\n # Load example data\n", "issue": "update path handling in examples/inverse/morph_surface_stc.py\nall of our `data_path` functions now return `pathlib.Path` objects, which allows things like the following:\r\n\r\nhttps://github.com/mne-tools/mne-python/blob/37a9e5587443109515a85cdc4396af4e014ecf82/examples/datasets/brainstorm_data.py#L32-L35\r\n\r\nCompare this to the old pattern (using `os.path.join`, often imported as `op.join`):\r\n\r\n```py\r\nraw_path = os.path.join(data_path, 'MEG', 'bst_raw',\r\n                        'subj001_somatosensory_20111109_01_AUX-f.ds')\r\n```\r\n\r\nor the *really* old pattern (using the `+` operator on plain strings):\r\n\r\n```py\r\nraw_path = (data_path + '/MEG/bst_raw/' +\r\n            'subj001_somatosensory_20111109_01_AUX-f.ds')\r\n```\r\n\r\nUpdate the paths in the file mentioned in the issue title to use the new pathlib-style, which is considered the modern, best-practice way to handle file paths.\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\n.. _ex-morph-surface:\n\n=============================\nMorph surface source estimate\n=============================\n\nThis example demonstrates how to morph an individual subject's\n:class:`mne.SourceEstimate` to a common reference space. We achieve this using\n:class:`mne.SourceMorph`. Pre-computed data will be morphed based on\na spherical representation of the cortex computed using the spherical\nregistration of :ref:`FreeSurfer <tut-freesurfer-mne>`\n(https://surfer.nmr.mgh.harvard.edu/fswiki/SurfaceRegAndTemplates)\n:footcite:`GreveEtAl2013`. This\ntransform will be used to morph the surface vertices of the subject towards the\nreference vertices. Here we will use 'fsaverage' as a reference space (see\nhttps://surfer.nmr.mgh.harvard.edu/fswiki/FsAverage).\n\nThe transformation will be applied to the surface source estimate. A plot\ndepicting the successful morph will be created for the spherical and inflated\nsurface representation of ``'fsaverage'``, overlaid with the morphed surface\nsource estimate.\n\n.. note:: For background information about morphing see :ref:`ch_morph`.\n\"\"\"\n# Author: Tommy Clausner <tommy.clausner@gmail.com>\n#\n# License: BSD-3-Clause\n\n# %%\nimport os\nimport os.path as op\n\nimport mne\nfrom mne.datasets import sample\n\nprint(__doc__)\n\n# %%\n# Setup paths\n\ndata_path = sample.data_path()\nsample_dir = op.join(data_path, 'MEG', 'sample')\nsubjects_dir = op.join(data_path, 'subjects')\nfname_src = op.join(subjects_dir, 'sample', 'bem', 'sample-oct-6-src.fif')\nfname_fwd = op.join(sample_dir, 'sample_audvis-meg-oct-6-fwd.fif')\nfname_fsaverage_src = os.path.join(subjects_dir, 'fsaverage', 'bem',\n                                   'fsaverage-ico-5-src.fif')\n\nfname_stc = os.path.join(sample_dir, 'sample_audvis-meg')\n\n# %%\n# Load example data\n\n# Read stc from file\nstc = mne.read_source_estimate(fname_stc, subject='sample')\n\n# %%\n# Setting up SourceMorph for SourceEstimate\n# -----------------------------------------\n#\n# In MNE, surface source estimates represent the source space simply as\n# lists of vertices (see :ref:`tut-source-estimate-class`).\n# This list can either be obtained from :class:`mne.SourceSpaces` (src) or from\n# the ``stc`` itself. If you use the source space, be sure to use the\n# source space from the forward or inverse operator, because vertices\n# can be excluded during forward computation due to proximity to the BEM\n# inner skull surface:\n\nsrc_orig = mne.read_source_spaces(fname_src)\nprint(src_orig)  # n_used=4098, 4098\nfwd = mne.read_forward_solution(fname_fwd)\nprint(fwd['src'])  # n_used=3732, 3766\nprint([len(v) for v in stc.vertices])\n\n# %%\n# We also need to specify the set of vertices to morph to. This can be done\n# using the ``spacing`` parameter, but for consistency it's better to pass the\n# ``src_to`` parameter.\n#\n# .. note::\n#      Since the default values of :func:`mne.compute_source_morph` are\n#      ``spacing=5, subject_to='fsaverage'``, in this example\n#      we could actually omit the ``src_to`` and ``subject_to`` arguments\n#      below. The ico-5 ``fsaverage`` source space contains the\n#      special values ``[np.arange(10242)] * 2``, but in general this will\n#      not be true for other spacings or other subjects. Thus it is recommended\n#      to always pass the destination ``src`` for consistency.\n#\n# Initialize SourceMorph for SourceEstimate\n\nsrc_to = mne.read_source_spaces(fname_fsaverage_src)\nprint(src_to[0]['vertno'])  # special, np.arange(10242)\nmorph = mne.compute_source_morph(stc, subject_from='sample',\n                                 subject_to='fsaverage', src_to=src_to,\n                                 subjects_dir=subjects_dir)\n\n# %%\n# Apply morph to (Vector) SourceEstimate\n# --------------------------------------\n#\n# The morph will be applied to the source estimate data, by giving it as the\n# first argument to the morph we computed above.\n\nstc_fsaverage = morph.apply(stc)\n\n# %%\n# Plot results\n# ------------\n\n# Define plotting parameters\nsurfer_kwargs = dict(\n    hemi='lh', subjects_dir=subjects_dir,\n    clim=dict(kind='value', lims=[8, 12, 15]), views='lateral',\n    initial_time=0.09, time_unit='s', size=(800, 800),\n    smoothing_steps=5)\n\n# As spherical surface\nbrain = stc_fsaverage.plot(surface='sphere', **surfer_kwargs)\n\n# Add title\nbrain.add_text(0.1, 0.9, 'Morphed to fsaverage (spherical)', 'title',\n               font_size=16)\n\n# %%\n# As inflated surface\nbrain_inf = stc_fsaverage.plot(surface='inflated', **surfer_kwargs)\n\n# Add title\nbrain_inf.add_text(0.1, 0.9, 'Morphed to fsaverage (inflated)', 'title',\n                   font_size=16)\n\n# %%\n# Reading and writing SourceMorph from and to disk\n# ------------------------------------------------\n#\n# An instance of SourceMorph can be saved, by calling\n# :meth:`morph.save <mne.SourceMorph.save>`.\n#\n# This method allows for specification of a filename under which the ``morph``\n# will be save in \".h5\" format. If no file extension is provided, \"-morph.h5\"\n# will be appended to the respective defined filename::\n#\n#     >>> morph.save('my-file-name')\n#\n# Reading a saved source morph can be achieved by using\n# :func:`mne.read_source_morph`::\n#\n#     >>> morph = mne.read_source_morph('my-file-name-morph.h5')\n#\n# Once the environment is set up correctly, no information such as\n# ``subject_from`` or ``subjects_dir`` must be provided, since it can be\n# inferred from the data and use morph to 'fsaverage' by default. SourceMorph\n# can further be used without creating an instance and assigning it to a\n# variable. Instead :func:`mne.compute_source_morph` and\n# :meth:`mne.SourceMorph.apply` can be\n# easily chained into a handy one-liner. Taking this together the shortest\n# possible way to morph data directly would be:\n\nstc_fsaverage = mne.compute_source_morph(stc,\n                                         subjects_dir=subjects_dir).apply(stc)\n\n# %%\n# For more examples, check out :ref:`examples using SourceMorph.apply\n# <sphx_glr_backreferences_mne.SourceMorph.apply>`.\n#\n#\n# References\n# ----------\n# .. footbibliography::\n", "path": "examples/inverse/morph_surface_stc.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\n.. _ex-morph-surface:\n\n=============================\nMorph surface source estimate\n=============================\n\nThis example demonstrates how to morph an individual subject's\n:class:`mne.SourceEstimate` to a common reference space. We achieve this using\n:class:`mne.SourceMorph`. Pre-computed data will be morphed based on\na spherical representation of the cortex computed using the spherical\nregistration of :ref:`FreeSurfer <tut-freesurfer-mne>`\n(https://surfer.nmr.mgh.harvard.edu/fswiki/SurfaceRegAndTemplates)\n:footcite:`GreveEtAl2013`. This\ntransform will be used to morph the surface vertices of the subject towards the\nreference vertices. Here we will use 'fsaverage' as a reference space (see\nhttps://surfer.nmr.mgh.harvard.edu/fswiki/FsAverage).\n\nThe transformation will be applied to the surface source estimate. A plot\ndepicting the successful morph will be created for the spherical and inflated\nsurface representation of ``'fsaverage'``, overlaid with the morphed surface\nsource estimate.\n\n.. note:: For background information about morphing see :ref:`ch_morph`.\n\"\"\"\n# Author: Tommy Clausner <tommy.clausner@gmail.com>\n#\n# License: BSD-3-Clause\n\n# %%\nimport mne\nfrom mne.datasets import sample\n\nprint(__doc__)\n\n# %%\n# Setup paths\n\ndata_path = sample.data_path()\nsample_dir = data_path / 'MEG' / 'sample'\nsubjects_dir = data_path / 'subjects'\nfname_src = subjects_dir / 'sample' / 'bem' / 'sample-oct-6-src.fif'\nfname_fwd = sample_dir / 'sample_audvis-meg-oct-6-fwd.fif'\nfname_fsaverage_src = (subjects_dir / 'fsaverage' / 'bem' /\n                       'fsaverage-ico-5-src.fif')\nfname_stc = sample_dir / 'sample_audvis-meg'\n\n# %%\n# Load example data\n\n# Read stc from file\nstc = mne.read_source_estimate(fname_stc, subject='sample')\n\n# %%\n# Setting up SourceMorph for SourceEstimate\n# -----------------------------------------\n#\n# In MNE, surface source estimates represent the source space simply as\n# lists of vertices (see :ref:`tut-source-estimate-class`).\n# This list can either be obtained from :class:`mne.SourceSpaces` (src) or from\n# the ``stc`` itself. If you use the source space, be sure to use the\n# source space from the forward or inverse operator, because vertices\n# can be excluded during forward computation due to proximity to the BEM\n# inner skull surface:\n\nsrc_orig = mne.read_source_spaces(fname_src)\nprint(src_orig)  # n_used=4098, 4098\nfwd = mne.read_forward_solution(fname_fwd)\nprint(fwd['src'])  # n_used=3732, 3766\nprint([len(v) for v in stc.vertices])\n\n# %%\n# We also need to specify the set of vertices to morph to. This can be done\n# using the ``spacing`` parameter, but for consistency it's better to pass the\n# ``src_to`` parameter.\n#\n# .. note::\n#      Since the default values of :func:`mne.compute_source_morph` are\n#      ``spacing=5, subject_to='fsaverage'``, in this example\n#      we could actually omit the ``src_to`` and ``subject_to`` arguments\n#      below. The ico-5 ``fsaverage`` source space contains the\n#      special values ``[np.arange(10242)] * 2``, but in general this will\n#      not be true for other spacings or other subjects. Thus it is recommended\n#      to always pass the destination ``src`` for consistency.\n#\n# Initialize SourceMorph for SourceEstimate\n\nsrc_to = mne.read_source_spaces(fname_fsaverage_src)\nprint(src_to[0]['vertno'])  # special, np.arange(10242)\nmorph = mne.compute_source_morph(stc, subject_from='sample',\n                                 subject_to='fsaverage', src_to=src_to,\n                                 subjects_dir=subjects_dir)\n\n# %%\n# Apply morph to (Vector) SourceEstimate\n# --------------------------------------\n#\n# The morph will be applied to the source estimate data, by giving it as the\n# first argument to the morph we computed above.\n\nstc_fsaverage = morph.apply(stc)\n\n# %%\n# Plot results\n# ------------\n\n# Define plotting parameters\nsurfer_kwargs = dict(\n    hemi='lh', subjects_dir=subjects_dir,\n    clim=dict(kind='value', lims=[8, 12, 15]), views='lateral',\n    initial_time=0.09, time_unit='s', size=(800, 800),\n    smoothing_steps=5)\n\n# As spherical surface\nbrain = stc_fsaverage.plot(surface='sphere', **surfer_kwargs)\n\n# Add title\nbrain.add_text(0.1, 0.9, 'Morphed to fsaverage (spherical)', 'title',\n               font_size=16)\n\n# %%\n# As inflated surface\nbrain_inf = stc_fsaverage.plot(surface='inflated', **surfer_kwargs)\n\n# Add title\nbrain_inf.add_text(0.1, 0.9, 'Morphed to fsaverage (inflated)', 'title',\n                   font_size=16)\n\n# %%\n# Reading and writing SourceMorph from and to disk\n# ------------------------------------------------\n#\n# An instance of SourceMorph can be saved, by calling\n# :meth:`morph.save <mne.SourceMorph.save>`.\n#\n# This method allows for specification of a filename under which the ``morph``\n# will be save in \".h5\" format. If no file extension is provided, \"-morph.h5\"\n# will be appended to the respective defined filename::\n#\n#     >>> morph.save('my-file-name')\n#\n# Reading a saved source morph can be achieved by using\n# :func:`mne.read_source_morph`::\n#\n#     >>> morph = mne.read_source_morph('my-file-name-morph.h5')\n#\n# Once the environment is set up correctly, no information such as\n# ``subject_from`` or ``subjects_dir`` must be provided, since it can be\n# inferred from the data and use morph to 'fsaverage' by default. SourceMorph\n# can further be used without creating an instance and assigning it to a\n# variable. Instead :func:`mne.compute_source_morph` and\n# :meth:`mne.SourceMorph.apply` can be\n# easily chained into a handy one-liner. Taking this together the shortest\n# possible way to morph data directly would be:\n\nstc_fsaverage = mne.compute_source_morph(stc,\n                                         subjects_dir=subjects_dir).apply(stc)\n\n# %%\n# For more examples, check out :ref:`examples using SourceMorph.apply\n# <sphx_glr_backreferences_mne.SourceMorph.apply>`.\n#\n#\n# References\n# ----------\n# .. footbibliography::\n", "path": "examples/inverse/morph_surface_stc.py"}]}