Home > fmri > utils > old > GE2SPM.orig > GE_readHeaderSuite.m

GE_readHeaderSuite

PURPOSE ^

SYNOPSIS ^

function su_hdr = GE_readHeaderSuite(fid, byte_align)

DESCRIPTION ^

 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)


 Written by Souheil J. Inati
 Dartmouth College 2000

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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 % Written by Souheil J. Inati
0012 % Dartmouth College 2000
0013 
0014 % define the structure and read
0015 su_hdr = struct('su_id', fread(fid,4,'char'));                   % Suite ID
0016 su_hdr = setfield(su_hdr, 'su_uniq', fread(fid,1,'int16'));      % The Make-Unique Flag
0017 su_hdr = setfield(su_hdr, 'su_diskid', fread(fid,1,'char'));     % Disk ID
0018 su_hdr = setfield(su_hdr, 'prodid', fread(fid,13,'char'));       % Product ID
0019 su_hdr = setfield(su_hdr, 'su_verscre', fread(fid,2,'char'));    % Genesis Version
0020 su_hdr = setfield(su_hdr, 'su_verscur', fread(fid,2,'char'));    % Genesis Version
0021 su_hdr = setfield(su_hdr, 'su_checksum', fread(fid,1,'uint32')); % Suite  Record Checksum
0022 su_hdr = setfield(su_hdr, 'su_padding', fread(fid,85,'char'));   % Spare Space
0023 fseek(fid,1,0); % 16-bit alignment
0024 if byte_align, fseek(fid,2,0); end % 32-bit alignment
0025 
0026 return

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003