Home > functions > gui > preAnalysis > head > head_spm_curry > pa_head_load_display_factor.m

pa_head_load_display_factor

PURPOSE ^

create display_factor object to make 2D/3D view of Head file.

SYNOPSIS ^

function [display_factor] = pa_head_load_display_factor(fig)

DESCRIPTION ^

 create display_factor object to make 2D/3D view of Head file.

 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 [display_factor] = pa_head_load_display_factor(fig)
0002 % create display_factor object to make 2D/3D view of Head file.
0003 %
0004 % Copyright (C) 2011, ATR All Rights Reserved.
0005 % License : New BSD License(see VBMEG_LICENSE.txt)
0006 
0007 %
0008 % --- Previous check
0009 %
0010 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0011     error('invalid figure handle is specified.');
0012 end
0013 
0014 %
0015 % --- Main Procedure
0016 %
0017 % load data(@see pa_head_create)
0018 data = guidata(fig);
0019 H = data.H; % component handles
0020 
0021 proj_root = get(H.prjroot_edit, 'String');
0022 analyze_file = get(H.analyze_file_edit, 'String');
0023 head_file    = get(H.head_file_edit, 'String');
0024 head_file_postfix = get(H.head_file_extension_text, 'String');
0025 head_file    = [proj_root, '/', head_file, head_file_postfix];
0026 
0027 if exist(analyze_file, 'file') == 0
0028     errordlg('Analyze file should be inputted.');
0029     return;
0030 end
0031 if exist(head_file, 'file') == 0
0032     errordlg('Specified Head file does not exist.');
0033     return;
0034 end
0035 
0036 %
0037 % --- Load head_file and create display_factor object
0038 %
0039 
0040 % Create head file manager
0041 bm_obj = bm_manager_new;
0042 [const] = define_bm_edit_app;
0043 [bm_obj, result, bm_ix] = ...
0044         bm_manager_import_file(bm_obj, const.file_type.HEAD_FILE, ...
0045                                head_file, analyze_file);
0046 if result == FAILURE
0047     errordlg('Failed to read head file.');
0048     return;
0049 end
0050 display_factor = bm_manager_get_display_factor(bm_obj, bm_ix);

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005