Home > vbmeg > demo > test_scripts > vb_test_bad_trial.m

vb_test_bad_trial

PURPOSE ^

vb_test_bad_trial

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 vb_test_bad_trial
 check bad trials

 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 % vb_test_bad_trial
0002 % check bad trials
0003 %
0004 % Copyright (C) 2011, ATR All Rights Reserved.
0005 % License : New BSD License(see VBMEG_LICENSE.txt)
0006 clear all
0007 
0008 % [actfile   '.info.mat']
0009 %  : file name to save bad channel/trial info for batch mode
0010 %    or save trial statics without channel/trial rejection
0011 % [stat_file '.info.mat']
0012 %  : file name having trial statics made at the previous job
0013 %
0014 % job_mode for 'vb_job_bad_trial'
0015 %      1: channel/trial rejection in batch mode
0016 %      5: channel/trial rejection interactively
0017 %     10: save trial statics to actfile without channel/trial rejection
0018 
0019 job_mode  = 5;
0020 data_mode = 2;
0021 
0022 switch    data_mode
0023 case    1
0024     % MEG epoch data
0025     root_dir  = [getenv('MATHOME') '/Sekiyama'];
0026     data_file = {'AM090311a_voice_mik_B'};
0027     ext = '_epoch.meg.mat';
0028     stat_file = [];
0029     actfile   = [root_dir '/' 'test' ];
0030 case    2
0031     % EEG epoch data
0032     root_dir  = [getenv('MATHOME') '/BCI_SK/epoch_data01/080903'];
0033     data_file = {'Sako_20080903_01'; 'Sako_20080903_02'};
0034     ext = '_epoch.eeg.mat';
0035     stat_file = [];
0036     actfile   = [root_dir '/' 'test' ];
0037 case    3
0038     % Statics data
0039     root_dir  = [getenv('MATHOME') '/BCI_SK/epoch_data01/080903'];
0040     data_file = [];
0041     ext = '_epoch.eeg.mat';
0042     stat_file = [root_dir '/SK_all'];
0043     actfile   = [root_dir '/' 'test' ];
0044 end
0045 
0046 Nfile = length(data_file);
0047 
0048 for n=1:Nfile
0049     data_file{n} = [root_dir '/' data_file{n}  ext];
0050 end
0051 
0052 
0053 % ---- Threshold value for bad channel selection
0054 % - thred_val = [9 8];
0055 %   threshold value for [ymax/ystd, difmax/difstd] in one trial
0056 %   if (ymax/ystd) > thred_val(1) | difmax/difstd > thred_val(2),
0057 %      it is marked as bad
0058 % - prob_val  = 0.023;
0059 %   threshold probability to select bad channel
0060 %   if more than (prob_val*Ntrial) trials are bad, the channel is rejected
0061 % - thred_ch  = 1/4;
0062 %   if more than (Nch*thred_ch) channels are bad, the trial is rejected
0063 thred_val = [9 9]; 
0064 thred_ch = 1/4;
0065 prob_val = 0.025;
0066 
0067 % check trial statics for data_file
0068 
0069 switch    job_mode
0070 case    {0,1,2,10}
0071     [fileinfo] = vb_job_bad_trial(data_file,job_mode, ...
0072         thred_val, prob_val, thred_ch, actfile, stat_file);
0073 case    {5,6,7,8}
0074     [fileinfo] = vb_job_bad_trial_interact(data_file,job_mode, ...
0075         thred_val, prob_val, thred_ch, actfile, stat_file);
0076 end

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