mymesh.image.write#

mymesh.image.write(impath, I, filetype=None, verbose=True, dtype=<class 'numpy.int16'>)[source]#

Write an image array to an image file or stack of image files

Parameters:
  • impath (str) – File path to image directory or file name to save the images. If given as a filename with an extension, writing of a single image file will be attempted. For certain data type and file types (e.g. 3D multichannel data), this may not be supported and a stack of images prefixed with the filename will be written instead.

  • I (array_like or tuple) – 2D or 3D array_like containing image data, or 3 or 4 element tuple of 2D or 3D array_like of image data for rgb or rgba multichannel image data.

  • filetype (str, optional) –

    file specification, by default None. If impath is a filename with an extension, the extension will override the filetype input if given. If impath is a directory and no filetype is specified, tiff will be used by default.

    Options are:

    • ’dicom’

    • ’tiff’

    • ’png’

    • ’jpeg’