Home > vbmeg > functions > device > active_check > vb_plot_bad_channel.m

vb_plot_bad_channel

PURPOSE ^

SYNOPSIS ^

function ch_list = vb_plot_bad_channel(data,ix_ch,flg)

DESCRIPTION ^

 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    ch_list = vb_plot_bad_channel(data,ix_ch,flg)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 NXfig=2; NYfig=4; 
0007 nfig = 0;
0008 pfig = 1;
0009 print_mode = 0;
0010 basename = 'bad_ch';
0011 ymax = 100;
0012 
0013 %[Nch, T, Ntry] = size(data);
0014 
0015 % Find Bad Channel with large max_ratio
0016 Nbad  = length(ix_ch);
0017 
0018 dtitle = 'Input bad channel numbers';
0019 prompt = {'Bad channel numbers'};
0020 
0021 % List of bad Channel
0022 ch_list = [];
0023 ch_temp = [];
0024 
0025 figure;
0026 
0027 for n=1:Nbad
0028     nch = ix_ch(n);
0029     ch_temp = [ch_temp; nch];
0030     
0031     nfig = nfig + 1; subplot(NYfig,NXfig,nfig); 
0032 
0033     id = find(flg(nch,:) > 0);
0034     y  = data(nch,:,id);
0035     plot(y(:))
0036     xlim([0 length(y(:))])
0037     ylim([-ymax ymax])
0038     title(sprintf('Ch = %d',nch))
0039 
0040     if nfig ==NXfig*NYfig | n==Nbad, 
0041         if print_mode==1
0042             fname = sprintf('%s%d.png',basename,pfig);
0043             pfig=pfig+1;
0044             orient landscape
0045             %orient portrait
0046             print(gcf,'-dpng',fname)
0047             clf;
0048         else
0049             fmode = menu('All Channels are Bad ?',...
0050                     'YES','NO');
0051     
0052             if fmode == 2,
0053                 answer = inputdlg(prompt,dtitle);
0054                 ch_temp = sscanf(answer{1},'%d');
0055                 %ch_temp = vb_setdiff2(ch_temp,ch_good);
0056             end
0057             ch_list = [ch_list; ch_temp];
0058             ch_temp = [];
0059         end
0060         clf; nfig=0; 
0061     end;
0062 
0063 end
0064 
0065 close
0066 
0067 %ch_good = vb_setdiff2([1:Nch],ch_list);
0068 
0069 return
0070 
0071 answer = '1 2 3';
0072 ch_good = sscanf(answer,'%d')
0073 return

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