ReadingDataInMatlab - Meg Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Type the missing letters from: He's no ded, he's jus resing hs eys

location: ReadingDataInMatlab

Opening fif-files in Matlab

This can be done using the FiffAccess toolbox. The toolbox and the manual can be downloaded from here:

The functions are installed on the CBU network on the path: /neuro/mce/meg_1.2/

Some particularly useful commands include:

• To get information about all the channels in a fif-file: [NAME, TYPE, NUMBER, COILTYPE, TRANSFORM] = CHANNAMES (FILENAME)

• To load evoked responses:

• To load continuous data from specified channels: [DATA, SAMPFREQ, T0] = RAWCHANNELS (FILENAME, CHANNELNAMES, TIMERANGE)

For more information on any command, type: help <command> at the Matlab prompt.

To load raw data, there is one extra initial step required. The FiffAccess toolbox does not (yet) understand data in the 32-bit integer format that our MEG machine produces, but only supports 16-bit integers and 32-bit floating point numbers. Fortunately, you can convert your data into floating point format using the MaxFilter program (you do not need to actually filter the data if you don't want to). The command:

  • /neuro/bin/util/maxfilter -f infile.fif -nosss -format float

should do it (and if you leave out the -nosss it of course filters the data as well). You can achieve the same result using the MaxFilter GUI.

Some examples of scripts which use these commands to save evoked responses and continuous data to .mat files, and then plot summary graphs of the evoked time-courses and signal variance per channel can be found here.

-- DannyMitchell 2007-03-09 11:22:36