Home > vbmeg > external > mne > fiff_list_dir_tree.m

fiff_list_dir_tree

PURPOSE ^

SYNOPSIS ^

function fiff_list_dir_tree(out, tree, indent)

DESCRIPTION ^

 fiff_list_dir_tree(fid, tree)

 List the fiff directory tree structure

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fiff_list_dir_tree(out, tree, indent)
0002 
0003 %
0004 % fiff_list_dir_tree(fid, tree)
0005 %
0006 % List the fiff directory tree structure
0007 %
0008 
0009 %
0010 %   Author : Matti Hamalainen, MGH Martinos Center
0011 %   License : BSD 3-clause
0012 %
0013 %   Revision 1.3  2009/04/01 21:25:50  msh
0014 %   Fixed problems with fiff nodes with no tags in them
0015 %
0016 %   Revision 1.2  2006/04/23 15:29:40  msh
0017 %   Added MGH to the copyright
0018 %
0019 %   Revision 1.1  2006/04/10 23:26:54  msh
0020 %   Added fiff reading routines
0021 %
0022 
0023 global FIFF;
0024 if isempty(FIFF)
0025     FIFF = fiff_define_constants();
0026 end
0027 
0028 me = 'MNE:fiff_list_dir_tree';
0029 
0030 if nargin == 2
0031     indent = 0;
0032 end
0033 
0034 for k = 1:indent
0035     fprintf(out, '\t');
0036 end
0037 if tree.block ~= 0
0038     fprintf(out, '{ %d\n', tree.block);
0039 end
0040 
0041 count = 1;
0042 for k = 1:tree.nent
0043     if k == 1
0044         print = true;
0045         for p = 1:indent
0046             fprintf(out, '\t');
0047         end
0048         fprintf(out, 'tag : %d', tree.dir(k).kind);
0049     else
0050         if tree.dir(k).kind == tree.dir(k - 1).kind
0051             count = count + 1;
0052         else
0053             if count > 1
0054                 fprintf(out, ' [%d]\n', count);
0055             else
0056                 fprintf(out, '\n');
0057             end
0058             for p = 1:indent
0059                 fprintf(out, '\t');
0060             end
0061             fprintf(out, 'tag : %d', tree.dir(k).kind);
0062             count = 1;
0063         end
0064     end
0065 end
0066 if count > 1
0067     fprintf(out, ' [%d]\n', count);
0068 else
0069     fprintf(out, '\n');
0070 end
0071 
0072 for k = 1:tree.nchild
0073     fiff_list_dir_tree(out, tree.children(k), indent + 1);
0074 end
0075 
0076 for k = 1:indent
0077     fprintf(out, '\t');
0078 end
0079 
0080 if tree.block ~= 0
0081     fprintf(out, '} %d\n', tree.block);
0082 end
0083 
0084 return
0085

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