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: Set zooms into header fields
  
  Sets the spacing of voxels in the x, y, and z dimensions.
  For four-dimensional files, a temporal zoom (repetition time, or TR, in
  ms) may be provided as a fourth sequence element.
  
  Parameters
  ----------
  zooms : sequence
      sequence of floats specifying spatial and (optionally) temporal
      zooms
docstr_tok: ["Set","zooms","into","header","fields","Sets","the","spacing","of","voxels","in","the","x",",","y",",","and","z","dimensions",".","For","four-dimensional","files",",","a","temporal","zoom","(","repetition","time",",","or","TR",",","in","ms",")","may","be","provided","as","a","fourth","sequence","element",".","Parameters","--","--","--","--","--","zooms",":","sequence","sequence","of","floats","specifying","spatial","and","(","optionally",")","temporal","zooms"]
code: def set_zooms(self, zooms):
      """Set zooms into header fields
  
      Sets the spacing of voxels in the x, y, and z dimensions.
      For four-dimensional files, a temporal zoom (repetition time, or TR, in
      ms) may be provided as a fourth sequence element.
  
      Parameters
      ----------
      zooms : sequence
          sequence of floats specifying spatial and (optionally) temporal
          zooms
      """
      hdr = self._structarr
      zooms = np.asarray(zooms)
      ndims = self._ndims()
      if len(zooms) > ndims:
          raise HeaderDataError("Expecting %d zoom values" % ndims)
      if np.any(zooms[:3] <= 0):
          raise HeaderDataError(
              f"Spatial (first three) zooms must be positive; got {tuple(zooms[:3])}"
          )
      hdr["delta"] = zooms[:3]
      if len(zooms) == 4:
          if zooms[3] < 0:
              raise HeaderDataError(
                  f"TR must be non-negative; got {zooms[3]}"
              )
          hdr["tr"] = zooms[3]
  
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 14 for calling the MGHHeader obj's underlying member method code with example usage: obj.set_zooms(zooms) without return types