class_docstr: Class for MGH format header
  
  The header also consists of the footer data which MGH places after the data
  chunk.
class_docstr_tok: ["Class","for","MGH","format","header","The","header","also","consists","of","the","footer","data","which","MGH","places","after","the","data","chunk","."]
docstr: Get the affine transform from the header information.
  
  MGH format doesn't store the transform directly. Instead it's gleaned
  from the zooms ( delta ), direction cosines ( Mdc ), RAS centers (
  Pxyz_c ) and the dimensions.
docstr_tok: ["Get","the","affine","transform","from","the","header","information",".","MGH","format","does","n't","store","the","transform","directly",".","Instead","it","'s","gleaned","from","the","zooms","(","delta",")",",","direction","cosines","(","Mdc",")",",","RAS","centers","(","Pxyz_c",")","and","the","dimensions","."]
code: def get_affine(self):
      """Get the affine transform from the header information.
  
      MGH format doesn't store the transform directly. Instead it's gleaned
      from the zooms ( delta ), direction cosines ( Mdc ), RAS centers (
      Pxyz_c ) and the dimensions.
      """
      hdr = self._structarr
      MdcD = hdr["Mdc"].T * hdr["delta"]
      vol_center = MdcD.dot(hdr["dims"][:3]) / 2
      return from_matvec(MdcD, hdr["Pxyz_c"] - vol_center)
  
imports: from os.path import splitext
  import numpy
  from ..affines import from_matvec, voxel_sizes
  from ..arrayproxy import ArrayProxy, reshape_dataobj
  from ..batteryrunners import BatteryRunner, Report
  from ..filebasedimages import SerializableImage
  from ..fileholders import FileHolder
  from ..filename_parser import _stringify_path
  from ..openers import ImageOpener
  from ..spatialimages import HeaderDataError, SpatialHeader, SpatialImage
  from ..volumeutils import Recoder, array_from_file, array_to_file, endian_codes
  from ..wrapstruct import LabeledWrapStruct
label_desc: Use image node_id 6 for calling the MGHHeader obj's underlying member method code with example usage: obj.get_affine() and returns: from_matvec