FileSaver
ij.io

Class FileSaver



  • public class FileSaverextends Object
    Saves images in tiff, gif, jpeg, raw, zip and text format.
    • Constructor Summary

      Constructors 
      Constructor and Description
      FileSaver(ImagePlus imp)
      Constructs a FileSaver from an ImagePlus.
    • Method Summary

      Methods 
      Modifier and TypeMethod and Description
      StringgetDescriptionString()
      Returns a string containing information about the specified image.
      static intgetJpegQuality()
      Returns the current JPEG quality setting (0-100).
      static booleanokForFits(ImagePlus imp) 
      static booleanokForGif(ImagePlus imp) 
      static booleanokForJpeg(ImagePlus imp)
      Always returns true.
      booleansave()
      Resaves the image.
      booleansaveAsBmp()
      Save the image in BMP format using a save file dialog.
      booleansaveAsBmp(String path)
      Save the image in BMP format using the specified path.
      booleansaveAsFits()
      Save the image in FITS format using a save file dialog.
      booleansaveAsFits(String path)
      Save the image in FITS format using the specified path.
      booleansaveAsGif()
      Save the image in GIF format using a save file dialog.
      booleansaveAsGif(String path)
      Save the image in Gif format using the specified path.
      booleansaveAsJpeg()
      Save the image in JPEG format using a save file dialog.
      booleansaveAsJpeg(String path)
      Save the image in JPEG format using the specified path.
      booleansaveAsLut()
      Save the current LUT using a save file dialog.
      booleansaveAsLut(String path)
      Save the current LUT using the specified path.
      booleansaveAsPgm()
      Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using a save file dialog.
      booleansaveAsPgm(String path)
      Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using the specified path.
      booleansaveAsPng()
      Save the image in PNG format using a save file dialog.
      booleansaveAsPng(String path)
      Save the image in PNG format using the specified path.
      booleansaveAsRaw()
      Save the image or stack as raw data using a save file dialog.
      booleansaveAsRaw(String path)
      Save the image as raw data using the specified path.
      booleansaveAsRawStack(String path)
      Save the stack as raw data using the specified path.
      booleansaveAsText()
      Save the image as tab-delimited text using a save file dialog.
      booleansaveAsText(String path)
      Save the image as tab-delimited text using the specified path.
      booleansaveAsTiff()
      Save the image or stack in TIFF format using a save file dialog.
      booleansaveAsTiff(String path)
      Save the image in TIFF format using the specified path.
      booleansaveAsTiffStack(String path)
      Save the stack as a multi-image TIFF using the specified path.
      booleansaveAsZip()
      Uses a save file dialog to save the image or stack as a TIFF in a ZIP archive.
      booleansaveAsZip(String path)
      Save the image or stack in TIFF/ZIP format using the specified path.
      byte[]serialize()
      Converts this image to a TIFF encoded array of bytes, which can be decoded using Opener.deserialize().
      static voidsetJpegQuality(int quality)
      Specifies the image quality (0-100).
    • Field Detail

    • Constructor Detail

      • FileSaver

        public FileSaver(ImagePlus imp)
        Constructs a FileSaver from an ImagePlus.
    • Method Detail

      • save

        public boolean save()
        Resaves the image. Calls saveAsTiff() if this is a new image, not a TIFF, or if the image was loaded using a URL. Returns false if saveAsTiff() is called and the user selects cancel in the file save dialog box.
      • saveAsTiff

        public boolean saveAsTiff()
        Save the image or stack in TIFF format using a save file dialog. Returns false if the user selects cancel.
      • saveAsTiff

        public boolean saveAsTiff(String path)
        Save the image in TIFF format using the specified path.
      • saveAsTiffStack

        public boolean saveAsTiffStack(String path)
        Save the stack as a multi-image TIFF using the specified path.
      • serialize

        public byte[] serialize()
        Converts this image to a TIFF encoded array of bytes, which can be decoded using Opener.deserialize().
      • saveAsZip

        public boolean saveAsZip()
        Uses a save file dialog to save the image or stack as a TIFF in a ZIP archive. Returns false if the user selects cancel.
      • saveAsZip

        public boolean saveAsZip(String path)
        Save the image or stack in TIFF/ZIP format using the specified path.
      • okForGif

        public static boolean okForGif(ImagePlus imp)
      • saveAsGif

        public boolean saveAsGif()
        Save the image in GIF format using a save file dialog. Returns false if the user selects cancel or the image is not 8-bits.
      • saveAsGif

        public boolean saveAsGif(String path)
        Save the image in Gif format using the specified path. Returns false if the image is not 8-bits or there is an I/O error.
      • okForJpeg

        public static boolean okForJpeg(ImagePlus imp)
        Always returns true.
      • saveAsJpeg

        public boolean saveAsJpeg()
        Save the image in JPEG format using a save file dialog. Returns false if the user selects cancel.
        See Also:
        setJpegQuality, getJpegQuality
      • saveAsJpeg

        public boolean saveAsJpeg(String path)
        Save the image in JPEG format using the specified path.
        See Also:
        setJpegQuality, getJpegQuality
      • saveAsBmp

        public boolean saveAsBmp()
        Save the image in BMP format using a save file dialog. Returns false if the user selects cancel.
      • saveAsBmp

        public boolean saveAsBmp(String path)
        Save the image in BMP format using the specified path.
      • saveAsPgm

        public boolean saveAsPgm()
        Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using a save file dialog. Returns false if the user selects cancel.
      • saveAsPgm

        public boolean saveAsPgm(String path)
        Saves grayscale images in PGM (portable graymap) format and RGB images in PPM (portable pixmap) format, using the specified path.
      • saveAsPng

        public boolean saveAsPng()
        Save the image in PNG format using a save file dialog. Returns false if the user selects cancel.
      • saveAsPng

        public boolean saveAsPng(String path)
        Save the image in PNG format using the specified path.
      • saveAsFits

        public boolean saveAsFits()
        Save the image in FITS format using a save file dialog. Returns false if the user selects cancel.
      • saveAsFits

        public boolean saveAsFits(String path)
        Save the image in FITS format using the specified path.
      • okForFits

        public static boolean okForFits(ImagePlus imp)
      • saveAsRaw

        public boolean saveAsRaw()
        Save the image or stack as raw data using a save file dialog. Returns false if the user selects cancel.
      • saveAsRaw

        public boolean saveAsRaw(String path)
        Save the image as raw data using the specified path.
      • saveAsRawStack

        public boolean saveAsRawStack(String path)
        Save the stack as raw data using the specified path.
      • saveAsText

        public boolean saveAsText()
        Save the image as tab-delimited text using a save file dialog. Returns false if the user selects cancel.
      • saveAsText

        public boolean saveAsText(String path)
        Save the image as tab-delimited text using the specified path.
      • saveAsLut

        public boolean saveAsLut()
        Save the current LUT using a save file dialog. Returns false if the user selects cancel.
      • saveAsLut

        public boolean saveAsLut(String path)
        Save the current LUT using the specified path.
      • getDescriptionString

        public String getDescriptionString()
        Returns a string containing information about the specified image.
      • setJpegQuality

        public static void setJpegQuality(int quality)
        Specifies the image quality (0-100). 0 is poorest image quality, highest compression, and 100 is best image quality, lowest compression.
      • getJpegQuality

        public static int getJpegQuality()
        Returns the current JPEG quality setting (0-100).

SCaVis 2.1 © jWork.ORG