Home > vbmeg > functions > tool_box > dynamics_movie > test_fig > basic_tool > cmap_move.m

cmap_move

PURPOSE ^

----- colormap for moving signal

SYNOPSIS ^

function C = cmap_move(para)

DESCRIPTION ^

----- colormap for moving signal
   C = cmap_move(para)
 para.Nlevel  =  gradation color level
 para.Nwidth  =  active color region length
 para.Ncycle  =  cycle length
 para.Nrepeat =  repeat number of active cycle
 para.Nback   =  repeat number of background cycle
 para.mode    =  nonlibear map for active color {'exp' , 'gauss'}
 
 para.active_color =  color name for active state
 para.rest_color   =  color name for rest state
 para.back_color   =  color name for background

 2014-11-10 Masa-aki Sato

 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    C = cmap_move(para)
0002 %----- colormap for moving signal
0003 %   C = cmap_move(para)
0004 % para.Nlevel  =  gradation color level
0005 % para.Nwidth  =  active color region length
0006 % para.Ncycle  =  cycle length
0007 % para.Nrepeat =  repeat number of active cycle
0008 % para.Nback   =  repeat number of background cycle
0009 % para.mode    =  nonlibear map for active color {'exp' , 'gauss'}
0010 %
0011 % para.active_color =  color name for active state
0012 % para.rest_color   =  color name for rest state
0013 % para.back_color   =  color name for background
0014 %
0015 % 2014-11-10 Masa-aki Sato
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 active_color = rgb_val_get(para.active_color);
0021 rest_color   = rgb_val_get(para.rest_color  );
0022 back_color   = rgb_val_get(para.back_color  );
0023 
0024 %---- Make base gradation color
0025 C0 = cmap_gradation([active_color; rest_color], para.Nlevel);
0026 
0027 %---- nonlibear map for active color
0028 cmax = para.Nlevel;
0029 cmin = ceil( max(cmax/10, 1));
0030 
0031 ix = nonlinear_map(cmax,cmin, para.Nwidth, para.mode);
0032 Cact = C0(ix,:);
0033 
0034 %---- cycle of active-rest color
0035 Cact_cycle = cmap_cycle(Cact, back_color, para.Ncycle, para.Nrepeat);
0036 
0037 %---- add background color region
0038 Cback = cmap_cycle(back_color,back_color, para.Ncycle * para.Nback,1);
0039 
0040 C  = [Cback; Cact_cycle];
0041 
0042 %----------------END-----------------
0043 plot_mode=0;
0044 
0045 if plot_mode==0, return; end;
0046 
0047 %----------------Plot-----------------
0048 subplot(2,2,1)
0049 colorbar_plot(C0)
0050 title('Base gradation map')
0051 xlim([1 size(C0,1)])
0052 
0053 subplot(2,2,2)
0054 colorbar_plot(Cact)
0055 title('Gaussian transformed active color map')
0056 xlim([1 size(Cact,1)])
0057 
0058 subplot(2,2,3)
0059 colorbar_plot(Cact_cycle)
0060 title('Active color cycle')
0061 xlim([1 size(Cact_cycle,1)])
0062 
0063 subplot(2,2,4)
0064 colorbar_plot(C)
0065 title('Combined color map')
0066 xlim([1 size(C,1)])

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