Home > functions > gui > bm_editor > bm_edit_app > bm_edit_app_update_model_status_listbox.m

bm_edit_app_update_model_status_listbox

PURPOSE ^

update brain model status listbox

SYNOPSIS ^

function [obj] = bm_edit_app_update_model_status_listbox(obj)

DESCRIPTION ^

 update brain model status listbox
 [USAGE]
    [obj] = bm_edit_app_update_model_status_listbox(<obj>);
 [IN]
    obj : bm_edit_app object
 [OUT]
    obj : bm_edit_app object

 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] = bm_edit_app_update_model_status_listbox(obj)
0002 % update brain model status listbox
0003 % [USAGE]
0004 %    [obj] = bm_edit_app_update_model_status_listbox(<obj>);
0005 % [IN]
0006 %    obj : bm_edit_app object
0007 % [OUT]
0008 %    obj : bm_edit_app object
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 %
0014 % --- Previous check
0015 %
0016 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0017 if ~strcmp(obj.class_type, 'bm_edit_app')
0018     error('class type is invalid.');
0019 end
0020 
0021 %
0022 % --- Main Procedure
0023 %
0024 H = guihandles(obj.h);
0025 
0026 all_index = bm_manager_get_bm_list_index(obj.bmm);
0027 selected_index = get(H.brain_model_list_listbox, 'Value');
0028 
0029 if length(selected_index) == 1 && ~isempty(all_index)
0030     %
0031     % Make string of brain model status
0032     %
0033     info_cell = bm_manager_get_model_info(obj.bmm, selected_index);
0034     info = info_cell{1};
0035     status_str = sprintf('model name : %s\ntype       : %s\n', ...
0036                                                 info.model_name, ...
0037                                                 info.class_type);
0038     % add surface close status
0039     if isfield(info, 'surf_close')
0040         if info.surf_close == true
0041             surf_str = 'surface    : closed.';
0042         else
0043             surf_str = 'surface    : not closed.';
0044         end
0045         status_str = [status_str, surf_str];
0046     end
0047     % conductivity
0048     conductivity_str = num2str(info_cell{1}.conductivity);
0049 else
0050     status_str = [];
0051     conductivity_str = [];
0052 end
0053 
0054 set(H.brain_model_status_edit, 'String', status_str);
0055 set(H.conductivity_edit, 'String', conductivity_str);
0056 
0057 %
0058 % --- After check
0059 %
0060 if nargout ~= 1
0061     error('function caller should receive obj.');
0062 end

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