0001 function ex_hdr = GE_readHeaderExam(fid, byte_align)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 ex_hdr = struct('ex_suid', fread(fid,4,'uchar'));
0018 ex_hdr = setfield(ex_hdr, 'ex_uniq', fread(fid,1,'int16'));
0019 ex_hdr = setfield(ex_hdr, 'ex_diskid', fread(fid,1,'uchar'));
0020 fseek(fid,1,0);
0021 ex_hdr = setfield(ex_hdr, 'ex_no', fread(fid,1,'uint16'));
0022 ex_hdr = setfield(ex_hdr, 'hospname', fread(fid,33,'uchar'));
0023 fseek(fid,1,0);
0024 ex_hdr = setfield(ex_hdr, 'detect', fread(fid,1,'int16'));
0025 if byte_align; fseek(fid,2,0); end
0026 ex_hdr = setfield(ex_hdr, 'numcells', fread(fid,1,'int32'));
0027 ex_hdr = setfield(ex_hdr, 'zerocell', fread(fid,1,'float32'));
0028 ex_hdr = setfield(ex_hdr, 'cellspace', fread(fid,1,'float32'));
0029 ex_hdr = setfield(ex_hdr, 'srctodet', fread(fid,1,'float32'));
0030 ex_hdr = setfield(ex_hdr, 'srctoiso', fread(fid,1,'float32'));
0031 ex_hdr = setfield(ex_hdr, 'tubetyp', fread(fid,1,'int16'));
0032 ex_hdr = setfield(ex_hdr, 'dastyp', fread(fid,1,'int16'));
0033 ex_hdr = setfield(ex_hdr, 'num_dcnk', fread(fid,1,'int16'));
0034 ex_hdr = setfield(ex_hdr, 'dcn_len', fread(fid,1,'int16'));
0035 ex_hdr = setfield(ex_hdr, 'dcn_density', fread(fid,1,'int16'));
0036 ex_hdr = setfield(ex_hdr, 'dcn_stepsize', fread(fid,1,'int16'));
0037 ex_hdr = setfield(ex_hdr, 'dcn_shiftcnt', fread(fid,1,'int16'));
0038 if byte_align; fseek(fid,2,0); end
0039 ex_hdr = setfield(ex_hdr, 'magstrength', fread(fid,1,'int32'));
0040 ex_hdr = setfield(ex_hdr, 'patid', fread(fid,13,'uchar'));
0041 ex_hdr = setfield(ex_hdr, 'patname', fread(fid,25,'uchar'));
0042 ex_hdr = setfield(ex_hdr, 'patage', fread(fid,1,'int16'));
0043 ex_hdr = setfield(ex_hdr, 'patian', fread(fid,1,'int16'));
0044 ex_hdr = setfield(ex_hdr, 'patsex', fread(fid,1,'int16'));
0045 ex_hdr = setfield(ex_hdr, 'patweight', fread(fid,1,'int32'));
0046 ex_hdr = setfield(ex_hdr, 'trauma', fread(fid,1,'int16'));
0047 ex_hdr = setfield(ex_hdr, 'hist', fread(fid,61,'uchar'));
0048 ex_hdr = setfield(ex_hdr, 'reqnum', fread(fid,13,'uchar'));
0049 ex_hdr = setfield(ex_hdr, 'ex_datetime', fread(fid,1,'int32'));
0050 ex_hdr = setfield(ex_hdr, 'refphy', fread(fid,33,'uchar'));
0051 ex_hdr = setfield(ex_hdr, 'diagrad', fread(fid,33,'uchar'));
0052 ex_hdr = setfield(ex_hdr, 'op', fread(fid,4,'uchar'));
0053 ex_hdr = setfield(ex_hdr, 'ex_desc', fread(fid,23,'uchar'));
0054 ex_hdr = setfield(ex_hdr, 'ex_typ', fread(fid,3,'uchar'));
0055 ex_hdr = setfield(ex_hdr, 'ex_format', fread(fid,1,'int16'));
0056 if byte_align; fseek(fid,6,0); end
0057 ex_hdr = setfield(ex_hdr, 'firstaxtime', fread(fid,1,'float64'));
0058 ex_hdr = setfield(ex_hdr, 'ex_sysid', fread(fid,9,'uchar'));
0059 fseek(fid,1,0);
0060 if byte_align; fseek(fid,2,0); end
0061 ex_hdr = setfield(ex_hdr, 'ex_lastmod', fread(fid,1,'int32'));
0062 ex_hdr = setfield(ex_hdr, 'protocolflag', fread(fid,1,'int16'));
0063 ex_hdr = setfield(ex_hdr, 'ex_alloc_key', fread(fid,13,'uchar'));
0064 fseek(fid,1,0);
0065 ex_hdr = setfield(ex_hdr, 'ex_delta_cnt', fread(fid,1,'int32'));
0066 ex_hdr = setfield(ex_hdr, 'ex_verscre', fread(fid,2,'uchar'));
0067 ex_hdr = setfield(ex_hdr, 'ex_verscur', fread(fid,2,'uchar'));
0068 ex_hdr = setfield(ex_hdr, 'ex_checksum', fread(fid,1,'uint32'));
0069 ex_hdr = setfield(ex_hdr, 'ex_complete', fread(fid,1,'int32'));
0070 ex_hdr = setfield(ex_hdr, 'ex_seriesct', fread(fid,1,'int32'));
0071 ex_hdr = setfield(ex_hdr, 'ex_numarch', fread(fid,1,'int32'));
0072 ex_hdr = setfield(ex_hdr, 'ex_numseries', fread(fid,1,'int32'));
0073 ex_hdr = setfield(ex_hdr, 'ex_series', struct('length', fread(fid,1,'uint32'), ...
0074 'data', fread(fid,1,'uint32')));
0075 ex_hdr = setfield(ex_hdr, 'ex_numunser', fread(fid,1,'int32'));
0076 ex_hdr = setfield(ex_hdr, 'ex_unseries', struct('length', fread(fid,1,'uint32'), ...
0077 'data', fread(fid,1,'uint32')));
0078 ex_hdr = setfield(ex_hdr, 'ex_toarchcnt', fread(fid,1,'int32'));
0079 ex_hdr = setfield(ex_hdr, 'ex_toarchive', struct('length', fread(fid,1,'uint32'), ...
0080 'data', fread(fid,1,'uint32')));
0081 ex_hdr = setfield(ex_hdr, 'ex_prospcnt', fread(fid,1,'int32'));
0082 ex_hdr = setfield(ex_hdr, 'ex_prosp', struct('length', fread(fid,1,'uint32'), ...
0083 'data', fread(fid,1,'uint32')));
0084 ex_hdr = setfield(ex_hdr, 'ex_modelnum', fread(fid,1,'int32'));
0085 ex_hdr = setfield(ex_hdr, 'ex_modelcnt', fread(fid,1,'int32'));
0086 ex_hdr = setfield(ex_hdr, 'ex_models', struct('length', fread(fid,1,'uint32'), ...
0087 'data', fread(fid,1,'uint32')));
0088 ex_hdr = setfield(ex_hdr, 'ex_stat', fread(fid,1,'int16'));
0089 ex_hdr = setfield(ex_hdr, 'uniq_sys_id', fread(fid,16,'uchar'));
0090 ex_hdr = setfield(ex_hdr, 'service_id', fread(fid,16,'uchar'));
0091 ex_hdr = setfield(ex_hdr, 'mobile_loc', fread(fid,4,'uchar'));
0092 ex_hdr = setfield(ex_hdr, 'study_uid', fread(fid,32,'uchar'));
0093 ex_hdr = setfield(ex_hdr, 'study_status', fread(fid,1,'int16'));
0094 ex_hdr = setfield(ex_hdr, 'ex_padding', fread(fid,516,'uchar'));
0095 if byte_align; fseek(fid,4,0); end
0096
0097 return