Home > vbmeg > external > mne > fiff_read_bad_channels.m

fiff_read_bad_channels

PURPOSE ^

SYNOPSIS ^

function [bads] = fiff_read_bad_channels(fid,node)

DESCRIPTION ^

 [bads] = fiff_read_bad_channels(fid,node)

 Reas the bad channel list from a node if it exists

 fid      - The file id
 node     - The node of interes

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [bads] = fiff_read_bad_channels(fid,node)
0002 %
0003 % [bads] = fiff_read_bad_channels(fid,node)
0004 %
0005 % Reas the bad channel list from a node if it exists
0006 %
0007 % fid      - The file id
0008 % node     - The node of interes
0009 %
0010 
0011 %
0012 %
0013 %   Author : Matti Hamalainen, MGH Martinos Center
0014 %   License : BSD 3-clause
0015 %
0016 %   Revision 1.5  2006/05/03 18:53:04  msh
0017 %   Approaching Matlab 6.5 backward compatibility
0018 %
0019 %   Revision 1.4  2006/05/03 15:51:17  msh
0020 %   Re-added fiff_read_bad_channels
0021 %
0022 %   Revision 1.2  2006/04/23 15:29:40  msh
0023 %   Added MGH to the copyright
0024 %
0025 %   Revision 1.1  2006/04/12 17:09:28  msh
0026 %   Added routines for reading noise-covariance matrices
0027 %
0028 %
0029 
0030 me='MNE:fiff_read_bad_channels';
0031 
0032 global FIFF;
0033 if isempty(FIFF)
0034     FIFF = fiff_define_constants();
0035 end
0036 
0037 node = fiff_dir_tree_find(node,FIFF.FIFFB_MNE_BAD_CHANNELS);
0038 
0039 bads = [];
0040 if ~isempty(node)
0041     tag = find_tag(node,FIFF.FIFF_MNE_CH_NAME_LIST);
0042     if ~isempty(tag)
0043         bads = fiff_split_name_list(tag.data);
0044     end
0045 end
0046 
0047 return;
0048 
0049     function [tag] = find_tag(node,findkind)
0050         
0051         for p = 1:node.nent
0052             kind = node.dir(p).kind;
0053             pos  = node.dir(p).pos;
0054             if kind == findkind
0055                 tag = fiff_read_tag(fid,pos);
0056                 return;
0057             end
0058         end
0059         tag = [];
0060         return
0061     end
0062 
0063 end

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