Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tutorials/source-modeling/plot_eeg_mri_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
# which does a maximum intensity projection (easy to see the fake electrodes).
# This plotting function requires data to be in MNI space.
# Because ``img.affine`` gives the voxel-to-world (RAS) mapping, if we apply a
# RAS-to-MRI transform to it, it becomes the voxel-to-MNI transformation we
# RAS-to-MNI transform to it, it becomes the voxel-to-MNI transformation we
# need. Thus we create a "new" MRI image in MNI coordinates and plot it as:

img = nibabel.load(fname_T1_electrodes) # original subject MRI w/EEG
Expand Down Expand Up @@ -94,9 +94,9 @@
#
# >>> pos_vox = ... # loaded from a file somehow
# >>> img = nibabel.load(fname_T1)
# >>> vox2mri = img.header.get_vox2ras_tkr() # voxel -> mri
# >>> vox2mri[:3] /= 1000. # mm -> m
# >>> pos_mri = mne.transforms.apply_trans(vox2mri, pos_vox)
# >>> vox2mri_t = img.header.get_vox2ras_tkr() # voxel -> mri trans
# >>> pos_mri = mne.transforms.apply_trans(vox2mri_t, pos_vox)
# >>> pos_mri /= 1000. # mm -> m
#
# You can also verify that these are correct (or manually convert voxels
# to MRI coords) by looking at the points in Freeview or tkmedit.
Expand Down