Session 11 - MEG MNE Flashcards
(133 cards)
What is MNE?
a Python module for analysing MEG and EEG data.
Many of the code below will run in Spyder for example, - (2)
the interactive plots are not interactive in Colab.
We will try to run our code in Spyder today but use Colab for ‘testing’
Previously, we have learned to install additional python modules using
‘pip’
To install MNE on Google Colab or Windows/Spyder machines, we enter:
To install MNE on Spyder, you type this (‘pip install mne’) on the - (2)
in the terminal to the bottom right.
Remember to ‘restart kernel’ after you do this. You might also have to set the Graphics output type to ‘QT - to ensure plots in Spyder are interactive
MEG data come in a variety of formats. Most of the existing data which is available at YNiC is from a
4-D system like this:
All the file paths in this section is relative to s8_meg directory in the material directory, so need to change the directory you are working in Spyder or replace the full paths such as.. C:\Users\gs1211\ . . .
This code is saying that:
This code fetches a specific branch (s8_meg
) from a Git repository (https://vcs.ynic.york.ac.uk/cn/pin-material.git
) and clones it into the current directory
We can check git repository is there by saying:
This command lists the contents of the directory s8_meg
within the pin-material
directory, showing details such as permissions, ownership, size, and modification time, with the most recently modified files appearing first.
We have loaded in the MNE python module. And We have loaded in the MNE python module. And we have also git-cloned some MEG data. Now we can use a
python script to look at the data:
First we want to change the directory where s8_meg live by saying the following code - (2):
This code imports the Python libraries ‘os’ and ‘mne’.
Then, it changes the current working directory to ‘/content/pin-material/s8_meg/’ using the ‘os.chdir()’ function.
For spyder to change directory we can change
os.chdir(‘/content/pin-material/s8_meg/’) to..
You need to change this on Windows - something like C:\Users\aw890\pin-material\s8_meg
What is the difference between the use of backslashes () and forward slashes (/) in file paths?
Backslashes () are typically used in Windows file paths, while forward slashes (/) are used in Unix-based systems like Linux or macOS.
What is the main difference between the organization of MEG data and fMRI data?
MEG data is organized by sensors, whereas fMRI data is organized by voxels in the brain.
How are sensors positioned in MEG data collection?
Sensors in MEG are fixed in space within a helmet, detecting brain activity at a distance.
What is the purpose of registration in MEG data analysis?
Registration ensures accurate positioning of sensors relative to the head and brain.
What is the role of a 3D digitizer like a ‘Polhemus’ in MEG data analysis?
A 3D digitizer like a ‘Polhemus’ measures head and facial features to facilitate accurate sensor positioning.
What is the next step after examining position data in an old MEG dataset?
The subsequent step involves analyzing individual MEG timecourse data.
What is the purpose of the following code snippet?
This code reads MEG data from a file and extracts different parts of the MEG dataset for analysis.
What function is used to read the MEG data from a file from mne?
The mne.io.read_raw_bti()
function from the MNE module is used to read the MEG data from the specified file.
What does this line of code mean?
raw = mne.io.read_raw_bti(‘./R1025_P1119a_4/c,rfDC’) - (2)
This line of code reads MEG data from a file of participant R1025_P1119a_4 using the read_raw_bti
function from the MNE module.
The specified file path is ‘./R1025_P1119a_4/c,rfDC’.
What is output of
raw = mne.io.read_raw_bti(‘./R1025_P1119a_4/c,rfDC’
print(raw)
What does the raw.info
object contain?
if raw = mne.io.read_raw_bti(‘./R1025_P1119a_4/c,rfDC’
The raw.info
object contains basic information about the MEG data, such as the number of channels and device information.
Outputting
print(raw.info)
raw - loaded mne data