@nyio.exporter('<STR_LIT>', ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'))<EOL>def save_mgh(filename, obj, like=None, header=None, affine=None, extra=Ellipsis):
obj = to_mgh(obj, like=like, header=header, affine=affine, extra=extra)<EOL>obj.to_filename(filename)<EOL>return filename<EOL>
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.