Doxygen Source Code Documentation
GE_readHeaderSuite.m
Go to the documentation of this file.00001 function su_hdr = GE_readHeaderSuite(fid, byte_align)
00002 %
00003 % su_hdr = GE_readHeaderSuite(fid, byte_align)
00004 %
00005 % Loads the suite header from the file with filed id fid
00006 % and returns it as a structure.
00007 % if byte_align = 1 then 32-bit alignment (SGI, LX2 format)
00008 % if byte_align = 0 then 16-bit alignment (Sun, 5.X format)
00009 %
00010 %
00011 % Souheil J. Inati
00012 % Dartmouth College
00013 % May 2000
00014 % souheil.inati@dartmouth.edu
00015 %
00016
00017 % define the structure and read
00018 su_hdr = struct('su_id', fread(fid,4,'char')); % Suite ID
00019 su_hdr = setfield(su_hdr, 'su_uniq', fread(fid,1,'int16')); % The Make-Unique Flag
00020 su_hdr = setfield(su_hdr, 'su_diskid', fread(fid,1,'char')); % Disk ID
00021 su_hdr = setfield(su_hdr, 'prodid', fread(fid,13,'char')); % Product ID
00022 su_hdr = setfield(su_hdr, 'su_verscre', fread(fid,2,'char')); % Genesis Version
00023 su_hdr = setfield(su_hdr, 'su_verscur', fread(fid,2,'char')); % Genesis Version
00024 su_hdr = setfield(su_hdr, 'su_checksum', fread(fid,1,'uint32')); % Suite Record Checksum
00025 su_hdr = setfield(su_hdr, 'su_padding', fread(fid,85,'char')); % Spare Space
00026 fseek(fid,1,0); % 16-bit alignment
00027 if byte_align, fseek(fid,2,0); end % 32-bit alignment
00028
00029 return