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: Class method to create MGH header from another MGH header
docstr_tok: ["Class","method","to","create","MGH","header","from","another","MGH","header"]
code: def from_header(klass, header=None, check=True):
      """Class method to create MGH header from another MGH header"""
      # own type, return copy
      if type(header) == klass:
          obj = header.copy()
          if check:
              obj.check_fix()
          return obj
      # not own type, make fresh header instance
      obj = klass(check=check)
      return obj
  
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 4 for calling the MGHHeader obj's underlying member method code with example usage: obj.from_header(klass, header, check) and returns: obj, obj