Home > functions > gui > bm_editor > bm_manager > bm_manager_get_model_info.m

bm_manager_get_model_info

PURPOSE ^

get brain model information

SYNOPSIS ^

function [info_cell] = bm_manager_get_model_info(obj, index)

DESCRIPTION ^

 get brain model information
 [USAGE]
    [info] = bm_manager_get_model_info(<obj>, <index_no>);
 [IN]
      obj : bm_manager object
    index : bm_list index
 [OUT]
    info_cell : cell array of info struct.
    info_cell{k}.model_name  : <<string>>  model name
                .class_type  : <<string>>  brain_data.class_type
                .conductivity: <<double>>  conductivity value
               [.surf_close] : This field exists when class_type is 'surf_data'
                               <<boolean>> true / false

 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 [info_cell] = bm_manager_get_model_info(obj, index)
0002 % get brain model information
0003 % [USAGE]
0004 %    [info] = bm_manager_get_model_info(<obj>, <index_no>);
0005 % [IN]
0006 %      obj : bm_manager object
0007 %    index : bm_list index
0008 % [OUT]
0009 %    info_cell : cell array of info struct.
0010 %    info_cell{k}.model_name  : <<string>>  model name
0011 %                .class_type  : <<string>>  brain_data.class_type
0012 %                .conductivity: <<double>>  conductivity value
0013 %               [.surf_close] : This field exists when class_type is 'surf_data'
0014 %                               <<boolean>> true / false
0015 %
0016 % Copyright (C) 2011, ATR All Rights Reserved.
0017 % License : New BSD License(see VBMEG_LICENSE.txt)
0018 
0019 %
0020 % --- Previous check
0021 %
0022 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0023 if ~strcmp(obj.class_type, 'bm_manager')
0024     error('class type is invalid.');
0025 end
0026 if ~exist('index', 'var'), error('index is a required parameter.'); end
0027 
0028 %
0029 % --- Main Procedure
0030 %
0031 brain_data_cell = bm_list_get_brain_model(obj.bm_list, index);
0032 
0033 % allocate values to return
0034 Nmodel = length(brain_data_cell);
0035 info_cell   = cell(Nmodel, 1);
0036 
0037 for k=1:Nmodel
0038     info = struct;
0039     brain_data = brain_data_cell{k};
0040 
0041     % get model info
0042     info.model_name = brain_data_get_model_name(brain_data);
0043 
0044     % get conductivity
0045     info.conductivity = brain_data_get_conductivity(brain_data);
0046 
0047     % class type
0048     switch(brain_data.class_type)
0049         case 'surf_data'
0050             info.class_type = 'surf_data';
0051         case 'mask_image_data'
0052             info.class_type = 'mask_image_data';
0053         otherwise
0054             error('Unknown class_type is specified.');
0055     end
0056 
0057     % surface close status
0058     if strcmp(brain_data.class_type, 'surf_data')
0059         info.surf_close = surf_data_is_closed(brain_data);
0060     end
0061 
0062     % set model info to return value
0063     info_cell{k} = info;
0064 end

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