0001 function [obj] = brain_file_maker_view2d(obj, brain_file, analyze_info)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0022 if ~exist('brain_file', 'var')
0023 error('brain_file is a required parameter.');
0024 end
0025 if ~exist('analyze_info', 'var')
0026 error('analyze_info is a required parameter.');
0027 end
0028
0029
0030
0031
0032 global vbmeg_inst;
0033
0034 Vdim = vb_analyze_info_get_voxdim(analyze_info);
0035 Vsize = vb_analyze_info_get_voxsize(analyze_info);
0036 analyze_file = vb_analyze_info_get_file_prefix(analyze_info);
0037
0038 load(brain_file, 'V', 'F', 'xx');
0039
0040
0041 V = vb_spm_right_to_analyze_right_mm(V, Vdim, Vsize);
0042 coord_type = vbmeg_inst.const.COORDINATE_ANALYZE_RIGHT_MM;
0043
0044
0045 element = vb_surf_element_new('brain mat loaded data', coord_type, V, F.F3, xx);
0046 clear V F xx;
0047 display_factor = vb_display_factor_new;
0048 display_factor = vb_display_factor_add_element(display_factor, element);
0049 clear element;
0050
0051
0052 evalin('base', 'clear avw');
0053 if ~ishandle(obj.view2d)
0054
0055 avw = avw_read_ras(analyze_file);
0056 avw.display_factor = display_factor;
0057 vb_mri_point_select(avw, '', 'init');
0058 obj.view2d = gcf;
0059 set(obj.view2d, 'Unit', 'normalized');
0060 set(obj.view2d, 'Position', [0.35, 0.2, 0.6, 0.6]);
0061 else
0062
0063 figure(obj.view2d);
0064 set(0, 'CurrentFigure', obj.view2d);
0065 AVWVIEW = get(obj.view2d, 'Userdata');
0066
0067 AVWVIEW.display_factor = display_factor;
0068 set(obj.view2d, 'Userdata', AVWVIEW);
0069
0070 vb_mri_point_select([], [], 'update');
0071 end
0072
0073
0074
0075
0076 if nargout ~= 1
0077 error('function caller should receive obj.');
0078 end