Home > functions > job > vb_job_movie.m

vb_job_movie

PURPOSE ^

This is a sample script for executing vb_make_movie.m.

SYNOPSIS ^

function vb_job_movie

DESCRIPTION ^

 This is a sample script for executing vb_make_movie.m. 

 [history]
 2010-10-04 Taku Yoshioka

 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_job_movie
0002 % This is a sample script for executing vb_make_movie.m.
0003 %
0004 % [history]
0005 % 2010-10-04 Taku Yoshioka
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 
0010 %
0011 % File parameters
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 proj_root = ['./subjects/V001']; 
0015 
0016 % --- Input file (relative path from proj_root)
0017 brain_file   = [proj_root  '/brain/V001.brain.mat'  ];
0018 area_file    = [proj_root  '/brain/V001.area.mat'   ];
0019 meg_file     = [proj_root  '/meg/a/tfV001ax.meg.mat'];
0020 current_file = [proj_root  '/curr/tfV001a.curr.mat'];
0021 
0022 % --- Output file(relative path from proj_root)
0023 movie_file = [proj_root  '/bayes/tfV001a.avi'  ];
0024 
0025 %
0026 % Figure parameters
0027 %
0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0029 movie_parm.NX = 2;
0030 movie_parm.NY = 2;
0031 movie_parm.movie_file = movie_file;
0032 movie_parm.figpos = [100 100 640 480];
0033 movie_parm.figure_property = {'Color','k','Menubar','none', ...
0034                     'Renderer','zbuffer'};
0035 movie_parm.movie2avi_property = {'fps',8};
0036 
0037 skip = 5; 
0038 
0039 %
0040 % Subplot of movie: MEG spatio-temporal pattern
0041 %
0042 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0043 [bexp,ChannelInfo] = vb_load_meg_data(meg_file);
0044 load(meg_file,'pick');
0045 
0046 % Timecourse of MEG power
0047 subplot{1}.mode = 3;
0048 subplot{1}.sub = 1;
0049 subplot{1}.title_var = {'MEG timecourse','Color','w'};
0050 subplot{1}.bexp = sqrt(sum(bexp(:,1:500).^2,1))*1e15; 
0051 subplot{1}.Tdisp = 1:500;
0052 subplot{1}.ix_sample = 1:skip:500;
0053 subplot{1}.xlabel_var = {'Time [ms]','Color','w'};
0054 subplot{1}.ylabel_var = {'Magnetic field power [fT]','Color','w'}; 
0055 subplot{1}.axes_property = {'Fontsize',10,'XColor','w','YColor','w', ...
0056                     'Color','k'};
0057 
0058 % Select sensor
0059 ix_sensor = find(ChannelInfo.Type==2);
0060 
0061 % Contour map of MEG signal
0062 subplot{2}.mode = 2;
0063 subplot{2}.sub = 2;
0064 subplot{2}.title_var = [];
0065 subplot{2}.bexp = bexp(ix_sensor,1:500)*1e15;
0066 subplot{2}.pick = pick(ix_sensor,:);
0067 subplot{2}.clim = [-200 200];
0068 subplot{2}.cbar_var = {'EastOutside'};
0069 subplot{2}.ix_sample = 1:skip:500;
0070 subplot{2}.Tdisp = [];
0071 subplot{2}.axes_property = {'Color','k'};
0072 
0073 clear bexp;
0074 
0075 %
0076 % Subplot of movie: cortical activity
0077 %
0078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0079 
0080 % Common parameters
0081 load(current_file,'Zact','Jinfo');
0082 [V,F,xx,inf_C] = vb_load_cortex(brain_file,'Inflate');
0083 subplot{3}.mode = 1;
0084 subplot{3}.title_var = [];
0085 subplot{3}.Z = Zact(:,1:500);
0086 subplot{3}.W = Jinfo.Wact;
0087 subplot{3}.ix_act_ex = Jinfo.ix_act_ex;
0088 subplot{3}.ix_sample = 1:skip:500;
0089 subplot{3}.V = V;
0090 subplot{3}.F = F;
0091 subplot{3}.inf_C = inf_C;
0092 subplot{3}.light_flag = true;
0093 subplot{3}.plot_parm = vb_set_plot_parm;
0094 subplot{3}.Jmin = 0.1;
0095 subplot{3}.Jmax = 1.0;
0096 subplot{3}.axes_tight = false;
0097 subplot{3}.axes_equal = true;
0098 subplot{3}.axes_property = {'Color','k','XTick',[],'YTick',[],...
0099                     'ZTick',[]};
0100 clear Zact ix_act V F inf_C
0101 
0102 % Left hemisphere, lateral view
0103 subplot{3}.sub = 3; 
0104 subplot{3}.angle_var = [-90 0];
0105 subplot{3}.plot_parm.LRflag = 'L';
0106 subplot{3}.cbar_var = []; % {'EastOutside'};
0107 
0108 % Right hemisphere, lateral view
0109 subplot{4} = subplot{3}; % Copy plot parameters
0110 subplot{4}.sub = 4; 
0111 subplot{4}.angle_var = [90 0];
0112 subplot{4}.plot_parm.LRflag = 'R';
0113 
0114 % Time
0115 for i=1:500
0116   subplot{4}.Tdisp{i} ...
0117       = {1,1,sprintf('%d [ms]',i),'Color','w'};
0118 end;
0119 
0120 %
0121 % Create movie
0122 %
0123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0124 movie_parm.subplot = subplot;
0125 vb_make_movie(movie_parm); 
0126 
0127 return;

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