Home > vbmeg > functions > template > vb_meg_parm_get_megfile.m

vb_meg_parm_get_megfile

PURPOSE ^

get MEG/EEG-MAT file from meg_parm.

SYNOPSIS ^

function [megfile, Measurement, Device] = vb_meg_parm_get_megfile(meg_parm)

DESCRIPTION ^

 get MEG/EEG-MAT file from meg_parm.
 [USAGE]
    [megfile, Measurement, Device] = vb_meg_parm_get_megfile(<meg_parm>)
 [IN]
    meg_parm : meg_parm
 [OUT]
        megfile : MEG/EEG-MAT file(relative path from proj_root)
                  ('' is returned if meg_parm is unknown format.)
    Measurement : Measurement type
         Device : Device type
 [NOTE]
    @see vb_meg_parm_set_measurement()
 [history]
   2008-05-28 changed field name for EEG

 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 [megfile, Measurement, Device] = vb_meg_parm_get_megfile(meg_parm)
0002 % get MEG/EEG-MAT file from meg_parm.
0003 % [USAGE]
0004 %    [megfile, Measurement, Device] = vb_meg_parm_get_megfile(<meg_parm>)
0005 % [IN]
0006 %    meg_parm : meg_parm
0007 % [OUT]
0008 %        megfile : MEG/EEG-MAT file(relative path from proj_root)
0009 %                  ('' is returned if meg_parm is unknown format.)
0010 %    Measurement : Measurement type
0011 %         Device : Device type
0012 % [NOTE]
0013 %    @see vb_meg_parm_set_measurement()
0014 % [history]
0015 %   2008-05-28 changed field name for EEG
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 %
0021 % --- Previous check
0022 %
0023 if ~exist('meg_parm', 'var'), error('meg_parm is a required parameter.'); end
0024 
0025 %
0026 % --- Main Procedure
0027 %
0028 [Measurement, Device] = vb_meg_parm_get_measurement(meg_parm);
0029 
0030 megfile = [];
0031 
0032 % MEG-MAT
0033 if strcmp(upper(Measurement), 'MEG')
0034     if isfield(meg_parm, 'meg_file') && ~isempty(meg_parm.meg_file)
0035         megfile = meg_parm.meg_file;
0036     else
0037         warning('meg_parm is unknown type.');
0038     end
0039 % EEG-MAT
0040 elseif strcmp(upper(Measurement), 'EEG')
0041     switch(Device)
0042         case {'BIOSEMI', 'BRAINAMP'}
0043             megfile = meg_parm.output_file;
0044         otherwise
0045             warning('meg_parm is unknown type.');
0046     end
0047 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005