code: def to_file(self, filename):
          
          filename = os.path.expanduser(filename)
          libfn = utils.get_lib_fn('toFile%s'%self._libsuffix)
          libfn(self.pointer, filename)
docs: Write the ANTsImage to file
  
          Args
          ----
          filename : string
              filepath to which the image will be written