Home > vbmeg > functions > tool_box > dynamics_movie > movie > movie_left_view_create.m

movie_left_view_create

PURPOSE ^

Create movie file. The view point is left side of cortex.

SYNOPSIS ^

function movie_left_view_create(fiber_tracking_file,current_file, movie_file, Timefrom, Tfreq)

DESCRIPTION ^

 Create movie file. The view point is left side of cortex.

 [Input]
      fiber_tracking_file : [input file]  fiber tracking result file.
             current_file : [input file]  MAR dynamics file.
               movie_file : [output file] output movie file.(empty : no output)
                 Timefrom : [optional]    Time starts from (ms).
                    Tfreq : [optional]    time frequency(Hz) : default:1000


 [History]
    2014-11-10 Masa-aki Sato  Created as a test_ar_cylinder.m
    2015-12-07 rhayashi       Rename, fine-tuning and added all arguments.
    2017-12-12 Yusuke Takeda  Modified details

 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 movie_left_view_create(fiber_tracking_file, ...
0002     current_file, movie_file, Timefrom, Tfreq)
0003 % Create movie file. The view point is left side of cortex.
0004 %
0005 % [Input]
0006 %      fiber_tracking_file : [input file]  fiber tracking result file.
0007 %             current_file : [input file]  MAR dynamics file.
0008 %               movie_file : [output file] output movie file.(empty : no output)
0009 %                 Timefrom : [optional]    Time starts from (ms).
0010 %                    Tfreq : [optional]    time frequency(Hz) : default:1000
0011 %
0012 %
0013 % [History]
0014 %    2014-11-10 Masa-aki Sato  Created as a test_ar_cylinder.m
0015 %    2015-12-07 rhayashi       Rename, fine-tuning and added all arguments.
0016 %    2017-12-12 Yusuke Takeda  Modified details
0017 %
0018 % Copyright (C) 2011, ATR All Rights Reserved.
0019 % License : New BSD License(see VBMEG_LICENSE.txt)
0020 
0021 %
0022 % --- Previous check
0023 %
0024 if exist(fiber_tracking_file, 'file') ~= 2
0025     error('fiber_tracking_file not found.');
0026 end
0027 if exist(current_file, 'file') ~= 2
0028     error('current_file not found.');
0029 end
0030 if ~exist('movie_file', 'var')
0031     movie_file = [];
0032 elseif ~isempty(movie_file)
0033     [p_, f_, e_] = fileparts(movie_file);
0034     if exist(p_, 'dir') ~= 7
0035         mkdir(p_);
0036     end
0037 end
0038 
0039 if ~exist('Timefrom', 'var')
0040     Timefrom = 0;     % [ms]
0041 end
0042 if ~exist('Tfreq', 'var')
0043     Tfreq = 1000; % [Hz]
0044 end
0045 
0046 %
0047 % --- Main Procedure
0048 %
0049 
0050 %------- Plot parameter
0051 plot_para.conn_file = fiber_tracking_file;
0052 plot_para.curr_file = current_file;
0053 
0054 %--- figure parameter
0055 plot_para.fig_unit = 'pixels';
0056 plot_para.fig_pos  = [200, 200, 768, 720];
0057 
0058 %--- brain surface
0059 plot_para.faceclr = [0.8 0.7 0.6];
0060 plot_para.faceclr0 = [1 1 1];% face color of brain
0061 plot_para.alpha = [0.1 0.1 0.01];% alpha value of brain
0062 
0063 %--- face surface
0064 plot_para.face_on    = 1; % =1:plot face
0065 plot_para.alpha_face = 0.5; % Initial alpha value of face
0066 plot_para.face_file  = which('Subject.face.mat');
0067 plot_para.zoom_factor= 1.3; % zoom factor when a face disappears
0068 
0069 %--- area surface
0070 plot_para.alpha_area = [0.8 0.08 0.01]; % alpha value of area
0071 plot_para.cbox = 0;                     % show area color update dialog
0072 
0073 %--- view angle
0074 plot_para.angle = [-90 0];% initial view angle
0075 plot_para.dang = [0 0];% increment of view angle in one step
0076 plot_para.Ntime = 0;% number of times for rotation
0077 
0078 %--- ROI area surface
0079 plot_para.roi = 0; %=1: show ROI surface
0080 
0081 % Time length & speed
0082 plot_para.Tfreq   = Tfreq;
0083 plot_para.Timefrom= Timefrom;  % time (ms) starts from (for display)
0084 plot_para.Tstay   = 100; % time length (sample) for first non-rotate state
0085 plot_para.Tstop   = 600; % time point (sample) of stop rotation.
0086 
0087 %--- connection line
0088 plot_para.Nskip = 1;% skip number for connections selection
0089 plot_para.Nstep = 1;% skip number along path (neighbor distance= Nstep*0.2mm)
0090 %plot_para.Ndivide = 50;% number of division of connection line
0091 %plot_para.Nperiod = 100;% time window length
0092 
0093 %--- activity transition movie
0094 plot_para.pmove   = 1;%=1: show activity transition movie
0095 plot_para.pause1  = 0.01;% pause time(sec)
0096 plot_para.pause2  = 0.05;%           (sec)
0097 
0098 plot_para.dN    = 10;% number of cylinder points
0099 plot_para.dr    = 0.3;% radius of cylinder [mm]
0100 %plot_para.sigma = 0.1;% input noise sd
0101 plot_para.omega = 0.5;% oscillation speed of dynamics [no dynamics file case]
0102 
0103 plot_para.show_max = 1; % max value for caxis
0104 plot_para.abs_mode = 1;%=1: show absolute value of activity
0105 plot_para.max_norm = 1;%=1: normalize activity by max value for each vertex
0106 plot_para.wmulti  = 0; %=1: multiply MAR weight
0107 plot_para.vertex_show = 2;% =1: show vertex activity
0108 plot_para.Msize   = 10; % marker size
0109 plot_para.th_show = 0.8; % threshold to show vertex activity
0110 
0111 %--- message box for stop rotation
0112 plot_para.mbox = 0;
0113 plot_para.video = 0;
0114 if ~isempty(movie_file)
0115     plot_para.video = 1;
0116     plot_para.video_dir = p_;
0117 end
0118 
0119 % color map for connection line
0120 color_parm.Nlevel  = 64; % gradation color level
0121 color_parm.Nwidth  = 13; % active color region length
0122 color_parm.Ncycle  = 20; % cycle length
0123 color_parm.Nrepeat = 5;  % repeat number of active cycle
0124 color_parm.Nback   = 21;  % repeat number of background cycle
0125 color_parm.mode = 'gradation'; % color map mode ('gradation','jet','hot')
0126 
0127 %----- colormap for connection
0128 color_parm.active_color = 'white'; % color name for active state
0129 color_parm.rest_color   = 'navyblue';  % color name for rest state
0130 color_parm.back_color   = 'blue';      % color name for background
0131 
0132 %---> Set colormap
0133 %C1  = cmap_move(color_parm);
0134 C1 = cmap_move2(color_parm);
0135 %colorbar; colormap(C1);
0136 
0137 %----- colormap for vertex
0138 color_parm.active_color = 'yellow';      % color name for active state
0139 color_parm.rest_color   = 'orange';      % color name for rest state
0140 color_parm.back_color   = 'bottlegreen'; % color name for background
0141 %---> Set colormap
0142 C2 = cmap_move2(color_parm);
0143 
0144 %----- set colormap
0145 plot_para.cmap  = C1;
0146 plot_para.cmap2 = C2;
0147 
0148 %----- Load Connection data
0149 connection = load_connection_from_vmni_connect_file(plot_para.conn_file);
0150 
0151 %----- Create movie
0152 close all;
0153 [hfig, Q, id] = plot_cylinder_prepare(connection, plot_para);
0154 set(gca, 'Position', [0.0500    0.1100    0.7750    0.8150]);
0155 %    colorbar;
0156 plot_cylinder_anime(plot_para, hfig, Q, id);
0157 
0158 if plot_para.video
0159     [success, message] = movefile(fullfile(p_, 'cylinder.avi'), movie_file);
0160     if success
0161         disp(['left view: ' movie_file ' was created.']);
0162     else
0163         error(message);
0164     end
0165 end

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