def parse_basic_header
      # The HEADER_SIGNATURE is defined in NIFTI::Constants and used for both reading and writing.
      header = {}
      HEADER_SIGNATURE.each do |header_item|
        name, length, type = *header_item
        header[name] = @stream.decode(length, type)
      end

      # Extract Freq, Phase & Slice Dimensions from diminfo
      if header['dim_info']
        header['freq_dim'] = dim_info_to_freq_dim(header['dim_info'])
        header['phase_dim'] = dim_info_to_phase_dim(header['dim_info'])
        header['slice_dim'] = dim_info_to_slice_dim(header['dim_info'])
      end
      header['sform_code_descr'] = XFORM_CODES[header['sform_code']]
      header['qform_code_descr'] = XFORM_CODES[header['qform_code']]

      return header
    end
def parse_basic_header
      # The HEADER_SIGNATURE is defined in NIFTI::Constants and used for both reading and writing.
      header = {}
      HEADER_SIGNATURE.each do |header_item|
        name, length, type = *header_item
        header[name] = @stream.decode(length, type)
      end

      # Extract Freq, Phase & Slice Dimensions from diminfo
      if header['dim_info']
        header['freq_dim'] = dim_info_to_freq_dim(header['dim_info'])
        header['phase_dim'] = dim_info_to_phase_dim(header['dim_info'])
        header['slice_dim'] = dim_info_to_slice_dim(header['dim_info'])
      end
      header['sform_code_descr'] = XFORM_CODES[header['sform_code']]
      header['qform_code_descr'] = XFORM_CODES[header['qform_code']]

      return header
    end
Read the nifti header according to its byte signature.
 The file stream will be left open and should be positioned at the end of the 348 byte header.