Home > functions > device > active_check > vb_save_active_info.m

vb_save_active_info

PURPOSE ^

Save active info for multiple session file data

SYNOPSIS ^

function vb_save_active_info(fileinfo, outfile, cond_list, session_no)

DESCRIPTION ^

 Save active info for multiple session file data
   vb_save_active_info(fileinfo, outfile, cond_list, session_no)
 --- Input 
 fileinfo : file information for multiple session files
 outfile  : Output file name (saved variable : 'fileinfo')
 --- Optional Input 
 cond_list  : list of condition number to select
              if empty, all conditions are selected
 session_no : session number to select
              if empty, all sessions are selected
 
 --- Saved variable
 fileinfo : structure with file information for multiple files
 fileinfo.filename{n}  : n-th session data file names [n=1:Nsession]
 fileinfo.Nchannel     : # of total channels
 fileinfo.channel_id   : active channel id [1 x (# of acticeChannel)]
 fileinfo.Nsample      : # of samples in one trial
 fileinfo.Ntotal       : # of all trials 
 fileinfo.Ntrial       : # of trials for each session [1 x Nsession]
 fileinfo.session_id   : session index for each trial [1 x Ntotal]
 fileinfo.cond_id      : condition number for each trials [1 x Ntotal]
  - The above fields have info. for all trials in multiple epoch files
  - following fields are active trial info.
 fileinfo.act_trial    : active trial index among all trials [1 x Nactive]
 fileinfo.err_trial    : error trial index  [1 x Nerror]
 fileinfo.cond_list    : selected condition numbers
 fileinfo.session_no   : selected session numbers

 Masa-aki Sato 2008-8-10

 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_save_active_info(fileinfo, outfile, cond_list, session_no)
0002 % Save active info for multiple session file data
0003 %   vb_save_active_info(fileinfo, outfile, cond_list, session_no)
0004 % --- Input
0005 % fileinfo : file information for multiple session files
0006 % outfile  : Output file name (saved variable : 'fileinfo')
0007 % --- Optional Input
0008 % cond_list  : list of condition number to select
0009 %              if empty, all conditions are selected
0010 % session_no : session number to select
0011 %              if empty, all sessions are selected
0012 %
0013 % --- Saved variable
0014 % fileinfo : structure with file information for multiple files
0015 % fileinfo.filename{n}  : n-th session data file names [n=1:Nsession]
0016 % fileinfo.Nchannel     : # of total channels
0017 % fileinfo.channel_id   : active channel id [1 x (# of acticeChannel)]
0018 % fileinfo.Nsample      : # of samples in one trial
0019 % fileinfo.Ntotal       : # of all trials
0020 % fileinfo.Ntrial       : # of trials for each session [1 x Nsession]
0021 % fileinfo.session_id   : session index for each trial [1 x Ntotal]
0022 % fileinfo.cond_id      : condition number for each trials [1 x Ntotal]
0023 %  - The above fields have info. for all trials in multiple epoch files
0024 %  - following fields are active trial info.
0025 % fileinfo.act_trial    : active trial index among all trials [1 x Nactive]
0026 % fileinfo.err_trial    : error trial index  [1 x Nerror]
0027 % fileinfo.cond_list    : selected condition numbers
0028 % fileinfo.session_no   : selected session numbers
0029 %
0030 % Masa-aki Sato 2008-8-10
0031 %
0032 % Copyright (C) 2011, ATR All Rights Reserved.
0033 % License : New BSD License(see VBMEG_LICENSE.txt)
0034 
0035 if nargin < 2, 
0036     help vb_save_active_info
0037     error('Input argument error'); 
0038 end;
0039 
0040 if nargin < 3, cond_list  = [];end
0041 if nargin < 4, session_no = [];end
0042 
0043 %if ~exist('cond_list','var'), cond_list = []; end;
0044 %if ~exist('session_no','var'), session_no = []; end;
0045 
0046 % select condition & session
0047 fileinfo = vb_get_active_cond(fileinfo,cond_list,session_no);
0048 
0049 Measurement = 'INFO';
0050 
0051 fprintf('Total %d channel & %d epoch\n',fileinfo.Nchannel, fileinfo.Ntotal)
0052 fprintf('Good  %d channel & %d epoch\n',...
0053     length(fileinfo.channel_id), length(fileinfo.act_trial))
0054 
0055 fprintf('Save active info to: \n%s\n',outfile)
0056 
0057 vb_fsave(outfile, 'fileinfo','Measurement');

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