class_docstr: Class for MGH format image
class_docstr_tok: ["Class","for","MGH","format","image"]
code: def __init__(
      self, dataobj, affine, header=None, extra=None, file_map=None
  ):
      shape = dataobj.shape
      if len(shape) < 3:
          dataobj = reshape_dataobj(
              dataobj, shape + (1,) * (3 - len(shape))
          )
      super().__init__(
          dataobj, affine, header=header, extra=extra, file_map=file_map
      )
  
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 MGHImage object from inherited base classes: SpatialImage, SerializableImage with example: obj = MGHImage(dataobj, affine, header, extra, file_map)