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

GE_readHeaderImage

PURPOSE ^

SYNOPSIS ^

function im_hdr = GE_readHeaderImage(fid, byte_align)

DESCRIPTION ^

 im_hdr = GE_readHeaderImage(fid, byte_align)

 Loads the image header from a 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 im_hdr = GE_readHeaderImage(fid, byte_align)
0002 %
0003 % im_hdr = GE_readHeaderImage(fid, byte_align)
0004 %
0005 % Loads the image header from a 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 in the data
0015 % to overcome the byte alignment problems
0016 % break up the assignment into pieces using the setfield function
0017 
0018 im_hdr = struct('im_suid', fread(fid,4,'uchar')); %Suite id for this image
0019 im_hdr = setfield(im_hdr, 'im_uniq', fread(fid,1,'int16'));            %The Make-Unique Flag
0020 im_hdr = setfield(im_hdr, 'im_diskid', fread(fid,1,'uchar'));          %Disk ID for this Image
0021 fseek(fid, 1, 0);% 16-bit alignment
0022 im_hdr = setfield(im_hdr, 'im_exno', fread(fid,1,'uint16'));            %Exam number for this image
0023 im_hdr = setfield(im_hdr, 'im_seno', fread(fid,1,'int16'));            %Series Number for this image
0024 im_hdr = setfield(im_hdr, 'im_no', fread(fid,1,'int16'));              %Image Number
0025 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0026 im_hdr = setfield(im_hdr, 'im_datetime', fread(fid,1,'int32'));        %Allocation Image date/time stamp
0027 im_hdr = setfield(im_hdr, 'im_actual_dt', fread(fid,1,'int32'));       %Actual Image date/time stamp
0028 im_hdr = setfield(im_hdr, 'sctime', fread(fid,1,'float32'));             %Duration of scan
0029 im_hdr = setfield(im_hdr, 'slthick', fread(fid,1,'float32'));            %Slice Thickness (mm)
0030 im_hdr = setfield(im_hdr, 'imatrix_X', fread(fid,1,'int16'));          %Image matrix size - X
0031 im_hdr = setfield(im_hdr, 'imatrix_Y', fread(fid,1,'int16'));          %Image matrix size - Y
0032 im_hdr = setfield(im_hdr, 'dfov', fread(fid,1,'float32'));               %Display field of view - X (mm)
0033 im_hdr = setfield(im_hdr, 'dfov_rect', fread(fid,1,'float32'));          %Display field of view - Y (if different)
0034 im_hdr = setfield(im_hdr, 'dim_X', fread(fid,1,'float32'));              %Image dimension - X
0035 im_hdr = setfield(im_hdr, 'dim_Y', fread(fid,1,'float32'));              %Image dimension - Y
0036 im_hdr = setfield(im_hdr, 'pixsize_X', fread(fid,1,'float32'));          %Image pixel size - X
0037 im_hdr = setfield(im_hdr, 'pixsize_Y', fread(fid,1,'float32'));          %Image pixel size - Y
0038 im_hdr = setfield(im_hdr, 'pdid', fread(fid,14,'uchar'));          %Pixel Data ID
0039 im_hdr = setfield(im_hdr, 'contrastIV', fread(fid,17,'uchar'));    %IV Contrast Agent
0040 im_hdr = setfield(im_hdr, 'contrastOral', fread(fid,17,'uchar'));  %Oral Contrast Agent
0041 im_hdr = setfield(im_hdr, 'contmode', fread(fid,1,'int16'));           %Image Contrast Mode
0042 im_hdr = setfield(im_hdr, 'serrx', fread(fid,1,'int16'));              %Series from which prescribed
0043 im_hdr = setfield(im_hdr, 'imgrx', fread(fid,1,'int16'));              %Image from which prescribed
0044 im_hdr = setfield(im_hdr, 'screenformat', fread(fid,1,'int16'));       %Screen Format(8/16 bit)
0045 im_hdr = setfield(im_hdr, 'plane', fread(fid,1,'int16'));              %Plane Type
0046 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0047 im_hdr = setfield(im_hdr, 'scanspacing', fread(fid,1,'float32'));        %Spacing between scans (mm?)
0048 im_hdr = setfield(im_hdr, 'im_compress', fread(fid,1,'int16'));        %Image compression type for allocation
0049 im_hdr = setfield(im_hdr, 'im_scouttype', fread(fid,1,'int16'));       %Scout Type (AP or lateral)
0050 im_hdr = setfield(im_hdr, 'loc_ras', fread(fid,1,'uchar'));            %RAS letter of image location
0051 fseek(fid, 1, 0); % 16-bit alignment
0052 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0053 im_hdr = setfield(im_hdr, 'loc', fread(fid,1,'float32'));                %Image location
0054 im_hdr = setfield(im_hdr, 'ctr_R', fread(fid,1,'float32'));              %Center R coord of plane image
0055 im_hdr = setfield(im_hdr, 'ctr_A', fread(fid,1,'float32'));              %Center A coord of plane image
0056 im_hdr = setfield(im_hdr, 'ctr_S', fread(fid,1,'float32'));              %Center S coord of plane image
0057 im_hdr = setfield(im_hdr, 'norm_R', fread(fid,1,'float32'));             %Normal R coord
0058 im_hdr = setfield(im_hdr, 'norm_A', fread(fid,1,'float32'));             %Normal A coord
0059 im_hdr = setfield(im_hdr, 'norm_S', fread(fid,1,'float32'));             %Normal S coord
0060 im_hdr = setfield(im_hdr, 'tlhc_R', fread(fid,1,'float32'));             %R Coord of Top Left Hand Corner
0061 im_hdr = setfield(im_hdr, 'tlhc_A', fread(fid,1,'float32'));             %A Coord of Top Left Hand Corner
0062 im_hdr = setfield(im_hdr, 'tlhc_S', fread(fid,1,'float32'));             %S Coord of Top Left Hand Corner
0063 im_hdr = setfield(im_hdr, 'trhc_R', fread(fid,1,'float32'));             %R Coord of Top Right Hand Corner
0064 im_hdr = setfield(im_hdr, 'trhc_A', fread(fid,1,'float32'));             %A Coord of Top Right Hand Corner
0065 im_hdr = setfield(im_hdr, 'trhc_S', fread(fid,1,'float32'));             %S Coord of Top Right Hand Corner
0066 im_hdr = setfield(im_hdr, 'brhc_R', fread(fid,1,'float32'));             %R Coord of Bottom Right Hand Corner
0067 im_hdr = setfield(im_hdr, 'brhc_A', fread(fid,1,'float32'));             %A Coord of Bottom Right Hand Corner
0068 im_hdr = setfield(im_hdr, 'brhc_S', fread(fid,1,'float32'));             %S Coord of Bottom Right Hand Corner
0069 im_hdr = setfield(im_hdr, 'forimgrev', fread(fid,4,'uchar'));      %Foreign Image Revision
0070 im_hdr = setfield(im_hdr, 'tr', fread(fid,1,'int32'));                 %Pulse repetition time(usec)
0071 im_hdr = setfield(im_hdr, 'ti', fread(fid,1,'int32'));                 %Pulse inversion time(usec)
0072 im_hdr = setfield(im_hdr, 'te', fread(fid,1,'int32'));                 %Pulse echo time(usec)
0073 im_hdr = setfield(im_hdr, 'te2', fread(fid,1,'int32'));                %Second echo echo (usec)
0074 im_hdr = setfield(im_hdr, 'numecho', fread(fid,1,'int16'));            %Number of echoes
0075 im_hdr = setfield(im_hdr, 'echonum', fread(fid,1,'int16'));            %Echo Number
0076 im_hdr = setfield(im_hdr, 'tbldlta', fread(fid,1,'float32'));            %Table Delta
0077 im_hdr = setfield(im_hdr, 'nex', fread(fid,1,'float32'));                %Number of Excitations
0078 im_hdr = setfield(im_hdr, 'contig', fread(fid,1,'int16'));             %Continuous Slices Flag
0079 im_hdr = setfield(im_hdr, 'hrtrate', fread(fid,1,'int16'));            %Cardiac Heart Rate (bpm)
0080 im_hdr = setfield(im_hdr, 'tdel', fread(fid,1,'int32'));               %Delay time after trigger (msec)
0081 im_hdr = setfield(im_hdr, 'saravg', fread(fid,1,'float32'));             %Average SAR
0082 im_hdr = setfield(im_hdr, 'sarpeak', fread(fid,1,'float32'));            %Peak SAR
0083 im_hdr = setfield(im_hdr, 'monsar', fread(fid,1,'int16'));             %Monitor SAR flag
0084 im_hdr = setfield(im_hdr, 'trgwindow', fread(fid,1,'int16'));          %Trigger window (% of R-R interval)
0085 im_hdr = setfield(im_hdr, 'reptime', fread(fid,1,'float32'));            %Cardiac repetition time
0086 im_hdr = setfield(im_hdr, 'imgpcyc', fread(fid,1,'int16'));            %Images per cardiac cycle
0087 im_hdr = setfield(im_hdr, 'xmtgain', fread(fid,1,'int16'));            %Actual Transmit Gain (.1 db)
0088 im_hdr = setfield(im_hdr, 'rcvgain1', fread(fid,1,'int16'));           %Actual Receive Gain Analog (.1 db)
0089 im_hdr = setfield(im_hdr, 'rcvgain2', fread(fid,1,'int16'));           %Actual Receive Gain Digital (.1 db)
0090 im_hdr = setfield(im_hdr, 'mr_flip', fread(fid,1,'int16'));            %Flip Angle for GRASS scans (deg.)
0091 if byte_align; fseek(fid, 2, 0); end % byte alignment
0092 im_hdr = setfield(im_hdr, 'mindat', fread(fid,1,'int32'));             %Minimum Delay after Trigger (uSec)
0093 im_hdr = setfield(im_hdr, 'cphase', fread(fid,1,'int16'));             %Total Cardiac Phase prescribed
0094 im_hdr = setfield(im_hdr, 'swappf', fread(fid,1,'int16'));             %Swap Phase/Frequency Axis
0095 im_hdr = setfield(im_hdr, 'pauseint', fread(fid,1,'int16'));           %Pause Interval (slices)
0096 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0097 im_hdr = setfield(im_hdr, 'pausetime', fread(fid,1,'float32'));          %Pause Time
0098 im_hdr = setfield(im_hdr, 'obplane', fread(fid,1,'int32'));            %Oblique Plane
0099 im_hdr = setfield(im_hdr, 'slocfov', fread(fid,1,'int32'));            %Slice Offsets on Freq axis
0100 im_hdr = setfield(im_hdr, 'xmtfreq', fread(fid,1,'int32'));            %Center Frequency (0.1 Hz)
0101 im_hdr = setfield(im_hdr, 'autoxmtfreq', fread(fid,1,'int32'));        %Auto Center Frequency (0.1 Hz)
0102 im_hdr = setfield(im_hdr, 'autoxmtgain', fread(fid,1,'int16'));        %Auto Transmit Gain (0.1 dB)
0103 im_hdr = setfield(im_hdr, 'prescan_r1', fread(fid,1,'int16'));         %PreScan R1 - Analog
0104 im_hdr = setfield(im_hdr, 'prescan_r2', fread(fid,1,'int16'));         %PreScan R2 - Digital
0105 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0106 im_hdr = setfield(im_hdr, 'user_bitmap', fread(fid,1,'int32'));        %Bitmap defining user CVs
0107 im_hdr = setfield(im_hdr, 'cenfreq', fread(fid,1,'int16'));            %Center Frequency Method
0108 im_hdr = setfield(im_hdr, 'imode', fread(fid,1,'int16'));              %Imaging Mode
0109 im_hdr = setfield(im_hdr, 'iopt', fread(fid,1,'int32'));               %Imaging Options
0110 im_hdr = setfield(im_hdr, 'pseq', fread(fid,1,'int16'));               %Pulse Sequence
0111 im_hdr = setfield(im_hdr, 'pseqmode', fread(fid,1,'int16'));           %Pulse Sequence Mode
0112 im_hdr = setfield(im_hdr, 'psdname', fread(fid,33,'uchar'));       %Pulse Sequence Name
0113 fseek(fid,1,0); % 16-bit alignment
0114 if byte_align; fseek(fid, 2, 0); end % byte alignment
0115 im_hdr = setfield(im_hdr, 'psd_datetime', fread(fid,1,'int32'));       %PSD Creation Date and Time
0116 im_hdr = setfield(im_hdr, 'psd_iname', fread(fid,13,'uchar'));     %PSD name from inside PSD
0117 fseek(fid, 1, 0); % 16-bit alignment
0118 im_hdr = setfield(im_hdr, 'ctyp', fread(fid,1,'int16'));               %Coil Type
0119 im_hdr = setfield(im_hdr, 'cname', fread(fid,17,'uchar'));         %Coil Name
0120 fseek(fid, 1, 0); % 16-bit alignment
0121 im_hdr = setfield(im_hdr, 'surfctyp', fread(fid,1,'int16'));           %Surface Coil Type
0122 im_hdr = setfield(im_hdr, 'surfcext', fread(fid,1,'int16'));           %Extremity Coil Flag
0123 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0124 im_hdr = setfield(im_hdr, 'rawrunnum', fread(fid,1,'int32'));          %RawData Run Number
0125 im_hdr = setfield(im_hdr, 'cal_fldstr', fread(fid,1,'uint32'));         %Calibrated Field Strength (x10 uGauss)
0126 im_hdr = setfield(im_hdr, 'supp_tech', fread(fid,1,'int16'));          %SAT fat/water/none
0127 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0128 im_hdr = setfield(im_hdr, 'vbw', fread(fid,1,'float32'));                %Variable Bandwidth (Hz)
0129 im_hdr = setfield(im_hdr, 'slquant', fread(fid,1,'int16'));            %Number of slices in this scan group
0130 im_hdr = setfield(im_hdr, 'gpre', fread(fid,1,'int16'));               %Graphically prescribed
0131 im_hdr = setfield(im_hdr, 'intr_del', fread(fid,1,'int32'));           %Interimage/interloc delay (uSec)
0132 im_hdr = setfield(im_hdr, 'user0', fread(fid,1,'float32'));              %User Variable 0
0133 im_hdr = setfield(im_hdr, 'user1', fread(fid,1,'float32'));              %User Variable 1
0134 im_hdr = setfield(im_hdr, 'user2', fread(fid,1,'float32'));              %User Variable 2
0135 im_hdr = setfield(im_hdr, 'user3', fread(fid,1,'float32'));              %User Variable 3
0136 im_hdr = setfield(im_hdr, 'user4', fread(fid,1,'float32'));              %User Variable 4
0137 im_hdr = setfield(im_hdr, 'user5', fread(fid,1,'float32'));              %User Variable 5
0138 im_hdr = setfield(im_hdr, 'user6', fread(fid,1,'float32'));              %User Variable 6
0139 im_hdr = setfield(im_hdr, 'user7', fread(fid,1,'float32'));              %User Variable 7
0140 im_hdr = setfield(im_hdr, 'user8', fread(fid,1,'float32'));              %User Variable 8
0141 im_hdr = setfield(im_hdr, 'user9', fread(fid,1,'float32'));              %User Variable 9
0142 im_hdr = setfield(im_hdr, 'user10', fread(fid,1,'float32'));             %User Variable 10
0143 im_hdr = setfield(im_hdr, 'user11', fread(fid,1,'float32'));             %User Variable 11
0144 im_hdr = setfield(im_hdr, 'user12', fread(fid,1,'float32'));             %User Variable 12
0145 im_hdr = setfield(im_hdr, 'user13', fread(fid,1,'float32'));             %User Variable 13
0146 im_hdr = setfield(im_hdr, 'user14', fread(fid,1,'float32'));             %User Variable 14
0147 im_hdr = setfield(im_hdr, 'user15', fread(fid,1,'float32'));             %User Variable 15
0148 im_hdr = setfield(im_hdr, 'user16', fread(fid,1,'float32'));             %User Variable 16
0149 im_hdr = setfield(im_hdr, 'user17', fread(fid,1,'float32'));             %User Variable 17
0150 im_hdr = setfield(im_hdr, 'user18', fread(fid,1,'float32'));             %User Variable 18
0151 im_hdr = setfield(im_hdr, 'user19', fread(fid,1,'float32'));             %User Variable 19
0152 im_hdr = setfield(im_hdr, 'user20', fread(fid,1,'float32'));             %User Variable 20
0153 im_hdr = setfield(im_hdr, 'user21', fread(fid,1,'float32'));             %User Variable 21
0154 im_hdr = setfield(im_hdr, 'user22', fread(fid,1,'float32'));             %User Variable 22
0155 im_hdr = setfield(im_hdr, 'user23', fread(fid,1,'float32'));             %Projection Angle
0156 im_hdr = setfield(im_hdr, 'user24', fread(fid,1,'float32'));             %Concat Sat Type Flag
0157 im_hdr = setfield(im_hdr, 'im_alloc_key', fread(fid,13,'uchar'));
0158 fseek(fid, 1, 0); % 16-bit alignment
0159 if byte_align; fseek(fid, 2, 0); end % 32-bit alignment
0160 im_hdr = setfield(im_hdr, 'im_lastmod', fread(fid,1,'int32'));         %Date/Time of Last Change
0161 im_hdr = setfield(im_hdr, 'im_verscre', fread(fid,2,'uchar'));     %Genesis Version - Created
0162 im_hdr = setfield(im_hdr, 'im_verscur', fread(fid,2,'uchar'));     %Genesis Version - Now
0163 im_hdr = setfield(im_hdr, 'im_pds_a', fread(fid,1,'int32'));           %PixelData size - as stored
0164 im_hdr = setfield(im_hdr, 'im_pds_c', fread(fid,1,'int32'));           %PixelData size - Compressed
0165 im_hdr = setfield(im_hdr, 'im_pds_u', fread(fid,1,'int32'));           %PixelData size - UnCompressed
0166 im_hdr = setfield(im_hdr, 'im_checksum', fread(fid,1,'int32'));        %AcqRecon record checksum
0167 im_hdr = setfield(im_hdr, 'im_archived', fread(fid,1,'int32'));        %Image Archive Flag
0168 im_hdr = setfield(im_hdr, 'im_complete', fread(fid,1,'int32'));        %Image Complete Flag
0169 im_hdr = setfield(im_hdr, 'satbits', fread(fid,1,'int16'));            %Bitmap of SAT selections
0170 im_hdr = setfield(im_hdr, 'scic', fread(fid,1,'int16'));               %Surface Coil Intensity Correction Flag
0171 im_hdr = setfield(im_hdr, 'satxloc1', fread(fid,1,'int16'));           %R-side SAT pulse loc rel to lndmrk
0172 im_hdr = setfield(im_hdr, 'satxloc2', fread(fid,1,'int16'));           %L-side SAT pulse loc rel to lndmrk
0173 im_hdr = setfield(im_hdr, 'satyloc1', fread(fid,1,'int16'));           %A-side SAT pulse loc rel to lndmrk
0174 im_hdr = setfield(im_hdr, 'satyloc2', fread(fid,1,'int16'));           %P-side SAT pulse loc rel to lndmrk
0175 im_hdr = setfield(im_hdr, 'satzloc1', fread(fid,1,'int16'));           %S-side SAT pulse loc rel to lndmrk
0176 im_hdr = setfield(im_hdr, 'satzloc2', fread(fid,1,'int16'));           %I-side SAT pulse loc rel to lndmrk
0177 im_hdr = setfield(im_hdr, 'satxthick', fread(fid,1,'int16'));          %Thickness of X-axis SAT pulse
0178 im_hdr = setfield(im_hdr, 'satythick', fread(fid,1,'int16'));          %Thickness of Y-axis SAT pulse
0179 im_hdr = setfield(im_hdr, 'satzthick', fread(fid,1,'int16'));          %Thickness of Z-axis SAT pulse
0180 im_hdr = setfield(im_hdr, 'flax', fread(fid,1,'int16'));               %Phase contrast flow axis
0181 im_hdr = setfield(im_hdr, 'venc', fread(fid,1,'int16'));               %Phase contrast velocity encoding
0182 im_hdr = setfield(im_hdr, 'thk_disclmr', fread(fid,1,'int16'));        %Slice Thickness
0183 im_hdr = setfield(im_hdr, 'ps_flag', fread(fid,1,'int16'));            %Auto/Manual Prescan flag
0184 im_hdr = setfield(im_hdr, 'ps_status', fread(fid,1,'int16'));          %Bitmap of changed values
0185 im_hdr = setfield(im_hdr, 'image_type', fread(fid,1,'int16'));         %Magnitude, Phase, Imaginary, or Real
0186 im_hdr = setfield(im_hdr, 'vas_collapse', fread(fid,1,'int16'));       %Collapse Image
0187 im_hdr = setfield(im_hdr, 'user23n', fread(fid,1,'float32'));            %User Variable 23
0188 im_hdr = setfield(im_hdr, 'user24n', fread(fid,1,'float32'));            %User Variable 24
0189 im_hdr = setfield(im_hdr, 'proj_alg', fread(fid,1,'int16'));           %Projection Algorithm
0190 im_hdr = setfield(im_hdr, 'proj_name', fread(fid,13,'uchar'));     %Projection Algorithm Name
0191 fseek(fid, 1, 0); % 16-bit alignment
0192 im_hdr = setfield(im_hdr, 'x_axis_rot', fread(fid,1,'float32'));         %X Axis Rotation
0193 im_hdr = setfield(im_hdr, 'y_axis_rot', fread(fid,1,'float32'));         %Y Axis Rotation
0194 im_hdr = setfield(im_hdr, 'z_axis_rot', fread(fid,1,'float32'));         %Z Axis Rotation
0195 im_hdr = setfield(im_hdr, 'thresh_min1', fread(fid,1,'int32'));        %Lower Range of Pixels 1
0196 im_hdr = setfield(im_hdr, 'thresh_max1', fread(fid,1,'int32'));        %Upper Range of Pixels 1
0197 im_hdr = setfield(im_hdr, 'thresh_min2', fread(fid,1,'int32'));        %Lower Range of Pixels 2
0198 im_hdr = setfield(im_hdr, 'thresh_max2', fread(fid,1,'int32'));        %Upper Range of Pixels 2
0199 im_hdr = setfield(im_hdr, 'echo_trn_len', fread(fid,1,'int16'));       %Echo Train Length for Fast Spin Echo
0200 im_hdr = setfield(im_hdr, 'frac_echo', fread(fid,1,'int16'));          %Fractional Echo - Effective TE Flag
0201 im_hdr = setfield(im_hdr, 'prep_pulse', fread(fid,1,'int16'));         %Preporatory Pulse Option
0202 im_hdr = setfield(im_hdr, 'cphasenum', fread(fid,1,'int16'));          %Cardiac Phase Number
0203 im_hdr = setfield(im_hdr, 'var_echo', fread(fid,1,'int16'));           %Variable Echo Flag
0204 im_hdr = setfield(im_hdr, 'ref_img', fread(fid,1,'uchar'));            %Reference Image Field
0205 im_hdr = setfield(im_hdr, 'sum_img', fread(fid,1,'uchar'));            %Summary Image Field
0206 im_hdr = setfield(im_hdr, 'img_window', fread(fid,1,'uint16'));         %Window Value
0207 im_hdr = setfield(im_hdr, 'img_level', fread(fid,1,'int16'));          %Level Value
0208 im_hdr = setfield(im_hdr, 'slop_int_1', fread(fid,1,'int32'));         %Number of 3D Slabs
0209 im_hdr = setfield(im_hdr, 'slop_int_2', fread(fid,1,'int32'));         %Slice Locs Per 3D Slab
0210 im_hdr = setfield(im_hdr, 'slop_int_3', fread(fid,1,'int32'));         %# of Slice Locs on Each Slab Which Overlap Neighbors
0211 im_hdr = setfield(im_hdr, 'slop_int_4', fread(fid,1,'int32'));         %Image Filtering 0.5/0.2T
0212 im_hdr = setfield(im_hdr, 'slop_int_5', fread(fid,1,'int32'));         %Integer Slop Field 5
0213 im_hdr = setfield(im_hdr, 'slop_float_1', fread(fid,1,'float32'));       %Float Slop Field 1
0214 im_hdr = setfield(im_hdr, 'slop_float_2', fread(fid,1,'float32'));       %Float Slop Field 2
0215 im_hdr = setfield(im_hdr, 'slop_float_3', fread(fid,1,'float32'));       %Float Slop Field 3
0216 im_hdr = setfield(im_hdr, 'slop_float_4', fread(fid,1,'float32'));       %Float Slop Field 4
0217 im_hdr = setfield(im_hdr, 'slop_float_5', fread(fid,1,'float32'));       %Float Slop Field 5
0218 im_hdr = setfield(im_hdr, 'slop_str_1', fread(fid,16,'uchar'));    %String Slop Field 1
0219 im_hdr = setfield(im_hdr, 'slop_str_2', fread(fid,16,'uchar'));    %String Slop Field 2
0220 im_hdr = setfield(im_hdr, 'scanactno', fread(fid,1,'int16'));          %Scan Acquisition Number
0221 im_hdr = setfield(im_hdr, 'vasflags', fread(fid,1,'int16'));           %Magnitude Weighting Flag
0222 im_hdr = setfield(im_hdr, 'vencscale', fread(fid,1,'float32'));          %Scale Weighted Venc
0223 im_hdr = setfield(im_hdr, 'integrity', fread(fid,1,'int16'));          %GE Image Integrity
0224 if byte_align; fseek(fid, 2, 0); end % byte alignment
0225 im_hdr = setfield(im_hdr, 'fphase', fread(fid,1,'int32'));             %Number Of Phases
0226 im_hdr = setfield(im_hdr, 'freq_dir', fread(fid,1,'int16'));           %Frequency Direction
0227 im_hdr = setfield(im_hdr, 'vas_mode', fread(fid,1,'int16'));           %Vascular Mode
0228 im_hdr = setfield(im_hdr, 'image_uid', fread(fid,32,'uchar'));     %Image Unique ID
0229 im_hdr = setfield(im_hdr, 'sop_uid', fread(fid,32,'uchar'));       %Service Obj Class Unique ID
0230 im_hdr = setfield(im_hdr, 'dont_use_1', fread(fid,1,'int16'));         %This field is not used
0231 im_hdr = setfield(im_hdr, 'dont_use_2', fread(fid,1,'int16'));         %This field is not used
0232 im_hdr = setfield(im_hdr, 'dont_use_3', fread(fid,1,'int16'));         %This field is not used
0233 im_hdr = setfield(im_hdr, 'pscopts', fread(fid,1,'int16'));            %bitmap of prescan options
0234 im_hdr = setfield(im_hdr, 'asoffsetx', fread(fid,1,'int16'));          %gradient offset in X-direction
0235 im_hdr = setfield(im_hdr, 'asoffsety', fread(fid,1,'int16'));          %gradient offset in Y-direction
0236 im_hdr = setfield(im_hdr, 'asoffsetz', fread(fid,1,'int16'));          %gradient offset in Z-direction
0237 im_hdr = setfield(im_hdr, 'unoriginal', fread(fid,1,'int16'));         %identifies image as original or unoriginal
0238 im_hdr = setfield(im_hdr, 'interleaves', fread(fid,1,'int16'));        %number of EPI shots
0239 im_hdr = setfield(im_hdr, 'effechospace', fread(fid,1,'int16'));       %effective echo spacing for EPI
0240 im_hdr = setfield(im_hdr, 'viewsperseg', fread(fid,1,'int16'));        %views per segment
0241 im_hdr = setfield(im_hdr, 'rbpm', fread(fid,1,'int16'));               %respiratory rate, breaths per min
0242 im_hdr = setfield(im_hdr, 'rtpoint', fread(fid,1,'int16'));            %respiratory trigger point as percent of max.
0243 im_hdr = setfield(im_hdr, 'rcvrtype', fread(fid,1,'int16'));           %type of receiver used
0244 im_hdr = setfield(im_hdr, 'dbdt', fread(fid,1,'float32'));               %peak rate of change of gradient field, tesla/sec
0245 im_hdr = setfield(im_hdr, 'dbdtper', fread(fid,1,'float32'));            %limit in units of percent of theoretical curve
0246 im_hdr = setfield(im_hdr, 'estdbdtper', fread(fid,1,'float32'));         %PSD estimated limit in units of percent
0247 im_hdr = setfield(im_hdr, 'estdbdtts', fread(fid,1,'float32'));          %PSD estimated limit in Teslas/sec
0248 im_hdr = setfield(im_hdr, 'saravghead', fread(fid,1,'float32'));         %Avg head SAR
0249 im_hdr = setfield(im_hdr, 'neg_scanspacing', fread(fid,1,'float32'));    %Negative scan spacing for overlap slices
0250 im_hdr = setfield(im_hdr, 'offsetfreq', fread(fid,1,'int32'));         %Offset Frequency - Mag.Transfer
0251 im_hdr = setfield(im_hdr, 'user_usage_tag', fread(fid,1,'uint32'));     %Defines how following user CVs are to be filled in
0252                                                  %Default value = 0x00000000
0253                                                   %GE range = 0x00000001 - 0x7fffffff
0254                                                   %Research = 0x80000000 - 0xffffffff
0255 im_hdr = setfield(im_hdr, 'user_fill_mapMSW', fread(fid,1,'uint32'));   %Define what process fills in the user CVs, ifcc or TIR
0256 im_hdr = setfield(im_hdr, 'user_fill_mapLSW', fread(fid,1,'uint32'));   %Define what process fills in the user CVs, ifcc or TIR
0257 im_hdr = setfield(im_hdr, 'user25', fread(fid,1,'float32'));             %User Variable 25
0258 im_hdr = setfield(im_hdr, 'user26', fread(fid,1,'float32'));             %User Variable 26
0259 im_hdr = setfield(im_hdr, 'user27', fread(fid,1,'float32'));             %User Variable 27
0260 im_hdr = setfield(im_hdr, 'user28', fread(fid,1,'float32'));             %User Variable 28
0261 im_hdr = setfield(im_hdr, 'user29', fread(fid,1,'float32'));             %User Variable 29
0262 im_hdr = setfield(im_hdr, 'user30', fread(fid,1,'float32'));             %User Variable 30
0263 im_hdr = setfield(im_hdr, 'user31', fread(fid,1,'float32'));             %User Variable 31
0264 im_hdr = setfield(im_hdr, 'user32', fread(fid,1,'float32'));             %User Variable 32
0265 im_hdr = setfield(im_hdr, 'user33', fread(fid,1,'float32'));             %User Variable 33
0266 im_hdr = setfield(im_hdr, 'user34', fread(fid,1,'float32'));             %User Variable 34
0267 im_hdr = setfield(im_hdr, 'user35', fread(fid,1,'float32'));             %User Variable 35
0268 im_hdr = setfield(im_hdr, 'user36', fread(fid,1,'float32'));             %User Variable 36
0269 im_hdr = setfield(im_hdr, 'user37', fread(fid,1,'float32'));             %User Variable 37
0270 im_hdr = setfield(im_hdr, 'user38', fread(fid,1,'float32'));             %User Variable 38
0271 im_hdr = setfield(im_hdr, 'user39', fread(fid,1,'float32'));             %User Variable 39
0272 im_hdr = setfield(im_hdr, 'user40', fread(fid,1,'float32'));             %User Variable 40
0273 im_hdr = setfield(im_hdr, 'user41', fread(fid,1,'float32'));             %User Variable 41
0274 im_hdr = setfield(im_hdr, 'user42', fread(fid,1,'float32'));             %User Variable 42
0275 im_hdr = setfield(im_hdr, 'user43', fread(fid,1,'float32'));             %User Variable 43
0276 im_hdr = setfield(im_hdr, 'user44', fread(fid,1,'float32'));             %User Variable 44
0277 im_hdr = setfield(im_hdr, 'user45', fread(fid,1,'float32'));             %User Variable 45
0278 im_hdr = setfield(im_hdr, 'user46', fread(fid,1,'float32'));             %User Variable 46
0279 im_hdr = setfield(im_hdr, 'user47', fread(fid,1,'float32'));             %User Variable 47
0280 im_hdr = setfield(im_hdr, 'user48', fread(fid,1,'float32'));             %User Variable 48
0281 im_hdr = setfield(im_hdr, 'slop_int_6', fread(fid,1,'int32'));         %Integer Slop Field 6
0282 im_hdr = setfield(im_hdr, 'slop_int_7', fread(fid,1,'int32'));         %Integer Slop Field 7
0283 im_hdr = setfield(im_hdr, 'slop_int_8', fread(fid,1,'int32'));         %Integer Slop Field 8
0284 im_hdr = setfield(im_hdr, 'slop_int_9', fread(fid,1,'int32'));         %Integer Slop Field 9
0285 im_hdr = setfield(im_hdr, 'mr_padding', fread(fid,32,'uchar'));    %Spare Space
0286 
0287 return

Generated on Sat 24-Aug-2019 04:00:39 by m2html © 2003