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

disp_conn_data_make

PURPOSE ^

Create connection data file for display.

SYNOPSIS ^

function disp_conn_data_make(vmni_connect_file, vbmeg_brain_file, data_conn_file)

DESCRIPTION ^

 Create connection data file for display.

 [Input]
    vmni_connect_file : [input file]  vmni_connect file.
     vbmeg_brain_file : [input file]  VBMEG BRAIN-MAT file   : Subject.brain.mat
       data_conn_file : [output file] connection data file for display.

 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 disp_conn_data_make(vmni_connect_file, vbmeg_brain_file, data_conn_file) 
0002 % Create connection data file for display.
0003 %
0004 % [Input]
0005 %    vmni_connect_file : [input file]  vmni_connect file.
0006 %     vbmeg_brain_file : [input file]  VBMEG BRAIN-MAT file   : Subject.brain.mat
0007 %       data_conn_file : [output file] connection data file for display.
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 if nargin ~= 3
0013     error('Please check function usage.');
0014 end
0015 
0016 %
0017 % --- Previous check
0018 %
0019 if exist(vmni_connect_file, 'file') ~= 2
0020     error('vmni_connect_file not found.');
0021 end
0022 if exist(vbmeg_brain_file, 'file') ~= 2
0023     error('vbmeg_brain_file not found.');
0024 end
0025 
0026 %
0027 % --- Main Procedure
0028 %
0029 outfile   = data_conn_file;
0030 
0031 % Connection pair index file
0032 conn_file = vmni_connect_file;
0033 
0034 % output directory creation
0035 out_dir = fileparts(outfile);
0036 if exist(out_dir, 'dir') ~= 7
0037     mkdir(out_dir);
0038 end
0039 
0040 %------- Input File
0041 atlas_dir       = [fileparts(which('ch2.img')), filesep];
0042 parm.atlas_file = [atlas_dir 'aal.img'];
0043 parm.conn_file  = conn_file;
0044 parm.brainfile  = vbmeg_brain_file;
0045 
0046 %--- Output file
0047 parm.outfile = outfile;
0048 
0049 if isfield(parm,'outfile') && ~isempty(parm.outfile) ...
0050 %    && ~exist(parm.outfile,'file')
0051 
0052     Data.Vc = load_connection_dti(parm);
0053     
0054     load(parm.conn_file, 'Index_to', 'Index_from');
0055     
0056     Data.I_to  = Index_to;
0057     Data.I_from= Index_from;
0058     
0059     fprintf('disp_conn_data_make done\n\n')
0060     % --- path coordinate for n-th connection
0061     %  Data.Vc{n}       : vertex coordinates along n-th connection path
0062     % --- pair of vetex index for n-th connection
0063     %  Data.I_from(n)   : start vertex index
0064     %  Data.I_to(n)     : end vertex index
0065     
0066     save([parm.outfile],'Data')
0067 end

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