Home > functions > job > vb_job_import_eeg_data.m

vb_job_import_eeg_data

PURPOSE ^

import eeg data from BDF file: make mat-file

SYNOPSIS ^

function vb_job_import_eeg_data(root_dir, base_name)

DESCRIPTION ^

 import eeg data from BDF file: make mat-file
  job_import_eeg_batch(root_dir, base_name)
    root_dir.bdf  : directory of input  BDF file
    root_dir.eeg  : directory of output EEG file
    base_name : base name for BDF file to import
     if it is empty, all BDF files in root_dir.bdf are imported
    
 2009-8-9 Masa-aki Sato

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    vb_job_import_eeg_data(root_dir, base_name)
0002 % import eeg data from BDF file: make mat-file
0003 %  job_import_eeg_batch(root_dir, base_name)
0004 %    root_dir.bdf  : directory of input  BDF file
0005 %    root_dir.eeg  : directory of output EEG file
0006 %    base_name : base name for BDF file to import
0007 %     if it is empty, all BDF files in root_dir.bdf are imported
0008 %
0009 % 2009-8-9 Masa-aki Sato
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 
0015 % --- EEG data
0016 eeg_parm.Measurement = 'EEG';
0017 eeg_parm.device      = 'BIOSEMI';
0018 
0019 eeg_parm.eeginfo_version = []; % not be used
0020 eeg_parm.verbose_swt = false;
0021 
0022 % Generate BDF filename
0023 [bdf_path, bdf_name] = ...
0024         vb_get_session_filename(root_dir.bdf, base_name, '.bdf');
0025 
0026 Nfile = length(bdf_path);
0027 
0028 % --- Positioning data path - absolute path
0029 [pos_path,  pos_file]  = vb_get_ext_filename(root_dir.bdf, '.pos.mat');
0030 [face_path, face_file] = vb_get_ext_filename(root_dir.bdf, '.face.mat');
0031 
0032 if exist(pos_path,'file'),
0033     eeg_parm.pos_file  = [root_dir.eeg '/' pos_file];
0034     if ~exist(eeg_parm.pos_file,'file'),
0035         copyfile(pos_path, eeg_parm.pos_file);
0036     end
0037 else
0038     eeg_parm.pos_file  = [];
0039 end
0040 if exist(face_path,'file'),
0041     eeg_parm.face_file  = [root_dir.eeg '/' face_file];
0042     if ~exist(eeg_parm.face_file,'file'),
0043         copyfile(face_path, eeg_parm.face_file);
0044     end
0045 else
0046     eeg_parm.face_file  = [];
0047 end
0048 
0049 for n = 1:Nfile
0050     % --- Input Raw data path - absolute path
0051     eeg_parm.measurement_file = bdf_path{n};
0052     
0053     % --- Output EEG-MAT file - relative path from 'root_dir.eeg'
0054     eeg_parm.output_file  = [bdf_name{n} '.eeg.mat'];
0055     eeg_parm.bin_data_dir = ['bin_' bdf_name{n}]; 
0056      
0057      % Import EEG from raw bdf data
0058     vb_job_meg(root_dir.eeg, eeg_parm);
0059 end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005