ij.io
Class FileSaver

java.lang.Object
  extended by ij.io.FileSaver

public class FileSaver
extends java.lang.Object

Saves images in tiff, gif, jpeg and raw format.


Constructor Summary
FileSaver(ImagePlus imp)
          Constructs a FileSave from an ImagePlus.
 
Method Summary
static boolean okForGif(ImagePlus imp)
           
static boolean okForJpeg(ImagePlus imp)
           
 boolean save()
          Resaves the image.
 boolean saveAsGif()
          Save the image in GIF format using a save file dialog.
 boolean saveAsGif(java.lang.String path)
          Save the image in Gif format using the specified path.
 boolean saveAsJpeg()
          Save the image in JPEG format using a save file dialog.
 boolean saveAsJpeg(java.lang.String path)
          Save the image in JPEG format using the specified path.
 boolean saveAsLut()
          Save the current LUT using a save file dialog.
 boolean saveAsLut(java.lang.String path)
          Save the current LUT using the specified path.
 boolean saveAsRaw()
          Save the image or stack as raw data using a save file dialog.
 boolean saveAsRaw(java.lang.String path)
          Save the image as raw data using the specified path.
 boolean saveAsRawStack(java.lang.String path)
          Save the stack as raw data using the specified path.
 boolean saveAsText()
          Save the image as tab-delimited text using a save file dialog.
 boolean saveAsText(java.lang.String path)
          Save the image as tab-delimited text using the specified path.
 boolean saveAsTiff()
          Save the image or stack in TIFF format using a save file dialog.
 boolean saveAsTiff(java.lang.String path)
          Save the image in TIFF format using the specified path.
 boolean saveAsTiffStack(java.lang.String path)
          Save the stack as a multi-image TIFF using the specified path.
 boolean saveAsZip()
          Uses a save file dialog to save the image or stack as a TIFF in a ZIP archive.
 boolean saveAsZip(java.lang.String path)
          Save the image or stack in TIFF/ZIP format using the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSaver

public FileSaver(ImagePlus imp)
Constructs a FileSave from an ImagePlus.

Method Detail

save

public boolean save()
Resaves the image. Calls saveAsTiff() if this is a new image 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(java.lang.String path)
Save the image in TIFF format using the specified path.


saveAsTiffStack

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


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(java.lang.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(java.lang.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)

saveAsJpeg

public boolean saveAsJpeg()
Save the image in JPEG format using a save file dialog. Returns false if the user selects cancel or the image is 16 or 32-bit grayscale.


saveAsJpeg

public boolean saveAsJpeg(java.lang.String path)
Save the image in JPEG format using the specified path.


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(java.lang.String path)
Save the image as raw data using the specified path.


saveAsRawStack

public boolean saveAsRawStack(java.lang.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(java.lang.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(java.lang.String path)
Save the current LUT using the specified path.