Sunday, December 26, 2010

Re: MEGANTI notes

I think it should be a good idea to use the same protocols for naming, folder structures, and especially important for the naming of Matlab scripts if we analyze different MEG projects under one server. This fig shows the steps for analysis, will show more detail when I have time.

MEG dataset are under folder:
XX is each subject's initial.

Preprocessing first step: Marker files.

It is to find out the events of interest and save the timestamps of each event into text files for further epoching the datasets (for example, "Instruction", "GO_cue", etc.

Each subject's main marker file "MarkerFile.mrk" is under each subject's raw MEG dataset. e.g. subject AB's main marker file is under:
The marker file could be open with any text editor.Please refer to Jason's notes for the meaning of the events in the MarkerFile.mrk ("LightOn", "LightOff"...) and Presentation's log files. 

I usually copy each subject's main marker file to the folder where I save Presentation's log file, e.g. /root/MEGANTI/data/00_gain/XX (XX is subject's initial, I think I only did for subject SW).  After I am done with all the event's marker, I will copy the marker files (e.g. Instruction.txt, Go_cue.txt) to /root/MEGANTI/data/XX/markers
You only need two columns in each event's marker file, first column is the trial number, the second column is the offset from where the current trial begins (this "trial" is the trial length for MEG recording = 20 s/trial, not the actual the experiment's trial length). 
Marker file "Instruction.txt" should be something like this:
            +0            +4.273600
            +2            +3.158400
            +2            +13.193600
            +2            +17.808000
            +3            +2.544000
            +5            +2.974400
            +6            +7.227200
            +6            +16.692800
            +7            +0.710400
            +9            +2.710400
            +9            +11.494400
            +11            +12.478400
            +15            +4.347200
            +16            +19.947200
            +17            +13.998400
            +18            +3.448000
            +19            +9.979200

Second step: adding markers and epoching

All the linux scripts are saved under:

After we are done with all the event's marker files for each subject, we should then copy each subject's marker files (e.g. Instruction.txt, Go_cue.txt) to /root/MEGANTI/data/XX/markers.  Next, we will need to write scripts for adding the markers to the raw dataset and epoching the data.
(a) Adding the markers:
e.g. For subjecg SW, we first log onto the Linux console with root account, then run:
export dataHome=~/MEGANTI/data
cd $dataHome/SW
export RAW_DS=S02_MEG54_VEF_02.ds
addMarker -f -n
Instructions -l red -p markers/Instructions.txt $RAW_DS
(This marker "Instructions" would now be added to the main marker file)

(b) Epoching. After adding the markers, we run newDs to generate new datasets:
newDs -f -overlap 3 -marker "Instructions -time -2 2.5 $RAW_DS SW_Instructions_-2.25_2.45.ds

Third step: Creating multi-sphere head models
To be continued...
Fiducial markers are under:

(1) The MRI files need to be converted into CTF v2 format .mri file before we could run the headmodeling scripts
(2) The head modeling scripts must be run from Matlab GUI.
(3) Convention: the .mri file should be under each subject's home folder (/root/MEGANTI/data/XX/), the raw dataset usually are taken as the default dataset for creating head models.
e.g.  makeHeadModels('/root/MEGANTI/data/SW/SW_V2.mri', '/root/MEGANTI/data/SW/S02_MEG54_VEF_02.ds') 

Fourth step:run event-related beamformers:
To be continued...

No comments:

Post a Comment