We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
plot_anat should use BIDS subjects_dir
I'm a bit confused by the example of convert_mri_and_trans.py. I think here:

https://github.com/mne-tools/mne-bids/blob/master/examples/convert_mri_and_trans.py#L139-L150

It should actually read in the nifti file that is written instead of the old mgz file. What do you think @sappelhoff ?

--- 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/convert_mri_and_trans.py`
Content:
```
1 """
2 ==========================================================================
3 Save and load T1-weighted MRI scan along with anatomical landmarks in BIDS
4 ==========================================================================
5 
6 When working with MEEG data in the domain of source localization, we usually
7 have to deal with aligning several coordinate systems, such as the coordinate
8 systems of ...
9 
10 - the head of a study participant
11 - the recording device (in the case of MEG)
12 - the anatomical MRI scan of a study participant
13 
14 The process of aligning these frames is also called coregistration, and is
15 performed with the help of a transformation matrix, called ``trans`` in MNE.
16 
17 In this tutorial, we show how ``MNE-BIDS`` can be used to save a T1 weighted
18 MRI scan in BIDS format, and to encode all information of the ``trans`` object
19 in a BIDS compatible way.
20 
21 Finally, we will automatically reproduce our ``trans`` object from a BIDS
22 directory.
23 
24 See the documentation pages in the MNE docs for more information on
25 `source alignment and coordinate frames <mne_source_coords_>`_
26 
27 .. note:: For this example you will need to install ``matplotlib`` and
28           ``nilearn`` on top of your usual ``mne-bids`` installation.
29 
30 """
31 # Authors: Stefan Appelhoff <stefan.appelhoff@mailbox.org>
32 # License: BSD (3-clause)
33 
34 ###############################################################################
35 # We are importing everything we need for this example:
36 
37 import os.path as op
38 import shutil as sh
39 
40 import numpy as np
41 import matplotlib.pyplot as plt
42 from nilearn.plotting import plot_anat
43 import mne
44 from mne.datasets import sample
45 from mne.source_space import head_to_mri
46 
47 from mne_bids import (write_raw_bids, make_bids_basename, write_anat,
48                       get_head_mri_trans)
49 from mne_bids.utils import print_dir_tree
50 
51 ###############################################################################
52 # We will be using the `MNE sample data <mne_sample_data_>`_ and write a basic
53 # BIDS dataset. For more information, you can checkout the respective
54 # :ref:`example <ex-convert-mne-sample>`.
55 
56 data_path = sample.data_path()
57 event_id = {'Auditory/Left': 1, 'Auditory/Right': 2, 'Visual/Left': 3,
58             'Visual/Right': 4, 'Smiley': 5, 'Button': 32}
59 raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
60 events_data = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw-eve.fif')
61 output_path = op.abspath(op.join(data_path, '..', 'MNE-sample-data-bids'))
62 if op.exists(output_path):
63     sh.rmtree(output_path)
64 raw = mne.io.read_raw_fif(raw_fname)
65 sub = '01'
66 ses = '01'
67 task = 'audiovisual'
68 run = '01'
69 bids_basename = make_bids_basename(subject=sub, session=ses, task=task,
70                                    run=run)
71 write_raw_bids(raw, bids_basename, output_path, events_data=events_data,
72                event_id=event_id, overwrite=True)
73 
74 # Print the directory tree
75 print_dir_tree(output_path)
76 
77 ###############################################################################
78 # Now let's assume that we have also collected some T1 weighted MRI data for
79 # our subject. And furthermore, that we have already aligned our coordinate
80 # frames (using e.g., the `coregistration GUI`_) and obtained a transformation
81 # matrix :code:`trans`.
82 
83 # Get the path to our MRI scan
84 t1_mgh_fname = op.join(data_path, 'subjects', 'sample', 'mri', 'T1.mgz')
85 
86 # Load the transformation matrix and show what it looks like
87 trans_fname = op.join(data_path, 'MEG', 'sample',
88                       'sample_audvis_raw-trans.fif')
89 trans = mne.read_trans(trans_fname)
90 print(trans)
91 
92 ###############################################################################
93 # We can save the MRI to our existing BIDS directory and at the same time
94 # create a JSON sidecar file that contains metadata, we will later use to
95 # retrieve our transformation matrix :code:`trans`.
96 
97 # We use the write_anat function
98 write_anat(bids_root=output_path,  # point to the BIDS dir we wrote earlier
99            subject=sub,
100            t1w=t1_mgh_fname,  # path to the MRI scan
101            session=ses,
102            raw=raw,  # the raw MEG data file connected to the MRI
103            trans=trans,  # our transformation matrix
104            verbose=True  # this will print out the sidecar file
105            )
106 
107 # Let's have another look at our BIDS directory
108 print_dir_tree(output_path)
109 
110 ###############################################################################
111 # Our BIDS dataset is now ready to be shared. We can easily estimate the
112 # transformation matrix using ``MNE-BIDS`` and the BIDS dataset.
113 
114 bids_fname = bids_basename + '_meg.fif'
115 
116 # reproduce our trans
117 estim_trans = get_head_mri_trans(bids_fname=bids_fname,  # name of the MEG file
118                                  bids_root=output_path  # root of our BIDS dir
119                                  )
120 
121 ###############################################################################
122 # Finally, let's use the T1 weighted MRI image and plot the anatomical
123 # landmarks Nasion, LPA, and RPA (=left and right preauricular points) onto
124 # the brain image. For that, we can extract the location of Nasion, LPA, and
125 # RPA from the MEG file, apply our transformation matrix :code:`trans`, and
126 # plot the results.
127 
128 # Get Landmarks from MEG file, 0, 1, and 2 correspond to LPA, NAS, RPA
129 # and the 'r' key will provide us with the xyz coordinates
130 pos = np.asarray((raw.info['dig'][0]['r'],
131                   raw.info['dig'][1]['r'],
132                   raw.info['dig'][2]['r']))
133 
134 
135 # We use a function from MNE-Python to convert MEG coordinates to MRI space
136 # for the conversion we use our estimated transformation matrix and the
137 # MEG coordinates extracted from the raw file. `subjects` and `subjects_dir`
138 # are used internally, to point to the T1-weighted MRI file: `t1_mgh_fname`
139 mri_pos = head_to_mri(pos=pos,
140                       subject='sample',
141                       mri_head_t=estim_trans,
142                       subjects_dir=op.join(data_path, 'subjects')
143                       )
144 
145 # Plot it
146 fig, axs = plt.subplots(3, 1)
147 for point_idx, label in enumerate(('LPA', 'NAS', 'RPA')):
148     plot_anat(t1_mgh_fname, axes=axs[point_idx],
149               cut_coords=mri_pos[point_idx, :],
150               title=label)
151 
152 
153 ###############################################################################
154 # .. LINKS
155 #
156 # .. _coregistration GUI:
157 #    https://martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html#defining-the-headmri-trans-using-the-gui  # noqa: E501
158 # .. _mne_source_coords:
159 #    https://www.martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html  # noqa: E501
160 # .. _mne_sample_data:
161 #    https://martinos.org/mne/stable/manual/sample_dataset.html
162 #
163
```
--- 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/convert_mri_and_trans.py b/examples/convert_mri_and_trans.py
--- a/examples/convert_mri_and_trans.py
+++ b/examples/convert_mri_and_trans.py
@@ -95,14 +95,14 @@
 # retrieve our transformation matrix :code:`trans`.
 
 # We use the write_anat function
-write_anat(bids_root=output_path,  # point to the BIDS dir we wrote earlier
-           subject=sub,
-           t1w=t1_mgh_fname,  # path to the MRI scan
-           session=ses,
-           raw=raw,  # the raw MEG data file connected to the MRI
-           trans=trans,  # our transformation matrix
-           verbose=True  # this will print out the sidecar file
-           )
+anat_dir = write_anat(bids_root=output_path,  # the BIDS dir we wrote earlier
+                      subject=sub,
+                      t1w=t1_mgh_fname,  # path to the MRI scan
+                      session=ses,
+                      raw=raw,  # the raw MEG data file connected to the MRI
+                      trans=trans,  # our transformation matrix
+                      verbose=True  # this will print out the sidecar file
+                      )
 
 # Let's have another look at our BIDS directory
 print_dir_tree(output_path)
@@ -142,10 +142,13 @@
                       subjects_dir=op.join(data_path, 'subjects')
                       )
 
+# Our MRI written to BIDS, we got `anat_dir` from our `write_anat` function
+t1_nii_fname = op.join(anat_dir, 'sub-01_ses-01_T1w.nii.gz')
+
 # Plot it
 fig, axs = plt.subplots(3, 1)
 for point_idx, label in enumerate(('LPA', 'NAS', 'RPA')):
-    plot_anat(t1_mgh_fname, axes=axs[point_idx],
+    plot_anat(t1_nii_fname, axes=axs[point_idx],
               cut_coords=mri_pos[point_idx, :],
               title=label)

{"golden_diff": "diff --git a/examples/convert_mri_and_trans.py b/examples/convert_mri_and_trans.py\n--- a/examples/convert_mri_and_trans.py\n+++ b/examples/convert_mri_and_trans.py\n@@ -95,14 +95,14 @@\n # retrieve our transformation matrix :code:`trans`.\n \n # We use the write_anat function\n-write_anat(bids_root=output_path,  # point to the BIDS dir we wrote earlier\n-           subject=sub,\n-           t1w=t1_mgh_fname,  # path to the MRI scan\n-           session=ses,\n-           raw=raw,  # the raw MEG data file connected to the MRI\n-           trans=trans,  # our transformation matrix\n-           verbose=True  # this will print out the sidecar file\n-           )\n+anat_dir = write_anat(bids_root=output_path,  # the BIDS dir we wrote earlier\n+                      subject=sub,\n+                      t1w=t1_mgh_fname,  # path to the MRI scan\n+                      session=ses,\n+                      raw=raw,  # the raw MEG data file connected to the MRI\n+                      trans=trans,  # our transformation matrix\n+                      verbose=True  # this will print out the sidecar file\n+                      )\n \n # Let's have another look at our BIDS directory\n print_dir_tree(output_path)\n@@ -142,10 +142,13 @@\n                       subjects_dir=op.join(data_path, 'subjects')\n                       )\n \n+# Our MRI written to BIDS, we got `anat_dir` from our `write_anat` function\n+t1_nii_fname = op.join(anat_dir, 'sub-01_ses-01_T1w.nii.gz')\n+\n # Plot it\n fig, axs = plt.subplots(3, 1)\n for point_idx, label in enumerate(('LPA', 'NAS', 'RPA')):\n-    plot_anat(t1_mgh_fname, axes=axs[point_idx],\n+    plot_anat(t1_nii_fname, axes=axs[point_idx],\n               cut_coords=mri_pos[point_idx, :],\n               title=label)\n", "issue": "plot_anat should use BIDS subjects_dir\nI'm a bit confused by the example of convert_mri_and_trans.py. I think here:\r\n\r\nhttps://github.com/mne-tools/mne-bids/blob/master/examples/convert_mri_and_trans.py#L139-L150\r\n\r\nIt should actually read in the nifti file that is written instead of the old mgz file. What do you think @sappelhoff ?\n", "before_files": [{"content": "\"\"\"\n==========================================================================\nSave and load T1-weighted MRI scan along with anatomical landmarks in BIDS\n==========================================================================\n\nWhen working with MEEG data in the domain of source localization, we usually\nhave to deal with aligning several coordinate systems, such as the coordinate\nsystems of ...\n\n- the head of a study participant\n- the recording device (in the case of MEG)\n- the anatomical MRI scan of a study participant\n\nThe process of aligning these frames is also called coregistration, and is\nperformed with the help of a transformation matrix, called ``trans`` in MNE.\n\nIn this tutorial, we show how ``MNE-BIDS`` can be used to save a T1 weighted\nMRI scan in BIDS format, and to encode all information of the ``trans`` object\nin a BIDS compatible way.\n\nFinally, we will automatically reproduce our ``trans`` object from a BIDS\ndirectory.\n\nSee the documentation pages in the MNE docs for more information on\n`source alignment and coordinate frames <mne_source_coords_>`_\n\n.. note:: For this example you will need to install ``matplotlib`` and\n          ``nilearn`` on top of your usual ``mne-bids`` installation.\n\n\"\"\"\n# Authors: Stefan Appelhoff <stefan.appelhoff@mailbox.org>\n# License: BSD (3-clause)\n\n###############################################################################\n# We are importing everything we need for this example:\n\nimport os.path as op\nimport shutil as sh\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom nilearn.plotting import plot_anat\nimport mne\nfrom mne.datasets import sample\nfrom mne.source_space import head_to_mri\n\nfrom mne_bids import (write_raw_bids, make_bids_basename, write_anat,\n                      get_head_mri_trans)\nfrom mne_bids.utils import print_dir_tree\n\n###############################################################################\n# We will be using the `MNE sample data <mne_sample_data_>`_ and write a basic\n# BIDS dataset. For more information, you can checkout the respective\n# :ref:`example <ex-convert-mne-sample>`.\n\ndata_path = sample.data_path()\nevent_id = {'Auditory/Left': 1, 'Auditory/Right': 2, 'Visual/Left': 3,\n            'Visual/Right': 4, 'Smiley': 5, 'Button': 32}\nraw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')\nevents_data = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw-eve.fif')\noutput_path = op.abspath(op.join(data_path, '..', 'MNE-sample-data-bids'))\nif op.exists(output_path):\n    sh.rmtree(output_path)\nraw = mne.io.read_raw_fif(raw_fname)\nsub = '01'\nses = '01'\ntask = 'audiovisual'\nrun = '01'\nbids_basename = make_bids_basename(subject=sub, session=ses, task=task,\n                                   run=run)\nwrite_raw_bids(raw, bids_basename, output_path, events_data=events_data,\n               event_id=event_id, overwrite=True)\n\n# Print the directory tree\nprint_dir_tree(output_path)\n\n###############################################################################\n# Now let's assume that we have also collected some T1 weighted MRI data for\n# our subject. And furthermore, that we have already aligned our coordinate\n# frames (using e.g., the `coregistration GUI`_) and obtained a transformation\n# matrix :code:`trans`.\n\n# Get the path to our MRI scan\nt1_mgh_fname = op.join(data_path, 'subjects', 'sample', 'mri', 'T1.mgz')\n\n# Load the transformation matrix and show what it looks like\ntrans_fname = op.join(data_path, 'MEG', 'sample',\n                      'sample_audvis_raw-trans.fif')\ntrans = mne.read_trans(trans_fname)\nprint(trans)\n\n###############################################################################\n# We can save the MRI to our existing BIDS directory and at the same time\n# create a JSON sidecar file that contains metadata, we will later use to\n# retrieve our transformation matrix :code:`trans`.\n\n# We use the write_anat function\nwrite_anat(bids_root=output_path,  # point to the BIDS dir we wrote earlier\n           subject=sub,\n           t1w=t1_mgh_fname,  # path to the MRI scan\n           session=ses,\n           raw=raw,  # the raw MEG data file connected to the MRI\n           trans=trans,  # our transformation matrix\n           verbose=True  # this will print out the sidecar file\n           )\n\n# Let's have another look at our BIDS directory\nprint_dir_tree(output_path)\n\n###############################################################################\n# Our BIDS dataset is now ready to be shared. We can easily estimate the\n# transformation matrix using ``MNE-BIDS`` and the BIDS dataset.\n\nbids_fname = bids_basename + '_meg.fif'\n\n# reproduce our trans\nestim_trans = get_head_mri_trans(bids_fname=bids_fname,  # name of the MEG file\n                                 bids_root=output_path  # root of our BIDS dir\n                                 )\n\n###############################################################################\n# Finally, let's use the T1 weighted MRI image and plot the anatomical\n# landmarks Nasion, LPA, and RPA (=left and right preauricular points) onto\n# the brain image. For that, we can extract the location of Nasion, LPA, and\n# RPA from the MEG file, apply our transformation matrix :code:`trans`, and\n# plot the results.\n\n# Get Landmarks from MEG file, 0, 1, and 2 correspond to LPA, NAS, RPA\n# and the 'r' key will provide us with the xyz coordinates\npos = np.asarray((raw.info['dig'][0]['r'],\n                  raw.info['dig'][1]['r'],\n                  raw.info['dig'][2]['r']))\n\n\n# We use a function from MNE-Python to convert MEG coordinates to MRI space\n# for the conversion we use our estimated transformation matrix and the\n# MEG coordinates extracted from the raw file. `subjects` and `subjects_dir`\n# are used internally, to point to the T1-weighted MRI file: `t1_mgh_fname`\nmri_pos = head_to_mri(pos=pos,\n                      subject='sample',\n                      mri_head_t=estim_trans,\n                      subjects_dir=op.join(data_path, 'subjects')\n                      )\n\n# Plot it\nfig, axs = plt.subplots(3, 1)\nfor point_idx, label in enumerate(('LPA', 'NAS', 'RPA')):\n    plot_anat(t1_mgh_fname, axes=axs[point_idx],\n              cut_coords=mri_pos[point_idx, :],\n              title=label)\n\n\n###############################################################################\n# .. LINKS\n#\n# .. _coregistration GUI:\n#    https://martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html#defining-the-headmri-trans-using-the-gui  # noqa: E501\n# .. _mne_source_coords:\n#    https://www.martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html  # noqa: E501\n# .. _mne_sample_data:\n#    https://martinos.org/mne/stable/manual/sample_dataset.html\n#\n", "path": "examples/convert_mri_and_trans.py"}], "after_files": [{"content": "\"\"\"\n==========================================================================\nSave and load T1-weighted MRI scan along with anatomical landmarks in BIDS\n==========================================================================\n\nWhen working with MEEG data in the domain of source localization, we usually\nhave to deal with aligning several coordinate systems, such as the coordinate\nsystems of ...\n\n- the head of a study participant\n- the recording device (in the case of MEG)\n- the anatomical MRI scan of a study participant\n\nThe process of aligning these frames is also called coregistration, and is\nperformed with the help of a transformation matrix, called ``trans`` in MNE.\n\nIn this tutorial, we show how ``MNE-BIDS`` can be used to save a T1 weighted\nMRI scan in BIDS format, and to encode all information of the ``trans`` object\nin a BIDS compatible way.\n\nFinally, we will automatically reproduce our ``trans`` object from a BIDS\ndirectory.\n\nSee the documentation pages in the MNE docs for more information on\n`source alignment and coordinate frames <mne_source_coords_>`_\n\n.. note:: For this example you will need to install ``matplotlib`` and\n          ``nilearn`` on top of your usual ``mne-bids`` installation.\n\n\"\"\"\n# Authors: Stefan Appelhoff <stefan.appelhoff@mailbox.org>\n# License: BSD (3-clause)\n\n###############################################################################\n# We are importing everything we need for this example:\n\nimport os.path as op\nimport shutil as sh\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom nilearn.plotting import plot_anat\nimport mne\nfrom mne.datasets import sample\nfrom mne.source_space import head_to_mri\n\nfrom mne_bids import (write_raw_bids, make_bids_basename, write_anat,\n                      get_head_mri_trans)\nfrom mne_bids.utils import print_dir_tree\n\n###############################################################################\n# We will be using the `MNE sample data <mne_sample_data_>`_ and write a basic\n# BIDS dataset. For more information, you can checkout the respective\n# :ref:`example <ex-convert-mne-sample>`.\n\ndata_path = sample.data_path()\nevent_id = {'Auditory/Left': 1, 'Auditory/Right': 2, 'Visual/Left': 3,\n            'Visual/Right': 4, 'Smiley': 5, 'Button': 32}\nraw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')\nevents_data = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw-eve.fif')\noutput_path = op.abspath(op.join(data_path, '..', 'MNE-sample-data-bids'))\nif op.exists(output_path):\n    sh.rmtree(output_path)\nraw = mne.io.read_raw_fif(raw_fname)\nsub = '01'\nses = '01'\ntask = 'audiovisual'\nrun = '01'\nbids_basename = make_bids_basename(subject=sub, session=ses, task=task,\n                                   run=run)\nwrite_raw_bids(raw, bids_basename, output_path, events_data=events_data,\n               event_id=event_id, overwrite=True)\n\n# Print the directory tree\nprint_dir_tree(output_path)\n\n###############################################################################\n# Now let's assume that we have also collected some T1 weighted MRI data for\n# our subject. And furthermore, that we have already aligned our coordinate\n# frames (using e.g., the `coregistration GUI`_) and obtained a transformation\n# matrix :code:`trans`.\n\n# Get the path to our MRI scan\nt1_mgh_fname = op.join(data_path, 'subjects', 'sample', 'mri', 'T1.mgz')\n\n# Load the transformation matrix and show what it looks like\ntrans_fname = op.join(data_path, 'MEG', 'sample',\n                      'sample_audvis_raw-trans.fif')\ntrans = mne.read_trans(trans_fname)\nprint(trans)\n\n###############################################################################\n# We can save the MRI to our existing BIDS directory and at the same time\n# create a JSON sidecar file that contains metadata, we will later use to\n# retrieve our transformation matrix :code:`trans`.\n\n# We use the write_anat function\nanat_dir = write_anat(bids_root=output_path,  # the BIDS dir we wrote earlier\n                      subject=sub,\n                      t1w=t1_mgh_fname,  # path to the MRI scan\n                      session=ses,\n                      raw=raw,  # the raw MEG data file connected to the MRI\n                      trans=trans,  # our transformation matrix\n                      verbose=True  # this will print out the sidecar file\n                      )\n\n# Let's have another look at our BIDS directory\nprint_dir_tree(output_path)\n\n###############################################################################\n# Our BIDS dataset is now ready to be shared. We can easily estimate the\n# transformation matrix using ``MNE-BIDS`` and the BIDS dataset.\n\nbids_fname = bids_basename + '_meg.fif'\n\n# reproduce our trans\nestim_trans = get_head_mri_trans(bids_fname=bids_fname,  # name of the MEG file\n                                 bids_root=output_path  # root of our BIDS dir\n                                 )\n\n###############################################################################\n# Finally, let's use the T1 weighted MRI image and plot the anatomical\n# landmarks Nasion, LPA, and RPA (=left and right preauricular points) onto\n# the brain image. For that, we can extract the location of Nasion, LPA, and\n# RPA from the MEG file, apply our transformation matrix :code:`trans`, and\n# plot the results.\n\n# Get Landmarks from MEG file, 0, 1, and 2 correspond to LPA, NAS, RPA\n# and the 'r' key will provide us with the xyz coordinates\npos = np.asarray((raw.info['dig'][0]['r'],\n                  raw.info['dig'][1]['r'],\n                  raw.info['dig'][2]['r']))\n\n\n# We use a function from MNE-Python to convert MEG coordinates to MRI space\n# for the conversion we use our estimated transformation matrix and the\n# MEG coordinates extracted from the raw file. `subjects` and `subjects_dir`\n# are used internally, to point to the T1-weighted MRI file: `t1_mgh_fname`\nmri_pos = head_to_mri(pos=pos,\n                      subject='sample',\n                      mri_head_t=estim_trans,\n                      subjects_dir=op.join(data_path, 'subjects')\n                      )\n\n# Our MRI written to BIDS, we got `anat_dir` from our `write_anat` function\nt1_nii_fname = op.join(anat_dir, 'sub-01_ses-01_T1w.nii.gz')\n\n# Plot it\nfig, axs = plt.subplots(3, 1)\nfor point_idx, label in enumerate(('LPA', 'NAS', 'RPA')):\n    plot_anat(t1_nii_fname, axes=axs[point_idx],\n              cut_coords=mri_pos[point_idx, :],\n              title=label)\n\n\n###############################################################################\n# .. LINKS\n#\n# .. _coregistration GUI:\n#    https://martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html#defining-the-headmri-trans-using-the-gui  # noqa: E501\n# .. _mne_source_coords:\n#    https://www.martinos.org/mne/stable/auto_tutorials/source-modeling/plot_source_alignment.html  # noqa: E501\n# .. _mne_sample_data:\n#    https://martinos.org/mne/stable/manual/sample_dataset.html\n#\n", "path": "examples/convert_mri_and_trans.py"}]}