/mef_reader_fieldtrip

FieldTrip external toolbox to read MEF 2.1, 3.0 and MED 1.0 formatted datasets

Primary LanguageMATLABGNU General Public License v3.0GPL-3.0

MED/MEF Data Format FieldTrip External Toolbox (mef_reader_fieldtrip)

License GitHub tag (the latest by date)

Introduction

mef_reader_fieldtrip is a Fieldtrip external toolbox that reads data compressed in Multiscale Electrophysiology Format (or Mayo EEG File, MEF) and, an upgraded format, Multiscale Electrophysiology Data (MED). Current version is capable of reading MEF Version 2.1, 3.0 and MED version 1.0 files. The code of mef_reader_fieldtrip is hosted on Github repository. The backbone of the toolbox is a C-MEX package which is also employed in MEF_import to import MEF/MED datasets into EEGLAB.

Installation

  1. From Dark Horse Neuro, Inc download and install MED 1.0 reader read_MED for your computer operating system.

    addpath(genpath('/path/to/DHN/root'))
  2. Download and install FieldTrip. Assume that the root directory of FieldTrip is /path/to/fieldtrip/root/folder. (Please note that at present, mef_reader_fieldtrip has not been merged officially into FieldTrip. You may download a fork of FieldTrip here, where the toolbox has been installed).

    addpath('/path/to/fieldtrip/root/folder')
    ft_defaults
  3. Download mef_reader_fieldtrip package and unzip it if necessary.

  4. If the version of Fieldtrip is not capable of recognizing MEF data type, look for the directory fieldtrip in mef_reader_fieldtrip package and then copy it to the root directory of FieldTrip /path/to/fieldtrip/root/folder.

  5. Otherwise, check the external directory of Fieldtrip. If the folder mayo_mef exists, go to next step. If not, only copy the folder mayo_mef under the directory external of mef_reader_fieldtrip package to the external directory of FieldTrip.

  6. In MATLAB, install the mayo_mef external toolbox by typing command

    ft_hastoolbox('mayo_mef', 1)
  7. If necessary, make mex files by typing command

    setup_mayo_mex

    or do testing by typing command

    test_mayo_mef

    in MATLAB command window.

Sample data

A sample dataset (~1.24 GB) of MED 1.0 and MEF 2.1/3.0 is provided from box.com, or from Open Science Framework (OSF). Look for the folder sample_mef and download it to your local computer. To test the toolbox using the sample data, open test_mayo_mef.m under directory /path/to/fieldtrip/root/folder/test and modify the variables according to the locations of the dataset. Three additional examples of reading MED/MEF datasets, ft_example_read_med1p0.m, ft_example_read_mef2p1.m and ft_example_read_mef3p0.m are included in folder sample_mef as well.

% =========================================================================
% Note of sample dataset
% =========================================================================
% Follow the instructions
% (https://www.fieldtriptoolbox.org/faq/should_i_add_fieldtrip_with_all_subdirectories_to_my_matlab_path/)
% to add FieldTrip to your MATLAB path. Then, download the sample
% dataset from https://github.com/jiecui/mef_reader_fieldtrip and follow
% the instructions to download the sample dataset. Set the path to the
% sample dataset below.

% set path to sample dataset
% --------------------------
% please set the path to sample dataset
mef21_data = '/path/to/sample_mef/mef_2p1';
mef30_data = '/path/to/sample_mef/mef_3p0.mefd';
med10_data = '/path/to/sample_mef/med_1p0.medd';

Set the locations of the dataset in the last three lines of above code block in test_mayo_mef.m and then execute command test_mayo_mef in MATLAB.

Acknowledgment

Multiscale Electrophysiology Format (MEF) is a novel electrophysiology file format designed for large-scale storage of electrophysiological recordings. MEF can achieve significant data size reduction when compared to existing techniques with stat-of-the-art lossless data compression. It satisfies the Health Insurance Portability and Accountability Act (HIPAA) to encrypt any patient protected health information transmitted over a public network. The details of MEF file can be found at here from Mayo Systems Electrophysiology Lab and here on International Epilepsy Portal. The c-mex code to read MED 1.0, MEF 2.1 and MEF 3.0 data are mainly developed from the work done by Matt Stead from Dark Horse Neuro, Inc, and Ben Brinkmann, Dan Crepeau, and Gregory Worrell from Mayo Systems Electrophysiology Lab, Mayo Clinic, Rochester, MN, USA.

License

mef_reader_fieldtrip is distributed with the GPL v3 Open Source License.