Home > vbmeg > functions > gui > vb_view_cortex_2d.m

vb_view_cortex_2d

PURPOSE ^

View cortical model on MRI image

SYNOPSIS ^

function vb_view_cortex_2d(analyze_file, brain_file)

DESCRIPTION ^

 View cortical model on MRI image
 [Usage]
   vb_view_cortex_2d(analyze_file, brain_file);
 [Input]
   analyze_file : T1 structure file.
     brain_file : VBMEG Cortical model file(.brain.mat)
 [Output]
    none

 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function vb_view_cortex_2d(analyze_file, brain_file)
0002 % View cortical model on MRI image
0003 % [Usage]
0004 %   vb_view_cortex_2d(analyze_file, brain_file);
0005 % [Input]
0006 %   analyze_file : T1 structure file.
0007 %     brain_file : VBMEG Cortical model file(.brain.mat)
0008 % [Output]
0009 %    none
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 
0015 %
0016 % --- Previous check
0017 %
0018 if nargin ~= 2
0019     error('Please check function usage.');
0020 end
0021 if exist(analyze_file, 'file') ~= 2
0022     error('Specified analyze file not found.');
0023 end
0024 if exist(brain_file, 'file') ~= 2
0025     error('Specified brain file not found.');
0026 end
0027 
0028 %
0029 % --- Main Procedure
0030 %
0031 data_file = tempname;
0032 vb_fsave(data_file, 'analyze_file', 'brain_file');
0033 
0034 
0035 % Set 2D view parameter
0036 view2d_setting = bm_view_parm2d_new;
0037 view2d_setting = bm_view_parm2d_set_analyze_file(view2d_setting, analyze_file);
0038 
0039 view2d = bm_edit_app_view2d_new;
0040 view2d = bm_edit_app_view_update(view2d, data_file, ...
0041                                  @inner_brain_load_display_factor, ...
0042                                  view2d_setting);
0043 return;
0044 
0045 %
0046 % --- Inner function
0047 %
0048 function display_factor = inner_brain_load_display_factor(data_file)
0049 % Create head file manager
0050 
0051 load(data_file); % analyze_file, brain_file
0052 
0053 bm_obj = bm_manager_new;
0054 [const] = define_bm_edit_app;
0055 [bm_obj, result, bm_ix] = ...
0056         bm_manager_import_file(bm_obj, const.file_type.BRAIN_FILE, ...
0057                                brain_file, analyze_file, ...
0058                                {const.str.BRAIN_FILE_IMPORT_WHOLE_BRAIN});
0059 if result == FAILURE
0060     errordlg('Failed to read brain file.');
0061     return;
0062 end
0063 display_factor = bm_manager_get_display_factor(bm_obj, bm_ix);

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