0001 function movie_top_view_create(fiber_tracking_file, ...
0002 current_file, movie_file, Timefrom, Tfreq)
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 if exist(fiber_tracking_file, 'file') ~= 2
0028 error('fiber_tracking_file not found.');
0029 end
0030 if exist(current_file, 'file') ~= 2
0031 error('current_file not found.');
0032 end
0033 if ~exist('movie_file', 'var')
0034 movie_file = [];
0035 elseif ~isempty(movie_file)
0036 [p_, f_, e_] = fileparts(movie_file);
0037 if exist(p_, 'dir') ~= 7
0038 mkdir(p_);
0039 end
0040 end
0041
0042 if ~exist('Timefrom', 'var')
0043 Timefrom = 0;
0044 end
0045 if ~exist('Tfreq', 'var')
0046 Tfreq = 1000;
0047 end
0048
0049
0050
0051
0052
0053
0054 plot_para.conn_file = fiber_tracking_file;
0055 plot_para.curr_file = current_file;
0056
0057
0058 plot_para.fig_unit = 'pixels';
0059 plot_para.fig_pos = [200, 200, 768, 720];
0060
0061
0062 plot_para.faceclr = [0.8 0.7 0.6];
0063 plot_para.faceclr0 = [1 1 1];
0064 plot_para.alpha = [0.1 0.1 0.01];
0065
0066
0067 plot_para.face_on = 1;
0068 plot_para.alpha_face = 0.5;
0069 plot_para.face_file = which('Subject.face.mat');
0070 plot_para.zoom_factor= 1.3;
0071
0072
0073 plot_para.alpha_area = [0.8 0.08 0.01];
0074 plot_para.cbox = 0;
0075
0076
0077 plot_para.angle = [0 90];
0078 plot_para.dang = [0 0];
0079 plot_para.Ntime = 0;
0080
0081
0082 plot_para.roi = 0;
0083
0084
0085 plot_para.Tfreq = Tfreq;
0086 plot_para.Timefrom= Timefrom;
0087 plot_para.Tstay = 100;
0088 plot_para.Tstop = 600;
0089
0090
0091 plot_para.Nskip = 1;
0092 plot_para.Nstep = 1;
0093
0094
0095
0096
0097 plot_para.pmove = 1;
0098 plot_para.pause1 = 0.01;
0099 plot_para.pause2 = 0.05;
0100
0101 plot_para.dN = 10;
0102 plot_para.dr = 0.3;
0103
0104 plot_para.omega = 0.5;
0105
0106 plot_para.show_max = 1;
0107 plot_para.abs_mode = 1;
0108 plot_para.max_norm = 1;
0109 plot_para.wmulti = 0;
0110 plot_para.vertex_show = 2;
0111 plot_para.Msize = 10;
0112 plot_para.th_show = 0.8;
0113
0114
0115 plot_para.mbox = 0;
0116 plot_para.video = 0;
0117 if ~isempty(movie_file)
0118 plot_para.video = 1;
0119 plot_para.video_dir = p_;
0120 end
0121
0122
0123 color_parm.Nlevel = 64;
0124 color_parm.Nwidth = 13;
0125 color_parm.Ncycle = 20;
0126 color_parm.Nrepeat = 5;
0127 color_parm.Nback = 21;
0128 color_parm.mode = 'gradation';
0129
0130
0131 color_parm.active_color = 'white';
0132 color_parm.rest_color = 'navyblue';
0133 color_parm.back_color = 'blue';
0134
0135
0136
0137 C1 = cmap_move2(color_parm);
0138
0139
0140
0141 color_parm.active_color = 'yellow';
0142 color_parm.rest_color = 'orange';
0143 color_parm.back_color = 'bottlegreen';
0144
0145 C2 = cmap_move2(color_parm);
0146
0147
0148 plot_para.cmap = C1;
0149 plot_para.cmap2 = C2;
0150
0151
0152 connection = load_connection_from_vmni_connect_file(plot_para.conn_file);
0153
0154
0155 close all;
0156 [hfig, Q, id] = plot_cylinder_prepare(connection, plot_para);
0157 set(gca, 'Position', [0.1300 0.2300 0.7750 0.8150]);
0158
0159 plot_cylinder_anime(plot_para, hfig, Q, id);
0160
0161 if plot_para.video
0162 [success, message] = movefile(fullfile(p_, 'cylinder.avi'), movie_file);
0163 if success
0164 disp(['top view: ' movie_file ' was created.']);
0165 else
0166 error(message);
0167 end
0168 end