0001 function vb_view_head_2d(analyze_file, head_file)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
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(head_file, 'file') ~= 2
0025 error('Specified head file not found.');
0026 end
0027
0028
0029
0030
0031 data_file = tempname;
0032 vb_fsave(data_file, 'analyze_file', 'head_file');
0033
0034
0035
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
0047
0048 function display_factor = inner_brain_load_display_factor(data_file)
0049
0050
0051 load(data_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.HEAD_FILE, ...
0057 head_file, analyze_file);
0058 if result == FAILURE
0059 errordlg('Failed to read brain file.');
0060 return;
0061 end
0062 display_factor = bm_manager_get_display_factor(bm_obj, bm_ix);