docs: def save_mgh(filename, obj, like=None, header=None, affine=None, extra=Ellipsis):
      '''
      save_mgh(filename, obj) saves the given object to the given filename in the mgh format and
        returns the filename.
  
      All options that can be given to the to_mgh function can also be passed to this function; they
      are used to modify the object prior to exporting it.
      '''
      obj = to_mgh(obj, like=like, header=header, affine=affine, extra=extra)
      obj.to_filename(filename)
      return filename