Opener
ij.io

Class Opener



  • public class Openerextends Object
    Opens tiff (and tiff stacks), dicom, fits, pgm, jpeg, bmp or gif images, and look-up tables, using a file open dialog or a path. Calls HandleExtraFileTypes plugin if the file type is unrecognised.
    • Constructor Detail

      • Opener

        public Opener()
    • Method Detail

      • open

        public void open()
        Displays a file open dialog box and then opens the tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file selected by the user. Displays an error message if the selected file is not in one of the supported formats. This is the method that ImageJ's File/Open command uses to open files.
      • openMultiple

        public void openMultiple()
        Displays a JFileChooser and then opens the tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text files selected by the user. Displays error messages if one or more of the selected files is not in one of the supported formats. This is the method that ImageJ's File/Open command uses to open files if "Open/Save Using JFileChooser" is checked in EditOptions/Misc.
      • open

        public void open(String path)
        Opens and displays a tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file. Displays an error message if the specified file is not in one of the supported formats.
      • openAndAddToRecent

        public boolean openAndAddToRecent(String path)
        Opens the specified file and adds it to the File/Open Recent menu. Returns true if the file was opened successfully.
      • openImage

        public ImagePlus openImage(String directory,                  String name)
        Attempts to open the specified file as a tiff, bmp, dicom, fits, pgm, gif or jpeg image. Returns an ImagePlus object if successful. Modified by Gregory Jefferis to call HandleExtraFileTypes plugin if the file type is unrecognised.
      • openImage

        public ImagePlus openImage(String path)
        Attempts to open the specified file as a tiff, bmp, dicom, fits, pgm, gif or jpeg. Displays a file open dialog if 'path' is null or an empty string. Returns an ImagePlus object if successful.
      • openImage

        public ImagePlus openImage(String path,                  int n)
        Open the nth image of the specified tiff stack.
      • openURL

        public ImagePlus openURL(String url)
        Attempts to open the specified url as a tiff, zip compressed tiff, dicom, gif or jpeg. Tiff file names must end in ".tif", ZIP file names must end in ".zip" and dicom file names must end in ".dcm". Returns an ImagePlus object if successful.
      • openWithHandleExtraFileTypes

        public ImagePlus openWithHandleExtraFileTypes(String path,                                     int[] fileType)
      • convertGrayJpegTo8Bits

        public static void convertGrayJpegTo8Bits(ImagePlus imp)
        If the specified image is grayscale, convert it to 8-bits.
      • openTiffStack

        public ImagePlus openTiffStack(FileInfo[] info)
        Attemps to open a tiff file as a stack. Returns an ImagePlus object if successful.
      • openTiff

        public ImagePlus openTiff(String directory,                 String name)
        Attempts to open the specified file as a tiff. Returns an ImagePlus object if successful.
      • openTiff

        public ImagePlus openTiff(String path,                 int n)
        Opens the nth image of the specified TIFF stack.
      • openTiff

        public ImagePlus openTiff(InputStream in,                 String name)
        Attempts to open the specified inputStream as a TIFF, returning an ImagePlus object if successful.
      • openZip

        public ImagePlus openZip(String path)
        Opens a single TIFF or DICOM contained in a ZIP archive, or a ZIPed collection of ".roi" files created by the ROI manager.
      • deserialize

        public ImagePlus deserialize(byte[] bytes)
        Deserialize a byte array that was serialized using the FileSaver.serialize().
      • openRoi

        public ij.gui.Roi openRoi(String path)
        Attempts to open the specified ROI, returning null if unsuccessful.
      • openResultsTable

        public static void openResultsTable(String path)
        Opens a tab or comma delimited text file in the Results window.
      • getFileFormat

        public static String getFileFormat(String path)
      • getFileType

        public int getFileType(String path)
        Attempts to determine the image file type by looking for 'magic numbers' and the file name extension.
      • setSilentMode

        public void setSilentMode(boolean mode)
        The "Opening: path" status message is not displayed in silent mode.
      • setOpenUsingPlugins

        public static void setOpenUsingPlugins(boolean b)
        Open all images using HandleExtraFileTypes. Set from a macro using setOption("openUsingPlugins", true).
      • getOpenUsingPlugins

        public static boolean getOpenUsingPlugins()
        Returns the state of the openUsingPlugins flag.

SCaVis 2.1 © jWork.ORG