Home > functions > job > vb_job_import_meg_data.m

vb_job_import_meg_data

PURPOSE ^

Batch import MEG data

SYNOPSIS ^

function vb_job_import_meg_data(root_dir,meg_file,pos_file)

DESCRIPTION ^

 Batch import MEG data 
  vb_job_import_meg_data(root_dir,meg_file,pos_file)
    root_dir.raw  : Raw data file directory
    root_dir.data : MEG-mat file directory
    meg_file : MEG raw data file name
   pos_file : Positioning data path - absolute path
    
 2009-6-13 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_meg_data(root_dir,meg_file,pos_file)
0002 % Batch import MEG data
0003 %  vb_job_import_meg_data(root_dir,meg_file,pos_file)
0004 %    root_dir.raw  : Raw data file directory
0005 %    root_dir.data : MEG-mat file directory
0006 %    meg_file : MEG raw data file name
0007 %   pos_file : Positioning data path - absolute path
0008 %
0009 % 2009-6-13 Masa-aki Sato
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 % continuous file = '.con';
0015 % average file    = '.ave';
0016 % evoked file     = '.raw';
0017 
0018 % Default extension
0019 ext = '.con';
0020 
0021 ix = strfind(meg_file,'.con');
0022 if ~isempty(ix), meg_file = meg_file(1:ix-1); ext = '.con'; end;
0023 ix = strfind(meg_file,'.ave');
0024 if ~isempty(ix), meg_file = meg_file(1:ix-1); ext = '.ave'; end;
0025 ix = strfind(meg_file,'.raw');
0026 if ~isempty(ix), meg_file = meg_file(1:ix-1); ext = '.raw'; end;
0027 
0028 % --- EEG data
0029 parm.Measurement = 'MEG';
0030 parm.device      = 'YOKOGAWA';
0031 
0032 parm.yokogawa_file   = [root_dir.raw '/' meg_file ext];
0033 parm.meg_file        = [meg_file '.meg.mat'];
0034 
0035 saveman.data_dir     = ['./' meg_file];
0036 saveman.precision    = 'float64';
0037 parm.saveman         = saveman;
0038 parm.memory_max      = 10000000;
0039 
0040 % --- Positioning data path - absolute path
0041 if nargin < 3, pos_file  = []; end;
0042 
0043 if ~isempty(pos_file) && ~exist(pos_file,'file'),
0044     fprintf('No pos_file is found:%s\n',pos_file)
0045     pos_file  = [];
0046 end
0047 
0048 parm.pos_file  = pos_file ;
0049 
0050 % Import data from raw data file
0051 vb_job_meg(root_dir.data, parm);

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