Home > functions > gui > bm_editor > bm_fileio > bm_fileio_read_head_file.m

bm_fileio_read_head_file

PURPOSE ^

read head file.

SYNOPSIS ^

function [V_cell, F_cell, xx_cell, model_name_cell, conduct_cell] =bm_fileio_read_head_file(file_name)

DESCRIPTION ^

 read head file.
 [USAGE]
    [V_cell, F_cell, xx_cell] = bm_fileio_read_head_file(<file_name>);
 [IN]
    file_name : full path head file name(.head.mat)
 [OUT]
             V_cell : cell array of vertex
             F_cell : cell array of face
            xx_cell : cell array of normal vector
    model_name_cell : cell array of model name
       conduct_cell : cell array of conductivity value

 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 [V_cell, F_cell, xx_cell, model_name_cell, conduct_cell] = ...
0002                 bm_fileio_read_head_file(file_name)
0003 % read head file.
0004 % [USAGE]
0005 %    [V_cell, F_cell, xx_cell] = bm_fileio_read_head_file(<file_name>);
0006 % [IN]
0007 %    file_name : full path head file name(.head.mat)
0008 % [OUT]
0009 %             V_cell : cell array of vertex
0010 %             F_cell : cell array of face
0011 %            xx_cell : cell array of normal vector
0012 %    model_name_cell : cell array of model name
0013 %       conduct_cell : cell array of conductivity value
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('file_name', 'var')
0022     error('file_name is a required parameter.');
0023 end
0024 if exist(file_name, 'file') ~= 2
0025     error(['specified head file does not exist : ' file_name]);
0026 end
0027 
0028 %
0029 % --- Main Procedure
0030 %
0031 V_cell = cell(0);
0032 F_cell = cell(0);
0033 xx_cell = cell(0);
0034 model_name_cell = cell(0);
0035 conduct_cell = cell(0);
0036 
0037 Nlayer = vb_head_get_layer_num(file_name);
0038 for k=1:Nlayer
0039     [HeadInfo] = vb_head_get_specified_headinfo(file_name, k);
0040     V_cell{k} = vb_headinfo_get_vhead(HeadInfo);
0041     F_cell{k} = vb_headinfo_get_fhead(HeadInfo);
0042     xx_cell{k} = vb_headinfo_get_xxhead(HeadInfo);
0043     conduct_cell{k} = vb_headinfo_get_sigma(HeadInfo);
0044 
0045     model_name_cell{k} = vb_headinfo_get_layertag(HeadInfo);
0046     if isempty(model_name_cell{k})
0047         model_name_cell{k} = ['brain model', num2str(k)];
0048     end
0049 end

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