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: Initialize header from binary data block
  
  Parameters
  ----------
  binaryblock : {None, string} optional
      binary block to set into header.  By default, None, in
      which case we insert the default empty header block
  check : bool, optional
      Whether to check content of header in initialization.
      Default is True.
docstr_tok: ["Initialize","header","from","binary","data","block","Parameters","--","--","--","--","--","binaryblock",":","{","None",",","string","}","optional","binary","block","to","set","into","header",".","By","default",",","None",",","in","which","case","we","insert","the","default","empty","header","block","check",":","bool",",","optional","Whether","to","check","content","of","header","in","initialization",".","Default","is","True","."]
code: def __init__(self, binaryblock=None, check=True):
      """Initialize header from binary data block
  
      Parameters
      ----------
      binaryblock : {None, string} optional
          binary block to set into header.  By default, None, in
          which case we insert the default empty header block
      check : bool, optional
          Whether to check content of header in initialization.
          Default is True.
      """
      min_size = self._hdrdtype.itemsize
      full_size = self.template_dtype.itemsize
      if binaryblock is not None and len(binaryblock) >= min_size:
          # Right zero-pad or truncate binaryblock to appropriate size
          # Footer is optional and may contain variable-length text fields,
          # so limit to fixed fields
          binaryblock = binaryblock[:full_size] + b"\x00" * (
              full_size - len(binaryblock)
          )
      super().__init__(
          binaryblock=binaryblock, endianness="big", check=False
      )
      if not self._structarr["goodRASFlag"]:
          self._set_affine_default()
      if check:
          self.check_fix()
  
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 1 to create a new MGHHeader object from inherited base classes: LabeledWrapStruct, SpatialHeader with example: obj = MGHHeader(binaryblock, check)