java.lang.Object
ij.io.Opener
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String[]
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Converts the specified RGB image to 8-bits if the 3 channels are identical.deserialize
(byte[] bytes) Deserialize a byte array that was serialized using the FileSaver.serialize().static String
getFileFormat
(String path) int
getFileType
(String path) Attempts to determine the image file type by looking for 'magic numbers' and the file name extension.static String
getLoadRate
(double time, ImagePlus imp) static boolean
Returns the state of the openUsingPlugins flag.static FileInfo[]
getTiffFileInfo
(String path) Returns the FileInfo of the specified TIFF file.static boolean
isFullPath
(String path) static String
makeFullPath
(String path) 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.void
Opens and displays the specified tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file.boolean
openAndAddToRecent
(String path) Opens the specified file and adds it to the File/Open Recent menu.Opens, but does not display, the specified image file and returns an ImagePlus object object if successful, or returns null if the file is not in a supported format or is not found.Open the nth image of the specified tiff stack.Attempts to open the specified file as a tiff, bmp, dicom, fits, pgm, gif or jpeg image.static LUT
Opens a lookup table (LUT) and returns it as a LUT object, or returns null if there is an error.void
Displays a JFileChooser and then opens the tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text files selected by the user.static void
openResultsTable
(String path) Opens a tab or comma delimited text file in the Results window.Attempts to open the specified ROI, returning null if unsuccessful.static void
Opens a tab or comma delimited text file.openTempImage
(String directory, String name) openTextImage
(String dir, String name) Opens the specified text file as a float image.openTiff
(InputStream in, String name) Attempts to open the specified inputStream as a TIFF, returning an ImagePlus object if successful.Opens the nth image of the specified TIFF stack.Attempts to open the specified file as a tiff.openTiffStack
(FileInfo[] info) Attemps to open a tiff file as a stack.Attempts to open the specified url as a tiff, zip compressed tiff, dicom, gif or jpeg.static ImagePlus
openUsingBioFormats
(String path) Opens an image file using the Bio-Formats plugin.static ImagePlus
openUsingImageIO
(String path) openWithHandleExtraFileTypes
(String path, int[] fileTypes) Opens a single TIFF or DICOM contained in a ZIP archive, or a ZIPed collection of ".roi" files created by the ROI manager.static void
setOpenUsingPlugins
(boolean b) Open all images using HandleExtraFileTypes.void
setSilentMode
(boolean mode) The "Opening: path" status message is not displayed in silent mode.static String
Can't open imagej.nih.gov URLs due to encryption so redirect to imagej.net mirror.
-
Field Details
-
UNKNOWN
public static final int UNKNOWN- See Also:
-
TIFF
public static final int TIFF- See Also:
-
DICOM
public static final int DICOM- See Also:
-
FITS
public static final int FITS- See Also:
-
PGM
public static final int PGM- See Also:
-
JPEG
public static final int JPEG- See Also:
-
GIF
public static final int GIF- See Also:
-
LUT
public static final int LUT- See Also:
-
BMP
public static final int BMP- See Also:
-
ZIP
public static final int ZIP- See Also:
-
JAVA_OR_TEXT
public static final int JAVA_OR_TEXT- See Also:
-
ROI
public static final int ROI- See Also:
-
TEXT
public static final int TEXT- See Also:
-
PNG
public static final int PNG- See Also:
-
TIFF_AND_DICOM
public static final int TIFF_AND_DICOM- See Also:
-
CUSTOM
public static final int CUSTOM- See Also:
-
AVI
public static final int AVI- See Also:
-
OJJ
public static final int OJJ- See Also:
-
TABLE
public static final int TABLE- See Also:
-
RAW
public static final int RAW- See Also:
-
types
-
-
Constructor Details
-
Opener
public Opener()
-
-
Method Details
-
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 a supported format. This is the method that ImageJ's File/Open command uses to open files. -
open
Opens and displays the specified tiff, dicom, fits, pgm, jpeg, bmp, gif, lut, roi, or text file. Displays an error message if the file is not in a supported format.- See Also:
-
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. -
openImage
Opens, but does not display, the specified image file and returns an ImagePlus object object if successful, or returns null if the file is not in a supported format or is not found. Displays a file open dialog if 'path' is null or an empty string. -
openImage
Open the nth image of the specified tiff stack.- See Also:
-
getLoadRate
-
makeFullPath
-
isFullPath
-
openAndAddToRecent
Opens the specified file and adds it to the File/Open Recent menu. Returns true if the file was opened successfully. -
openImage
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.- See Also:
-
openTempImage
-
openTextImage
Opens the specified text file as a float image. -
openURL
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.- See Also:
-
updateUrl
Can't open imagej.nih.gov URLs due to encryption so redirect to imagej.net mirror. -
openWithHandleExtraFileTypes
-
openUsingImageIO
-
convertGrayJpegTo8Bits
Converts the specified RGB image to 8-bits if the 3 channels are identical. -
openTiffStack
Attemps to open a tiff file as a stack. Returns an ImagePlus object if successful. -
openTiff
Attempts to open the specified file as a tiff. Returns an ImagePlus object if successful. -
openTiff
Opens the nth image of the specified TIFF stack. -
getTiffFileInfo
Returns the FileInfo of the specified TIFF file. -
openTiff
Attempts to open the specified inputStream as a TIFF, returning an ImagePlus object if successful. -
openZip
Opens a single TIFF or DICOM contained in a ZIP archive, or a ZIPed collection of ".roi" files created by the ROI manager. -
deserialize
Deserialize a byte array that was serialized using the FileSaver.serialize(). -
getName
-
getDir
-
openRoi
Attempts to open the specified ROI, returning null if unsuccessful. -
openUsingBioFormats
Opens an image file using the Bio-Formats plugin. -
openLut
Opens a lookup table (LUT) and returns it as a LUT object, or returns null if there is an error.- See Also:
-
openResultsTable
Opens a tab or comma delimited text file in the Results window. -
openTable
Opens a tab or comma delimited text file. -
getFileFormat
-
getFileType
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.
-