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