|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.ImagePlus
public class ImagePlus
This is an extended image class that supports 8-bit, 16-bit, 32-bit (real) and RGB images. It also provides support for 3D image stacks.
ImageProcessor
,
ImageStack
,
ImageWindow
,
ImageCanvas
Field Summary | |
---|---|
boolean |
changes
True if any changes have been made to this image. |
static int |
COLOR_256
8-bit indexed color |
static int |
COLOR_RGB
32-bit RGB color |
static int |
GRAY16
16-bit grayscale (unsigned) |
static int |
GRAY32
32-bit floating-point grayscale |
static int |
GRAY8
8-bit grayscale (unsigned) |
protected int |
height
|
protected java.awt.Image |
img
|
protected ImageProcessor |
ip
|
protected boolean |
locked
|
double |
pixelDepth
Obsolete. |
double |
pixelHeight
Obsolete. |
double |
pixelWidth
Obsolete. |
boolean |
sCalibrated
Obsolete. |
java.lang.String |
unit
Obsolete. |
java.lang.String |
units
Obsolete. |
protected int |
width
|
protected ImageWindow |
win
|
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Fields inherited from interface ij.measure.Measurements |
---|
AREA, CENTER_OF_MASS, CENTROID, LABELS, LIMIT, MAX_STANDARDS, MEAN, MIN_MAX, MODE, PERIMETER, RECT, STD_DEV |
Constructor Summary | |
---|---|
ImagePlus()
Constructs an uninitialized ImagePlus. |
|
ImagePlus(java.lang.String url)
Constructs an ImagePlus from a TIFF, ZIP compressed TIFF, GIF or JPEG specified by a URL. |
|
ImagePlus(java.lang.String title,
java.awt.Image img)
Constructs an ImagePlus from an AWT Image. |
|
ImagePlus(java.lang.String title,
ImageProcessor ip)
Constructs an ImagePlus from an ImageProcessor. |
|
ImagePlus(java.lang.String title,
ImageStack stack)
Constructs an ImagePlus from a stack. |
Method Summary | |
---|---|
void |
copyScale(ImagePlus imp)
Copies the calibration of the specified image to this image. |
ImageStack |
createEmptyStack()
Returns an empty image stack that has the same width, height and color table as this image. |
ImagePlus |
createImagePlus()
Returns a new ImagePlus with this ImagePlus' attributes (e.g. |
LookUpTable |
createLut()
Creates a LookUpTable object corresponding to this image. |
void |
createNewRoi(int x,
int y)
Creates a new selection. |
void |
draw()
Displays this image. |
void |
draw(int x,
int y,
int width,
int height)
Draws image and roi outline using a clip rect. |
void |
flush()
Sets the image arrays to null to help the garbage collector do its job. |
Calibration |
getCalibration()
Returns this image's calibration. |
int |
getCurrentSlice()
Returns the current stack slice number or 1 if this is a single image. |
FileInfo |
getFileInfo()
Returns a FileInfo object containing information, including the pixel array, needed to save this image. |
int |
getHeight()
|
int |
getID()
Returns this image's unique numeric ID. |
java.awt.Image |
getImage()
Returns the current AWT image. |
int[] |
getMask()
|
FileInfo |
getOriginalFileInfo()
Returns the FileInfo object that was used to open this image. |
int[] |
getPixel(int x,
int y)
Returns the pixel value at (x,y) as a 4 element array. |
ImageProcessor |
getProcessor()
Returns a reference to the current ImageProcessor. |
java.util.Properties |
getProperties()
Returns this image's Properties. |
java.lang.Object |
getProperty(java.lang.String key)
Returns the property associated with 'key'. |
Roi |
getRoi()
|
ImageStack |
getStack()
Returns the image stack. |
int |
getStackSize()
If this is a stack, return the number of slices, else return 1. |
long |
getStartTime()
Returns the time in milliseconds when startTiming() was last called. |
ImageStatistics |
getStatistics()
Returns an ImageStatistics object generated using the standard measurement options (area, mean, mode, min and max). |
ImageStatistics |
getStatistics(int mOptions)
Returns an ImageStatistics object generated using the specified measurement options. |
ImageStatistics |
getStatistics(int mOptions,
int nBins)
Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. |
java.lang.String |
getTitle()
Returns the image name. |
int |
getType()
Returns the current image type. |
int |
getWidth()
|
ImageWindow |
getWindow()
Returns the ImageWindow that is being used to display this image. |
void |
hide()
Closes the window, if any, that is displaying this image. |
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int w,
int h)
Used by ImagePlus to monitor loading of images. |
boolean |
isInvertedLut()
Returns true is this image uses an inverted LUT that displays zero as white. |
boolean |
isProcessor()
|
void |
killProcessor()
Obsolete. |
void |
killRoi()
Deletes the current region of interest. |
void |
killStack()
|
boolean |
lock()
Locks the image so other threads can test to see if it is in use. |
boolean |
lockSilently()
Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails. |
void |
mouseMoved(int x,
int y)
Displays the cursor coordinates and pixel value in the status bar. |
void |
repaintWindow()
Calls draw to draw the image and also repaints the image window to force the information displayed above the image (dimension, type, size) to be updated. |
void |
setCalibration(Calibration cal)
Sets this image's calibration. |
void |
setColor(java.awt.Color c)
Sets current foreground color. |
void |
setFileInfo(FileInfo fi)
Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo(). |
void |
setGlobalCalibration(Calibration global)
Sets the system-wide calibration. |
void |
setImage(java.awt.Image img)
Replaces the AWT image, if any, with the one specified. |
void |
setProcessor(java.lang.String title,
ImageProcessor ip)
Replaces the ImageProcessor, if any, with the one specified. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Adds a key-value pair to this image's properties. |
void |
setRoi(int x,
int y,
int width,
int height)
Creates a rectangular selection. |
void |
setRoi(java.awt.Rectangle r)
Creates a rectangular selection. |
void |
setRoi(Roi roi)
|
void |
setSlice(int index)
Activates the specified slice. |
void |
setStack(java.lang.String title,
ImageStack stack)
Replaces the stack, if any, with the one specified. |
void |
setTitle(java.lang.String title)
Sets the image name. |
protected void |
setType(int type)
|
void |
setWindow(ImageWindow win)
This method should only be called from an ImageWindow. |
void |
show()
Opens a window to display this image and clears the status bar. |
void |
show(java.lang.String statusMessage)
Opens a window to display this image and displays 'statusMessage' in the status bar. |
void |
startTiming()
Calls System.currentTimeMillis() to save the current time so it can be retrieved later using getStartTime() to calculate the elapsed time of an operation. |
void |
trimProcessor()
Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. |
void |
unlock()
Unlocks the image. |
void |
updateAndDraw()
Updates this image from the pixel data in its associated ImageProcessor, then displays it. |
void |
updateAndRepaintWindow()
Calls updateAndDraw to update from the pixel data and draw the image, and also repaints the image window to force the information displayed above the image (dimension, type, size) to be updated. |
void |
updateImage()
ImageCanvas.paint() calls this method when the ImageProcessor has generated new image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int GRAY8
public static final int GRAY16
public static final int GRAY32
public static final int COLOR_256
public static final int COLOR_RGB
public boolean changes
public double pixelWidth
public double pixelHeight
public double pixelDepth
public java.lang.String unit
public java.lang.String units
public boolean sCalibrated
protected java.awt.Image img
protected ImageProcessor ip
protected ImageWindow win
protected int width
protected int height
protected boolean locked
Constructor Detail |
---|
public ImagePlus()
public ImagePlus(java.lang.String title, java.awt.Image img)
public ImagePlus(java.lang.String title, ImageProcessor ip)
public ImagePlus(java.lang.String url)
public ImagePlus(java.lang.String title, ImageStack stack)
Method Detail |
---|
public boolean lock()
public boolean lockSilently()
public void unlock()
public void draw()
public void draw(int x, int y, int width, int height)
public void updateAndDraw()
public void repaintWindow()
public void updateAndRepaintWindow()
public void updateImage()
public void hide()
public void show()
public void show(java.lang.String statusMessage)
public java.awt.Image getImage()
public int getID()
public void setImage(java.awt.Image img)
public void setProcessor(java.lang.String title, ImageProcessor ip)
public void setStack(java.lang.String title, ImageStack stack)
public void setFileInfo(FileInfo fi)
public ImageWindow getWindow()
public void setWindow(ImageWindow win)
public void setColor(java.awt.Color c)
public boolean isProcessor()
public ImageProcessor getProcessor()
public void trimProcessor()
public void killProcessor()
public int[] getMask()
public ImageStatistics getStatistics()
public ImageStatistics getStatistics(int mOptions)
public ImageStatistics getStatistics(int mOptions, int nBins)
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public int getWidth()
public int getHeight()
public int getStackSize()
public int getType()
protected void setType(int type)
public void setProperty(java.lang.String key, java.lang.Object value)
public java.lang.Object getProperty(java.lang.String key)
public java.util.Properties getProperties()
public LookUpTable createLut()
public boolean isInvertedLut()
public int[] getPixel(int x, int y)
public ImageStack createEmptyStack()
public ImageStack getStack()
public int getCurrentSlice()
public void killStack()
public void setSlice(int index)
public Roi getRoi()
public void setRoi(Roi roi)
public void setRoi(int x, int y, int width, int height)
public void setRoi(java.awt.Rectangle r)
public void createNewRoi(int x, int y)
public void killRoi()
public FileInfo getFileInfo()
FileInfo
,
getOriginalFileInfo
,
setFileInfo
public FileInfo getOriginalFileInfo()
FileInfo
,
getFileInfo
public boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)
imageUpdate
in interface java.awt.image.ImageObserver
public void flush()
public ImagePlus createImagePlus()
public void copyScale(ImagePlus imp)
public void startTiming()
public long getStartTime()
public Calibration getCalibration()
public void setCalibration(Calibration cal)
public void setGlobalCalibration(Calibration global)
public void mouseMoved(int x, int y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |