su_hdr = GE_readHeaderSuite(fid, byte_align) Loads the suite header from the file with filed id fid and returns it as a structure. if byte_align = 1 then 32-bit alignment (SGI, LX2 format) if byte_align = 0 then 16-bit alignment (Sun, 5.X format) Souheil J. Inati Dartmouth College May 2000 souheil.inati@dartmouth.edu
0001 function su_hdr = GE_readHeaderSuite(fid, byte_align) 0002 % 0003 % su_hdr = GE_readHeaderSuite(fid, byte_align) 0004 % 0005 % Loads the suite header from the file with filed id fid 0006 % and returns it as a structure. 0007 % if byte_align = 1 then 32-bit alignment (SGI, LX2 format) 0008 % if byte_align = 0 then 16-bit alignment (Sun, 5.X format) 0009 % 0010 % 0011 % Souheil J. Inati 0012 % Dartmouth College 0013 % May 2000 0014 % souheil.inati@dartmouth.edu 0015 % 0016 0017 % define the structure and read 0018 su_hdr = struct('su_id', fread(fid,4,'char')); % Suite ID 0019 su_hdr = setfield(su_hdr, 'su_uniq', fread(fid,1,'int16')); % The Make-Unique Flag 0020 su_hdr = setfield(su_hdr, 'su_diskid', fread(fid,1,'char')); % Disk ID 0021 su_hdr = setfield(su_hdr, 'prodid', fread(fid,13,'char')); % Product ID 0022 su_hdr = setfield(su_hdr, 'su_verscre', fread(fid,2,'char')); % Genesis Version 0023 su_hdr = setfield(su_hdr, 'su_verscur', fread(fid,2,'char')); % Genesis Version 0024 su_hdr = setfield(su_hdr, 'su_checksum', fread(fid,1,'uint32')); % Suite Record Checksum 0025 su_hdr = setfield(su_hdr, 'su_padding', fread(fid,85,'char')); % Spare Space 0026 fseek(fid,1,0); % 16-bit alignment 0027 if byte_align, fseek(fid,2,0); end % 32-bit alignment 0028 0029 return