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

vb_plot_max_ratio_image

PURPOSE ^

SYNOPSIS ^

function vb_plot_max_ratio_image(ratio,thred_val,thred_max)

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    vb_plot_max_ratio_image(ratio,thred_val,thred_max)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 % candidate of threshold value
0007 if nargin < 2, thred_val = [5:10]; end;
0008 % max of threshold value
0009 if nargin < 3, thred_max = max(thred_val) + 0.1;end; 
0010 
0011 Nthre = length(thred_val);
0012 
0013 [Nch, Ntry] = size(ratio);
0014 
0015 % limit max value for image plot
0016 ratio = min(ratio,thred_max);
0017 
0018 % plot bad channel & trial in 2D image (# of threshold = 1)
0019 if Nthre==1,
0020     ratiov = zeros(Nch, Ntry);
0021     
0022     ix = find(ratio > thred_val);
0023     ratiov(ix) = ratio(ix);
0024     
0025     image(ratiov, 'CDataMapping','scaled');
0026     xlabel('Trials')
0027     ylabel('Channels')
0028     return
0029 end
0030 
0031 % plot bad channel & trial in 2D image (# of threshold > 1)
0032 NYfig=2; 
0033 NXfig=ceil(Nthre/NYfig);
0034 nfig = 1;
0035 figure;
0036 
0037 for n=1:Nthre
0038     subplot(NYfig,NXfig,nfig); nfig = nfig + 1;
0039     ratiov = zeros(Nch, Ntry);
0040     
0041     ix = find(ratio > thred_val(n));
0042     ratiov(ix) = ratio(ix);
0043     
0044     image(ratiov, 'CDataMapping','scaled');
0045     title(sprintf('Threshold=%5.1f',thred_val(n)))
0046 end
0047 
0048 subplot(NYfig,NXfig,NXfig+1); 
0049 xlabel('Trials')
0050 ylabel('Channels')
0051

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