Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


The code in this repository allows you to analyze MEG data with decoding analysis as in Isik et al., 2014. 
You can take MEG .fif files preprocess them with Brainstorm software (,  convert them into raster format (), and run decoding analysis using the Neural Decoding Toolbox (
Preprocess MEG data with Brainstorm
* Download/set brainstorm databse locations based according to tutorial
* File --> New protocol (individual or default anatomy)
* Run load_bandpass script while Brainstorm is open
preprocess_with_brainstorm(Ô[MEG_raw_data_directory]/Subject01Õ, {Ôcbcl000.fifÕ, Ôcbcl000-1.fifÕ}, [-.2, .6]);

Convert Brainstorm .mat files to raster format
* Brainstorm saves processed .mat files in folder: brainstorm_db/<protocol_name>/data/<subject_name>/<trigger_number> 
* Run convert_to_raster.m to save pre-processed files in raster format for decoding toolbox (more information on this data format at
convert_to_raster(Ô[brainstorm_directory]/brainstorm/brainstorm_dbÕ, ÔSubject01Õ, ÔSubject01_labels.matÕ, Ô[raster_directory]/Subjecto01_rastersÕ, 801);

Run decoding using neural decoding toolbox
* Download neural decoding toolbox (
* Copy @avg_DS and @avg_generalization_DS to datasources folder in the toolbox directory
* Run run_decoding.m 
* For more information on decoding parameters, visit
e.g. without invariance:

run_decoding(ÔSubject01Õ, [toolbox_path], [raster_directory], Ô[bin_directory]Õ, Ô[results_directory]Õ, Ôscene_decodingÕ, Ôstim_IDÕ, 1:25, 1:25, 5, 10, 5,5,10,25,5,1);

e.g. with invariance: 

run_decoding(ÔSubject04Õ, [toolbox_path], [raster_directory], Ô[bin_directory]Õ, Ô[results_directory]Õ, 'train_large_test_mid', 'size_pos_stim_ID', {111,112,113,114,115,116}, {211,212,213,214,215,216}, 5, 10, 5,5, 10, 25, 2, 1)

You can’t perform that action at this time.