Home > vbmeg > functions > gui > brain_file_maker > brain_file_maker_view2d.m

brain_file_maker_view2d

PURPOSE ^

launch vb_mri_point_select to check cortex form.

SYNOPSIS ^

function [obj] = brain_file_maker_view2d(obj, brain_file, analyze_info)

DESCRIPTION ^

 launch vb_mri_point_select to check cortex form.
 [USAGE]
    [obj] = brain_file_maker_view2d(<obj>, <brain_file>, <analyze_file>);
 [IN]
             obj : brain_file_maker object
      brain_file : brain_file(.brain.mat)   (fullpath)
    analyze_info : analyze_info object
 [OUT]
    obj : brain_file_maker object

 Author: rhayashi
 Created: 2007-07-17

 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 [obj] = brain_file_maker_view2d(obj, brain_file, analyze_info)
0002 % launch vb_mri_point_select to check cortex form.
0003 % [USAGE]
0004 %    [obj] = brain_file_maker_view2d(<obj>, <brain_file>, <analyze_file>);
0005 % [IN]
0006 %             obj : brain_file_maker object
0007 %      brain_file : brain_file(.brain.mat)   (fullpath)
0008 %    analyze_info : analyze_info object
0009 % [OUT]
0010 %    obj : brain_file_maker object
0011 %
0012 % Author: rhayashi
0013 % Created: 2007-07-17
0014 %
0015 % Copyright (C) 2011, ATR All Rights Reserved.
0016 % License : New BSD License(see VBMEG_LICENSE.txt)
0017 
0018 %
0019 % --- Previous check
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 % --- Main Procedure
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 % load brain data
0038 load(brain_file, 'V', 'F', 'xx');
0039 
0040 % convert coordinate to plot
0041 V = vb_spm_right_to_analyze_right_mm(V, Vdim, Vsize);
0042 coord_type = vbmeg_inst.const.COORDINATE_ANALYZE_RIGHT_MM;
0043 
0044 % make display data
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 % display by vb_mri_point_select
0052 evalin('base', 'clear avw');
0053 if ~ishandle(obj.view2d)
0054     % Run vb_mri_point_select
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     % Update mri_point select screen
0063     figure(obj.view2d);
0064     set(0, 'CurrentFigure', obj.view2d);
0065     AVWVIEW = get(obj.view2d, 'Userdata');
0066     % replace display data
0067     AVWVIEW.display_factor = display_factor;
0068     set(obj.view2d, 'Userdata', AVWVIEW);
0069     % display update
0070     vb_mri_point_select([], [], 'update');
0071 end
0072 
0073 %
0074 % --- After check
0075 %
0076 if nargout ~= 1
0077     error('function caller should receive obj.');
0078 end

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