Home > vbmeg > functions > device > vb_msrmnt_remake_for_LF.m

vb_msrmnt_remake_for_LF

PURPOSE ^

make lightweight meg.mat or eeg.mat file for calculating leadfield

SYNOPSIS ^

function vb_msrmnt_remake_for_LF(src_file, dst_file)

DESCRIPTION ^

 make lightweight meg.mat or eeg.mat file for calculating leadfield
 [usage]
 ¡¡vb_msrmnt_remake_for_LF(src_file, dst_file)
 [input]
   src_file : <required> source MEG-MAT or EEG-MAT file
   dst_file : <optional> output file ['<src_path>/<src_name>.pos.meg(eeg).mat']
 [output]
   none
 [note]
   output file can be used as a template file the purpose of which is only
   updating position
   @see vb_posfile_remake_datafile.m
   @see vb_megfile_remake_for_LF.m
   @see vb_eegfile_remake_for_LF.m
   Output file is valid only for calculating lead field
 [history]
   2010-03-05 (Sako) initial version
   2011-06-01 (Sako) converted return values of vb_load_device to upper case

 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function vb_msrmnt_remake_for_LF(src_file, dst_file)
0002 % make lightweight meg.mat or eeg.mat file for calculating leadfield
0003 % [usage]
0004 % ¡¡vb_msrmnt_remake_for_LF(src_file, dst_file)
0005 % [input]
0006 %   src_file : <required> source MEG-MAT or EEG-MAT file
0007 %   dst_file : <optional> output file ['<src_path>/<src_name>.pos.meg(eeg).mat']
0008 % [output]
0009 %   none
0010 % [note]
0011 %   output file can be used as a template file the purpose of which is only
0012 %   updating position
0013 %   @see vb_posfile_remake_datafile.m
0014 %   @see vb_megfile_remake_for_LF.m
0015 %   @see vb_eegfile_remake_for_LF.m
0016 %   Output file is valid only for calculating lead field
0017 % [history]
0018 %   2010-03-05 (Sako) initial version
0019 %   2011-06-01 (Sako) converted return values of vb_load_device to upper case
0020 %
0021 % Copyright (C) 2011, ATR All Rights Reserved.
0022 % License : New BSD License(see VBMEG_LICENSE.txt)
0023 
0024 % --- CHECK ARGUMENTS --- %
0025 if ~exist('src_file', 'var'), src_file = ''; end
0026 if ~exist('dst_file', 'var'), dst_file = ''; end
0027 [src_file, dst_file] = inner_check_arguments(src_file, dst_file);
0028 
0029 % --- MAIN PROCEDURE --------------------------------------------------------- %
0030 %
0031 [measurement] = vb_load_device(src_file);
0032 Measurement = upper(measurement);
0033 
0034 switch Measurement
0035   case 'MEG'
0036     vb_megfile_remake_for_LF(src_file, dst_file);
0037   case 'EEG'
0038     vb_eegfile_remake_for_LF(src_file, dst_file);
0039   otherwise
0040     error('(%s) unknown Measurement : %s (%s)', ...
0041       mfilename, Measurement, src_file);
0042 end
0043 return;
0044 %
0045 % --- END OF MAIN PROCEDURE -------------------------------------------------- %
0046 
0047 % --- INNER FUNCTIONS -------------------------------------------------------- %
0048 %
0049 % --- inner_check_arguments()
0050 %
0051 function [src_file, dst_file] = inner_check_arguments(src_file, dst_file)
0052 func_ = mfilename;
0053 if isempty(src_file)
0054   error('(%s) src_file is a required parameter', func_);
0055 end
0056 
0057 if exist(src_file, 'file') ~= 2
0058   error('(%s) cannot find src_file : %s', func_, src_file);
0059 end
0060 return;
0061 %
0062 % --- end of inner_check_arguments()
0063 %
0064 % --- END OF INNER FUNCTIONS ------------------------------------------------- %
0065 
0066 % --- END OF FILE --- %

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