The header looks like:G3
1 DOUBLE
<RES_X> <RES_Y> <RES_Z>
<M_00> <M_01> <M_02> <M_03>
<M_10> <M_11> <M_12> <M_13>
<M_20> <M_21> <M_22> <M_23>
<M_30> <M_31> <M_22> <M_33>
The first two lines describe the contents of the file -- a 3D grid with a double-precision floating point value per cell.
The next line gives the resolution of the grid in x-, y-, and z-directions.
The following four lines give the 4x4 coefficients of the homogenous transformation <M> taking grid-space coordinates to world-coordinates.