Class: ImagePlus

ImagePlus

new ImagePlus(title, img)

Constructs an ImagePlus from an Image or BufferedImage. The first argument will be used as the title of the window that displays the image. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
title java.lang.String

-

img java.awt.Image

-

Author:
  • Created by ijdoc2js

Members

(static, constant) changes :boolean

True if any changes have been made to this image.

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) COLOR_256 :int

8-bit indexed color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COLOR_RGB :int

32-bit RGB color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY8 :int

8-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY16 :int

16-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY32 :int

32-bit floating-point grayscale

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) setIJMenuBar :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) typeSet :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

Methods

addImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a shallow copy of this ImagePlus.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

close()

Closes this image and sets the ImageProcessor to null. To avoid the "Save changes?" dialog, first set the public 'changes' variable to false.

Author:
  • Created by ijdoc2js

convertIndexToPosition(n)

Converts the stack index 'n' (one-based) into a hyperstack position (channel, slice, frame).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

copy()

Copies the contents of the current selection, or the entire image if there is no selection, to the internal clipboard.

Author:
  • Created by ijdoc2js

copy(cut)

Copies the contents of the current selection to the internal clipboard. Copies the entire image if there is no selection. Also clears the selection if cut is true.

Parameters:
Name Type Description
cut boolean

-

Author:
  • Created by ijdoc2js

copyAttributes(imp)

Copies attributes (name, ID, calibration, path) of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

copyScale(imp)

Copies the calibration of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

createEmptyStack()

Returns an empty image stack that has the same width, height and color table as this image.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

createHyperStack(title, channels, slices, frames, bitDepth)

This method has been replaced by IJ.createHyperStack().

Parameters:
Name Type Description
title java.lang.String

-

channels int

-

slices int

-

frames int

-

bitDepth int

-

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createImagePlus()

Returns a new ImagePlus with this image's attributes (e.g. spatial scale), but no image.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createLut()

Creates a LookUpTable object that corresponds to this image.

Author:
  • Created by ijdoc2js
Returns:

LookUpTable

createNewRoi(sx, sy)

Starts the process of creating a new selection, where sx and sy are the starting screen coordinates. The selection type is determined by which tool in the tool bar is active. The user interactively sets the selection size and shape.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js

crop()

Returns a copy this image or stack slice, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

deleteRoi()

Deletes the current region of interest. Makes a copy of the ROI so it can be recovered by Edit/Selection/Restore Selection.

Author:
  • Created by ijdoc2js

draw()

Draws the image. If there is an ROI, its outline is also displayed. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

draw(x, y, width, height)

Draws image and roi outline using a clip rect.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

duplicate()

Returns a copy of this image or stack, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flatten()

Returns a "flattened" version of this image, in RGB format.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flattenStack()

Flattens all slices of this stack or HyperStack.

Author:
  • Created by ijdoc2js

flush()

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

Author:
  • Created by ijdoc2js

getAllStatistics()

This method returns complete calibrated statistics for this image or ROI (with "Limit to threshold"), but it is up to 70 times slower than getStatistics().

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getBitDepth()

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getBufferedImage()

Returns a copy of this image as an 8-bit or RGB BufferedImage.

Author:
  • Created by ijdoc2js
Returns:

java.awt.image.BufferedImage

getBytesPerPixel()

Returns the number of bytes per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getC()

Returns the current hyperstack channel position.

Author:
  • Created by ijdoc2js
Returns:

int

getCalibration()

Returns this image's calibration.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getCanvas()

Returns the ImageCanvas being used to display this image, or null.

Author:
  • Created by ijdoc2js
Returns:

ImageCanvas

getChannel()

Author:
  • Created by ijdoc2js
Returns:

int

getChannelProcessor()

Returns a reference to the current ImageProcessor. The CompositeImage class overrides this method to return the processor associated with the current channel.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getClipboard()

Returns the internal clipboard or null if the internal clipboard is empty.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getCompositeMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a CompositeImage, otherwise returns -1.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentSlice()

Returns the current stack index (one-based) or 1 if this is a single image.

Author:
  • Created by ijdoc2js
Returns:

int

getDefault16bitRange()

Returns the default 16-bit display range, 0 (auto-scaling), 8, 10, 12, 14, 15 or 16.

Author:
  • Created by ijdoc2js
Returns:

int

getDimensions(varify)

Parameters:
Name Type Description
varify boolean

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getDimensions()

Returns the dimensions of this image (width, height, nChannels, nSlices, nFrames) as a 5 element int array.

Author:
  • Created by ijdoc2js
Returns:

int[]

getDisplayMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a composite color image, or 0 if it not.

Author:
  • Created by ijdoc2js
Returns:

int

getDisplayRangeMax()

Author:
  • Created by ijdoc2js
Returns:

double

getDisplayRangeMin()

Author:
  • Created by ijdoc2js
Returns:

double

getFileInfo()

Returns a FileInfo object containing information, including the pixel array, needed to save this image. Use getOriginalFileInfo() to get a copy of the FileInfo object used to open the image.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getFrame()

Author:
  • Created by ijdoc2js
Returns:

int

getGlobalCalibration()

Returns the system-wide calibration, or null.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getHeight()

Author:
  • Created by ijdoc2js
Returns:

int

getHideOverlay()

Author:
  • Created by ijdoc2js
Returns:

boolean

getID()

Returns this image's unique numeric ID.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns this image as a AWT image.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Image

getImageStack()

Returns the base image stack.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getImageStackSize()

If this is a stack, returns the actual number of images in the stack, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getInfoProperty()

Returns the "Info" property string, or null if it is not found.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLocalCalibration()

Returns this image's local calibration, ignoring the "Global" calibration flag.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getLocationAsString(x, y)

Converts the current cursor location to a string.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLuts()

Returns an array containing the lookup tables used by this image, one per channel, or an empty array if this is an RGB image.

Author:
  • Created by ijdoc2js
Returns:

LUT[]

getMask()

For images with irregular ROIs, returns a byte mask, otherwise, returns null. Mask pixels have a non-zero value.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getNChannels()

Returns the number of channels.

Author:
  • Created by ijdoc2js
Returns:

int

getNDimensions()

Returns the number of dimensions (2, 3, 4 or 5).

Author:
  • Created by ijdoc2js
Returns:

int

getNFrames()

Returns the number of frames (time-points).

Author:
  • Created by ijdoc2js
Returns:

int

getNSlices()

Returns the image depth (number of z-slices).

Author:
  • Created by ijdoc2js
Returns:

int

getNumericProperty(key)

Returns the numeric value from the "Info" property string associated with 'key', or NaN if the key is not found or the value associated with the key is not numeric. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

double

getOpenAsHyperStack()

Author:
  • Created by ijdoc2js
Returns:

boolean

getOriginalFileInfo()

Returns the FileInfo object that was used to open this image. Returns null for images created using the File/New command.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getOverlay()

Returns the current overly, or null if this image does not have an overlay.

Author:
  • Created by ijdoc2js
Returns:

Overlay

getPixel(x, y)

Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getProcessor()

Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getProp(key)

Deprecated. 

Parameters:
Name Type Description
key java.lang.String

-

Deprecated:
Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperties()

Returns this image's Properties. May return null.

Author:
  • Created by ijdoc2js
Returns:

java.util.Properties

getProperty(key)

Returns the property associated with 'key', or null if it is not found.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

getRawStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getRoi()

Returns the current selection, or null if there is no selection.

Author:
  • Created by ijdoc2js
Returns:

Roi

getShortTitle()

Returns a shortened version of image name that does not include spaces or a file name extension.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getSlice()

Author:
  • Created by ijdoc2js
Returns:

int

getStack()

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getStackIndex(channel, slice, frame)

Returns that stack index (one-based) corresponding to the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js
Returns:

int

getStackSize()

If this is a stack, returns the number of slices, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getStartTime()

Returns the time in milliseconds when startTiming() was last called.

Author:
  • Created by ijdoc2js
Returns:

long

getStaticGlobalCalibration()

This is a version of getGlobalCalibration() that can be called from a static context.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getStatistics(mOptions, nBins, histMin, histMax)

Returns an ImageStatistics object generated using the specified measurement options, histogram bin count and histogram range. Note: for 8-bit and RGB images, the number of bins is fixed at 256 and the histogram range is always 0-255.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

histMin double

-

histMax double

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions, nBins)

Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. Note: except for float images, the number of bins is currently fixed at 256.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics()

Get calibrated statistics for this image or ROI, including histogram, area, mean, min and max, standard deviation and mode. This code demonstrates how to get the area, mean max and median of the current image or selection:

 imp = IJ.getImage();
stats = imp.getStatistics();
IJ.log("Area: "+stats.area);
IJ.log("Mean: "+stats.mean);
IJ.log("Max: "+stats.max);
Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions)

Returns an ImageStatistics object generated using the specified measurement options.

Parameters:
Name Type Description
mOptions int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStringProperty(key)

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getT()

Returns the current hyperstack frame position.

Author:
  • Created by ijdoc2js
Returns:

int

getTitle()

Returns the image name.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getType()

Returns the current image type (ImagePlus.GRAY8, ImagePlus.GRAY16, ImagePlus.GRAY32, ImagePlus.COLOR_256 or ImagePlus.COLOR_RGB).

Author:
  • Created by ijdoc2js
Returns:

int

getWidth()

Author:
  • Created by ijdoc2js
Returns:

int

getWindow()

Returns the ImageWindow that is being used to display this image. Returns null if show() has not be called or the ImageWindow has been closed.

Author:
  • Created by ijdoc2js
Returns:

ImageWindow

getZ()

Returns the current hyperstack slice position.

Author:
  • Created by ijdoc2js
Returns:

int

hide()

Closes the window, if any, that is displaying this image.

Author:
  • Created by ijdoc2js

imageUpdate(img, flags, x, y, w, h)

Used by ImagePlus to monitor loading of images.

Parameters:
Name Type Description
img java.awt.Image

-

flags int

-

x int

-

y int

-

w int

-

h int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

isComposite()

Returns true if this is a CompositeImage.

Author:
  • Created by ijdoc2js
Returns:

boolean

isDisplayedHyperStack()

Returns 'true' if this is a hyperstack currently being displayed in a StackWindow.

Author:
  • Created by ijdoc2js
Returns:

boolean

isHyperStack()

Returns 'true' if this image is a hyperstack.

Author:
  • Created by ijdoc2js
Returns:

boolean

isInvertedLut()

Returns true is this image uses an inverting LUT that displays zero as white and 255 as black.

Author:
  • Created by ijdoc2js
Returns:

boolean

isLocked()

Returns 'true' if the image is locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

isProcessor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isThreshold()

Returns 'true' if this image is thresholded.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this image is currently being displayed in a window.

Author:
  • Created by ijdoc2js
Returns:

boolean

killRoi()

Deletes the current region of interest.

Author:
  • Created by ijdoc2js

killStack()

Author:
  • Created by ijdoc2js

lock()

Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

lockSilently()

Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails.

Author:
  • Created by ijdoc2js
Returns:

boolean

mouseMoved(x, y)

Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

paste()

Inserts the contents of the internal clipboard into the active image. If there is a selection the same size as the image on the clipboard, the image is inserted into that selection, otherwise the selection is inserted into the center of the image.

Author:
  • Created by ijdoc2js

removeImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

resetClipboard()

Clears the internal clipboard.

Author:
  • Created by ijdoc2js

resetDisplayRange()

Author:
  • Created by ijdoc2js

resetStack()

Author:
  • Created by ijdoc2js

restoreRoi()

Author:
  • Created by ijdoc2js

revert()

Implements the File/Revert command.

Author:
  • Created by ijdoc2js

saveRoi()

Author:
  • Created by ijdoc2js

setActivated()

Called by ImageWindow.windowActivated().

Author:
  • Created by ijdoc2js

setActiveChannels(channels)

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

Parameters:
Name Type Description
channels java.lang.String

-

Author:
  • Created by ijdoc2js

setAntialiasRendering(antialiasRendering)

Enable/disable use of antialiasing by the flatten() method.

Parameters:
Name Type Description
antialiasRendering boolean

-

Author:
  • Created by ijdoc2js

setC(channel)

Sets the hyperstack channel position (one based).

Parameters:
Name Type Description
channel int

-

Author:
  • Created by ijdoc2js

setCalibration(cal)

Sets this image's calibration.

Parameters:
Name Type Description
cal Calibration

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets current foreground color.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setDefault16bitRange(bitDepth)

Set the default 16-bit display range, where 'bitDepth' must be 0 (auto-scaling), 8 (0-255), 10 (0-1023), 12 (0-4095, 14 (0-16383), 15 (0-32767) or 16 (0-65535).

Parameters:
Name Type Description
bitDepth int

-

Author:
  • Created by ijdoc2js

setDimensions(nChannels, nSlices, nFrames)

Sets the 3rd, 4th and 5th dimensions, where nChannelsnSlicesnFrames must be equal to the stack size.

Parameters:
Name Type Description
nChannels int

-

nSlices int

-

nFrames int

-

Author:
  • Created by ijdoc2js

setDisplayMode(mode)

Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE.

Parameters:
Name Type Description
mode int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max, channels)

Sets the display range of specified channels in an RGB image, where 4=red, 2=green, 1=blue, 6=red+green, etc. With non-RGB images, this method is identical to setDisplayRange(min, max). This method is used by the Image/Adjust/Color Balance tool .

Parameters:
Name Type Description
min double

-

max double

-

channels int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max)

Sets the display range of the current channel. With non-composite images it is identical to ip.setMinAndMax(min, max).

Parameters:
Name Type Description
min double

-

max double

-

Author:
  • Created by ijdoc2js

setFileInfo(fi)

Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo().

Parameters:
Name Type Description
fi FileInfo

-

Author:
  • Created by ijdoc2js

setGlobalCalibration(global)

Sets the system-wide calibration.

Parameters:
Name Type Description
global Calibration

-

Author:
  • Created by ijdoc2js

setHideOverlay(hide)

Parameters:
Name Type Description
hide boolean

-

Author:
  • Created by ijdoc2js

setIgnoreFlush(ignoreFlush)

Parameters:
Name Type Description
ignoreFlush boolean

-

Author:
  • Created by ijdoc2js

setIgnoreGlobalCalibration(ignoreGlobalCalibration)

Parameters:
Name Type Description
ignoreGlobalCalibration boolean

-

Author:
  • Created by ijdoc2js

setIJMenuBar()

Author:
  • Created by ijdoc2js
Returns:

boolean

setIJMenuBar(b)

Parameters:
Name Type Description
b boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Replaces this image with the specified ImagePlus. May not work as expected if 'imp' is a CompositeImage and this image is not.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setImage(img)

Replaces the image, if any, with the one specified. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
img java.awt.Image

-

Author:
  • Created by ijdoc2js

setLut(lut)

Assigns a LUT (lookup table) to this image.

Parameters:
Name Type Description
lut LUT

-

Author:
  • Created by ijdoc2js

setOpenAsHyperStack(openAsHyperStack)

Parameters:
Name Type Description
openAsHyperStack boolean

-

Author:
  • Created by ijdoc2js

setOverlay(roi, strokeColor, strokeWidth, fillColor)

Creates an Overlay from the specified ROI, and assigns it to this image.

Parameters:
Name Type Description
roi Roi

-

strokeColor java.awt.Color

-

strokeWidth int

-

fillColor java.awt.Color

-

Author:
  • Created by ijdoc2js

setOverlay(shape, color, stroke)

Creates an Overlay from the specified Shape, Color and BasicStroke, and assigns it to this image.

Parameters:
Name Type Description
shape java.awt.Shape

-

color java.awt.Color

-

stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

setOverlay(overlay)

Installs a list of ROIs that will be drawn on this image as a non-destructive overlay.

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setPosition(n)

Set the current hyperstack position based on the stack index 'n' (one-based).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setPositionWithoutUpdate(channel, slice, frame)

Sets the current hyperstack position without updating the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setProcessor(title, ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as other images in the stack and it must be the same width and height. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProcessor(ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as the other images in the stack and it must be the same width and height.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Adds a key-value pair to this image's properties. The key is removed from the properties table if value is null.

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.Object

-

Author:
  • Created by ijdoc2js

setRoi(newRoi, updateDisplay)

Assigns 'newRoi' to this image and displays it if 'updateDisplay' is true.

Parameters:
Name Type Description
newRoi Roi

-

updateDisplay boolean

-

Author:
  • Created by ijdoc2js

setRoi(newRoi)

Assigns the specified ROI to this image and displays it. Any existing ROI is deleted if roi is null or its width or height is zero.

Parameters:
Name Type Description
newRoi Roi

-

Author:
  • Created by ijdoc2js

setRoi(r)

Creates a rectangular selection.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

setRoi(x, y, width, height)

Creates a rectangular selection.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

setSlice(n)

Displays the specified stack image, where 1<=n<=stackSize. Does nothing if this image is not a stack.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setSliceWithoutUpdate(n)

Displays the specified stack image (1<=n<=stackSize) without updating the display.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setStack(stack)

Replaces the image with the specified stack and updates the display.

Parameters:
Name Type Description
stack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(title, newStack)

Replaces the image with the specified stack and updates the display. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

newStack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(newStack, channels, slices, frames)

Parameters:
Name Type Description
newStack ImageStack

-

channels int

-

slices int

-

frames int

-

Author:
  • Created by ijdoc2js

setT(frame)

Sets the hyperstack frame position (one based).

Parameters:
Name Type Description
frame int

-

Author:
  • Created by ijdoc2js

setTitle(title)

Sets the image name.

Parameters:
Name Type Description
title java.lang.String

-

Author:
  • Created by ijdoc2js

setWindow(win)

This method should only be called from an ImageWindow.

Parameters:
Name Type Description
win ImageWindow

-

Author:
  • Created by ijdoc2js

setZ(slice)

Sets the hyperstack slice position (one based).

Parameters:
Name Type Description
slice int

-

Author:
  • Created by ijdoc2js

show()

Opens a window to display this image and clears the status bar.

Author:
  • Created by ijdoc2js

show(statusMessage)

Opens a window to display this image and displays 'statusMessage' in the status bar.

Parameters:
Name Type Description
statusMessage java.lang.String

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

trimProcessor()

Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null.

Author:
  • Created by ijdoc2js

unlock()

Unlocks the image.

Author:
  • Created by ijdoc2js

updateAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

updateChannelAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel.

Author:
  • Created by ijdoc2js

updateImage()

ImageCanvas.paint() calls this method when the ImageProcessor has generated new image.

Author:
  • Created by ijdoc2js

updatePosition(c, z, t)

Parameters:
Name Type Description
c int

-

z int

-

t int

-

Author:
  • Created by ijdoc2js

updateStatusbarValue()

Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value.

Author:
  • Created by ijdoc2js

ImagePlus

new ImagePlus(pathOrURL)

Constructs an ImagePlus from a TIFF, BMP, DICOM, FITS, PGM, GIF or JPRG specified by a path or from a TIFF, DICOM, GIF or JPEG specified by a URL.

Parameters:
Name Type Description
pathOrURL java.lang.String

-

Author:
  • Created by ijdoc2js

Members

(static, constant) changes :boolean

True if any changes have been made to this image.

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) COLOR_256 :int

8-bit indexed color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COLOR_RGB :int

32-bit RGB color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY8 :int

8-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY16 :int

16-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY32 :int

32-bit floating-point grayscale

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) setIJMenuBar :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) typeSet :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

Methods

addImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a shallow copy of this ImagePlus.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

close()

Closes this image and sets the ImageProcessor to null. To avoid the "Save changes?" dialog, first set the public 'changes' variable to false.

Author:
  • Created by ijdoc2js

convertIndexToPosition(n)

Converts the stack index 'n' (one-based) into a hyperstack position (channel, slice, frame).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

copy()

Copies the contents of the current selection, or the entire image if there is no selection, to the internal clipboard.

Author:
  • Created by ijdoc2js

copy(cut)

Copies the contents of the current selection to the internal clipboard. Copies the entire image if there is no selection. Also clears the selection if cut is true.

Parameters:
Name Type Description
cut boolean

-

Author:
  • Created by ijdoc2js

copyAttributes(imp)

Copies attributes (name, ID, calibration, path) of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

copyScale(imp)

Copies the calibration of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

createEmptyStack()

Returns an empty image stack that has the same width, height and color table as this image.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

createHyperStack(title, channels, slices, frames, bitDepth)

This method has been replaced by IJ.createHyperStack().

Parameters:
Name Type Description
title java.lang.String

-

channels int

-

slices int

-

frames int

-

bitDepth int

-

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createImagePlus()

Returns a new ImagePlus with this image's attributes (e.g. spatial scale), but no image.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createLut()

Creates a LookUpTable object that corresponds to this image.

Author:
  • Created by ijdoc2js
Returns:

LookUpTable

createNewRoi(sx, sy)

Starts the process of creating a new selection, where sx and sy are the starting screen coordinates. The selection type is determined by which tool in the tool bar is active. The user interactively sets the selection size and shape.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js

crop()

Returns a copy this image or stack slice, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

deleteRoi()

Deletes the current region of interest. Makes a copy of the ROI so it can be recovered by Edit/Selection/Restore Selection.

Author:
  • Created by ijdoc2js

draw()

Draws the image. If there is an ROI, its outline is also displayed. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

draw(x, y, width, height)

Draws image and roi outline using a clip rect.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

duplicate()

Returns a copy of this image or stack, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flatten()

Returns a "flattened" version of this image, in RGB format.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flattenStack()

Flattens all slices of this stack or HyperStack.

Author:
  • Created by ijdoc2js

flush()

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

Author:
  • Created by ijdoc2js

getAllStatistics()

This method returns complete calibrated statistics for this image or ROI (with "Limit to threshold"), but it is up to 70 times slower than getStatistics().

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getBitDepth()

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getBufferedImage()

Returns a copy of this image as an 8-bit or RGB BufferedImage.

Author:
  • Created by ijdoc2js
Returns:

java.awt.image.BufferedImage

getBytesPerPixel()

Returns the number of bytes per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getC()

Returns the current hyperstack channel position.

Author:
  • Created by ijdoc2js
Returns:

int

getCalibration()

Returns this image's calibration.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getCanvas()

Returns the ImageCanvas being used to display this image, or null.

Author:
  • Created by ijdoc2js
Returns:

ImageCanvas

getChannel()

Author:
  • Created by ijdoc2js
Returns:

int

getChannelProcessor()

Returns a reference to the current ImageProcessor. The CompositeImage class overrides this method to return the processor associated with the current channel.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getClipboard()

Returns the internal clipboard or null if the internal clipboard is empty.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getCompositeMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a CompositeImage, otherwise returns -1.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentSlice()

Returns the current stack index (one-based) or 1 if this is a single image.

Author:
  • Created by ijdoc2js
Returns:

int

getDefault16bitRange()

Returns the default 16-bit display range, 0 (auto-scaling), 8, 10, 12, 14, 15 or 16.

Author:
  • Created by ijdoc2js
Returns:

int

getDimensions(varify)

Parameters:
Name Type Description
varify boolean

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getDimensions()

Returns the dimensions of this image (width, height, nChannels, nSlices, nFrames) as a 5 element int array.

Author:
  • Created by ijdoc2js
Returns:

int[]

getDisplayMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a composite color image, or 0 if it not.

Author:
  • Created by ijdoc2js
Returns:

int

getDisplayRangeMax()

Author:
  • Created by ijdoc2js
Returns:

double

getDisplayRangeMin()

Author:
  • Created by ijdoc2js
Returns:

double

getFileInfo()

Returns a FileInfo object containing information, including the pixel array, needed to save this image. Use getOriginalFileInfo() to get a copy of the FileInfo object used to open the image.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getFrame()

Author:
  • Created by ijdoc2js
Returns:

int

getGlobalCalibration()

Returns the system-wide calibration, or null.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getHeight()

Author:
  • Created by ijdoc2js
Returns:

int

getHideOverlay()

Author:
  • Created by ijdoc2js
Returns:

boolean

getID()

Returns this image's unique numeric ID.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns this image as a AWT image.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Image

getImageStack()

Returns the base image stack.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getImageStackSize()

If this is a stack, returns the actual number of images in the stack, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getInfoProperty()

Returns the "Info" property string, or null if it is not found.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLocalCalibration()

Returns this image's local calibration, ignoring the "Global" calibration flag.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getLocationAsString(x, y)

Converts the current cursor location to a string.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLuts()

Returns an array containing the lookup tables used by this image, one per channel, or an empty array if this is an RGB image.

Author:
  • Created by ijdoc2js
Returns:

LUT[]

getMask()

For images with irregular ROIs, returns a byte mask, otherwise, returns null. Mask pixels have a non-zero value.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getNChannels()

Returns the number of channels.

Author:
  • Created by ijdoc2js
Returns:

int

getNDimensions()

Returns the number of dimensions (2, 3, 4 or 5).

Author:
  • Created by ijdoc2js
Returns:

int

getNFrames()

Returns the number of frames (time-points).

Author:
  • Created by ijdoc2js
Returns:

int

getNSlices()

Returns the image depth (number of z-slices).

Author:
  • Created by ijdoc2js
Returns:

int

getNumericProperty(key)

Returns the numeric value from the "Info" property string associated with 'key', or NaN if the key is not found or the value associated with the key is not numeric. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

double

getOpenAsHyperStack()

Author:
  • Created by ijdoc2js
Returns:

boolean

getOriginalFileInfo()

Returns the FileInfo object that was used to open this image. Returns null for images created using the File/New command.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getOverlay()

Returns the current overly, or null if this image does not have an overlay.

Author:
  • Created by ijdoc2js
Returns:

Overlay

getPixel(x, y)

Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getProcessor()

Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getProp(key)

Deprecated. 

Parameters:
Name Type Description
key java.lang.String

-

Deprecated:
Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperties()

Returns this image's Properties. May return null.

Author:
  • Created by ijdoc2js
Returns:

java.util.Properties

getProperty(key)

Returns the property associated with 'key', or null if it is not found.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

getRawStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getRoi()

Returns the current selection, or null if there is no selection.

Author:
  • Created by ijdoc2js
Returns:

Roi

getShortTitle()

Returns a shortened version of image name that does not include spaces or a file name extension.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getSlice()

Author:
  • Created by ijdoc2js
Returns:

int

getStack()

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getStackIndex(channel, slice, frame)

Returns that stack index (one-based) corresponding to the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js
Returns:

int

getStackSize()

If this is a stack, returns the number of slices, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getStartTime()

Returns the time in milliseconds when startTiming() was last called.

Author:
  • Created by ijdoc2js
Returns:

long

getStaticGlobalCalibration()

This is a version of getGlobalCalibration() that can be called from a static context.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getStatistics(mOptions, nBins, histMin, histMax)

Returns an ImageStatistics object generated using the specified measurement options, histogram bin count and histogram range. Note: for 8-bit and RGB images, the number of bins is fixed at 256 and the histogram range is always 0-255.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

histMin double

-

histMax double

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions, nBins)

Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. Note: except for float images, the number of bins is currently fixed at 256.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics()

Get calibrated statistics for this image or ROI, including histogram, area, mean, min and max, standard deviation and mode. This code demonstrates how to get the area, mean max and median of the current image or selection:

 imp = IJ.getImage();
stats = imp.getStatistics();
IJ.log("Area: "+stats.area);
IJ.log("Mean: "+stats.mean);
IJ.log("Max: "+stats.max);
Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions)

Returns an ImageStatistics object generated using the specified measurement options.

Parameters:
Name Type Description
mOptions int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStringProperty(key)

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getT()

Returns the current hyperstack frame position.

Author:
  • Created by ijdoc2js
Returns:

int

getTitle()

Returns the image name.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getType()

Returns the current image type (ImagePlus.GRAY8, ImagePlus.GRAY16, ImagePlus.GRAY32, ImagePlus.COLOR_256 or ImagePlus.COLOR_RGB).

Author:
  • Created by ijdoc2js
Returns:

int

getWidth()

Author:
  • Created by ijdoc2js
Returns:

int

getWindow()

Returns the ImageWindow that is being used to display this image. Returns null if show() has not be called or the ImageWindow has been closed.

Author:
  • Created by ijdoc2js
Returns:

ImageWindow

getZ()

Returns the current hyperstack slice position.

Author:
  • Created by ijdoc2js
Returns:

int

hide()

Closes the window, if any, that is displaying this image.

Author:
  • Created by ijdoc2js

imageUpdate(img, flags, x, y, w, h)

Used by ImagePlus to monitor loading of images.

Parameters:
Name Type Description
img java.awt.Image

-

flags int

-

x int

-

y int

-

w int

-

h int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

isComposite()

Returns true if this is a CompositeImage.

Author:
  • Created by ijdoc2js
Returns:

boolean

isDisplayedHyperStack()

Returns 'true' if this is a hyperstack currently being displayed in a StackWindow.

Author:
  • Created by ijdoc2js
Returns:

boolean

isHyperStack()

Returns 'true' if this image is a hyperstack.

Author:
  • Created by ijdoc2js
Returns:

boolean

isInvertedLut()

Returns true is this image uses an inverting LUT that displays zero as white and 255 as black.

Author:
  • Created by ijdoc2js
Returns:

boolean

isLocked()

Returns 'true' if the image is locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

isProcessor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isThreshold()

Returns 'true' if this image is thresholded.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this image is currently being displayed in a window.

Author:
  • Created by ijdoc2js
Returns:

boolean

killRoi()

Deletes the current region of interest.

Author:
  • Created by ijdoc2js

killStack()

Author:
  • Created by ijdoc2js

lock()

Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

lockSilently()

Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails.

Author:
  • Created by ijdoc2js
Returns:

boolean

mouseMoved(x, y)

Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

paste()

Inserts the contents of the internal clipboard into the active image. If there is a selection the same size as the image on the clipboard, the image is inserted into that selection, otherwise the selection is inserted into the center of the image.

Author:
  • Created by ijdoc2js

removeImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

resetClipboard()

Clears the internal clipboard.

Author:
  • Created by ijdoc2js

resetDisplayRange()

Author:
  • Created by ijdoc2js

resetStack()

Author:
  • Created by ijdoc2js

restoreRoi()

Author:
  • Created by ijdoc2js

revert()

Implements the File/Revert command.

Author:
  • Created by ijdoc2js

saveRoi()

Author:
  • Created by ijdoc2js

setActivated()

Called by ImageWindow.windowActivated().

Author:
  • Created by ijdoc2js

setActiveChannels(channels)

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

Parameters:
Name Type Description
channels java.lang.String

-

Author:
  • Created by ijdoc2js

setAntialiasRendering(antialiasRendering)

Enable/disable use of antialiasing by the flatten() method.

Parameters:
Name Type Description
antialiasRendering boolean

-

Author:
  • Created by ijdoc2js

setC(channel)

Sets the hyperstack channel position (one based).

Parameters:
Name Type Description
channel int

-

Author:
  • Created by ijdoc2js

setCalibration(cal)

Sets this image's calibration.

Parameters:
Name Type Description
cal Calibration

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets current foreground color.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setDefault16bitRange(bitDepth)

Set the default 16-bit display range, where 'bitDepth' must be 0 (auto-scaling), 8 (0-255), 10 (0-1023), 12 (0-4095, 14 (0-16383), 15 (0-32767) or 16 (0-65535).

Parameters:
Name Type Description
bitDepth int

-

Author:
  • Created by ijdoc2js

setDimensions(nChannels, nSlices, nFrames)

Sets the 3rd, 4th and 5th dimensions, where nChannelsnSlicesnFrames must be equal to the stack size.

Parameters:
Name Type Description
nChannels int

-

nSlices int

-

nFrames int

-

Author:
  • Created by ijdoc2js

setDisplayMode(mode)

Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE.

Parameters:
Name Type Description
mode int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max, channels)

Sets the display range of specified channels in an RGB image, where 4=red, 2=green, 1=blue, 6=red+green, etc. With non-RGB images, this method is identical to setDisplayRange(min, max). This method is used by the Image/Adjust/Color Balance tool .

Parameters:
Name Type Description
min double

-

max double

-

channels int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max)

Sets the display range of the current channel. With non-composite images it is identical to ip.setMinAndMax(min, max).

Parameters:
Name Type Description
min double

-

max double

-

Author:
  • Created by ijdoc2js

setFileInfo(fi)

Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo().

Parameters:
Name Type Description
fi FileInfo

-

Author:
  • Created by ijdoc2js

setGlobalCalibration(global)

Sets the system-wide calibration.

Parameters:
Name Type Description
global Calibration

-

Author:
  • Created by ijdoc2js

setHideOverlay(hide)

Parameters:
Name Type Description
hide boolean

-

Author:
  • Created by ijdoc2js

setIgnoreFlush(ignoreFlush)

Parameters:
Name Type Description
ignoreFlush boolean

-

Author:
  • Created by ijdoc2js

setIgnoreGlobalCalibration(ignoreGlobalCalibration)

Parameters:
Name Type Description
ignoreGlobalCalibration boolean

-

Author:
  • Created by ijdoc2js

setIJMenuBar()

Author:
  • Created by ijdoc2js
Returns:

boolean

setIJMenuBar(b)

Parameters:
Name Type Description
b boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Replaces this image with the specified ImagePlus. May not work as expected if 'imp' is a CompositeImage and this image is not.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setImage(img)

Replaces the image, if any, with the one specified. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
img java.awt.Image

-

Author:
  • Created by ijdoc2js

setLut(lut)

Assigns a LUT (lookup table) to this image.

Parameters:
Name Type Description
lut LUT

-

Author:
  • Created by ijdoc2js

setOpenAsHyperStack(openAsHyperStack)

Parameters:
Name Type Description
openAsHyperStack boolean

-

Author:
  • Created by ijdoc2js

setOverlay(roi, strokeColor, strokeWidth, fillColor)

Creates an Overlay from the specified ROI, and assigns it to this image.

Parameters:
Name Type Description
roi Roi

-

strokeColor java.awt.Color

-

strokeWidth int

-

fillColor java.awt.Color

-

Author:
  • Created by ijdoc2js

setOverlay(shape, color, stroke)

Creates an Overlay from the specified Shape, Color and BasicStroke, and assigns it to this image.

Parameters:
Name Type Description
shape java.awt.Shape

-

color java.awt.Color

-

stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

setOverlay(overlay)

Installs a list of ROIs that will be drawn on this image as a non-destructive overlay.

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setPosition(n)

Set the current hyperstack position based on the stack index 'n' (one-based).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setPositionWithoutUpdate(channel, slice, frame)

Sets the current hyperstack position without updating the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setProcessor(title, ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as other images in the stack and it must be the same width and height. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProcessor(ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as the other images in the stack and it must be the same width and height.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Adds a key-value pair to this image's properties. The key is removed from the properties table if value is null.

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.Object

-

Author:
  • Created by ijdoc2js

setRoi(newRoi, updateDisplay)

Assigns 'newRoi' to this image and displays it if 'updateDisplay' is true.

Parameters:
Name Type Description
newRoi Roi

-

updateDisplay boolean

-

Author:
  • Created by ijdoc2js

setRoi(newRoi)

Assigns the specified ROI to this image and displays it. Any existing ROI is deleted if roi is null or its width or height is zero.

Parameters:
Name Type Description
newRoi Roi

-

Author:
  • Created by ijdoc2js

setRoi(r)

Creates a rectangular selection.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

setRoi(x, y, width, height)

Creates a rectangular selection.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

setSlice(n)

Displays the specified stack image, where 1<=n<=stackSize. Does nothing if this image is not a stack.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setSliceWithoutUpdate(n)

Displays the specified stack image (1<=n<=stackSize) without updating the display.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setStack(stack)

Replaces the image with the specified stack and updates the display.

Parameters:
Name Type Description
stack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(title, newStack)

Replaces the image with the specified stack and updates the display. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

newStack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(newStack, channels, slices, frames)

Parameters:
Name Type Description
newStack ImageStack

-

channels int

-

slices int

-

frames int

-

Author:
  • Created by ijdoc2js

setT(frame)

Sets the hyperstack frame position (one based).

Parameters:
Name Type Description
frame int

-

Author:
  • Created by ijdoc2js

setTitle(title)

Sets the image name.

Parameters:
Name Type Description
title java.lang.String

-

Author:
  • Created by ijdoc2js

setWindow(win)

This method should only be called from an ImageWindow.

Parameters:
Name Type Description
win ImageWindow

-

Author:
  • Created by ijdoc2js

setZ(slice)

Sets the hyperstack slice position (one based).

Parameters:
Name Type Description
slice int

-

Author:
  • Created by ijdoc2js

show()

Opens a window to display this image and clears the status bar.

Author:
  • Created by ijdoc2js

show(statusMessage)

Opens a window to display this image and displays 'statusMessage' in the status bar.

Parameters:
Name Type Description
statusMessage java.lang.String

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

trimProcessor()

Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null.

Author:
  • Created by ijdoc2js

unlock()

Unlocks the image.

Author:
  • Created by ijdoc2js

updateAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

updateChannelAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel.

Author:
  • Created by ijdoc2js

updateImage()

ImageCanvas.paint() calls this method when the ImageProcessor has generated new image.

Author:
  • Created by ijdoc2js

updatePosition(c, z, t)

Parameters:
Name Type Description
c int

-

z int

-

t int

-

Author:
  • Created by ijdoc2js

updateStatusbarValue()

Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value.

Author:
  • Created by ijdoc2js

ImagePlus

new ImagePlus(title, stack)

Constructs an ImagePlus from a stack.

Parameters:
Name Type Description
title java.lang.String

-

stack ImageStack

-

Author:
  • Created by ijdoc2js

Members

(static, constant) changes :boolean

True if any changes have been made to this image.

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) COLOR_256 :int

8-bit indexed color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COLOR_RGB :int

32-bit RGB color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY8 :int

8-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY16 :int

16-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY32 :int

32-bit floating-point grayscale

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) setIJMenuBar :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) typeSet :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

Methods

addImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a shallow copy of this ImagePlus.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

close()

Closes this image and sets the ImageProcessor to null. To avoid the "Save changes?" dialog, first set the public 'changes' variable to false.

Author:
  • Created by ijdoc2js

convertIndexToPosition(n)

Converts the stack index 'n' (one-based) into a hyperstack position (channel, slice, frame).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

copy()

Copies the contents of the current selection, or the entire image if there is no selection, to the internal clipboard.

Author:
  • Created by ijdoc2js

copy(cut)

Copies the contents of the current selection to the internal clipboard. Copies the entire image if there is no selection. Also clears the selection if cut is true.

Parameters:
Name Type Description
cut boolean

-

Author:
  • Created by ijdoc2js

copyAttributes(imp)

Copies attributes (name, ID, calibration, path) of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

copyScale(imp)

Copies the calibration of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

createEmptyStack()

Returns an empty image stack that has the same width, height and color table as this image.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

createHyperStack(title, channels, slices, frames, bitDepth)

This method has been replaced by IJ.createHyperStack().

Parameters:
Name Type Description
title java.lang.String

-

channels int

-

slices int

-

frames int

-

bitDepth int

-

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createImagePlus()

Returns a new ImagePlus with this image's attributes (e.g. spatial scale), but no image.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createLut()

Creates a LookUpTable object that corresponds to this image.

Author:
  • Created by ijdoc2js
Returns:

LookUpTable

createNewRoi(sx, sy)

Starts the process of creating a new selection, where sx and sy are the starting screen coordinates. The selection type is determined by which tool in the tool bar is active. The user interactively sets the selection size and shape.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js

crop()

Returns a copy this image or stack slice, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

deleteRoi()

Deletes the current region of interest. Makes a copy of the ROI so it can be recovered by Edit/Selection/Restore Selection.

Author:
  • Created by ijdoc2js

draw()

Draws the image. If there is an ROI, its outline is also displayed. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

draw(x, y, width, height)

Draws image and roi outline using a clip rect.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

duplicate()

Returns a copy of this image or stack, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flatten()

Returns a "flattened" version of this image, in RGB format.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flattenStack()

Flattens all slices of this stack or HyperStack.

Author:
  • Created by ijdoc2js

flush()

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

Author:
  • Created by ijdoc2js

getAllStatistics()

This method returns complete calibrated statistics for this image or ROI (with "Limit to threshold"), but it is up to 70 times slower than getStatistics().

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getBitDepth()

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getBufferedImage()

Returns a copy of this image as an 8-bit or RGB BufferedImage.

Author:
  • Created by ijdoc2js
Returns:

java.awt.image.BufferedImage

getBytesPerPixel()

Returns the number of bytes per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getC()

Returns the current hyperstack channel position.

Author:
  • Created by ijdoc2js
Returns:

int

getCalibration()

Returns this image's calibration.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getCanvas()

Returns the ImageCanvas being used to display this image, or null.

Author:
  • Created by ijdoc2js
Returns:

ImageCanvas

getChannel()

Author:
  • Created by ijdoc2js
Returns:

int

getChannelProcessor()

Returns a reference to the current ImageProcessor. The CompositeImage class overrides this method to return the processor associated with the current channel.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getClipboard()

Returns the internal clipboard or null if the internal clipboard is empty.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getCompositeMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a CompositeImage, otherwise returns -1.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentSlice()

Returns the current stack index (one-based) or 1 if this is a single image.

Author:
  • Created by ijdoc2js
Returns:

int

getDefault16bitRange()

Returns the default 16-bit display range, 0 (auto-scaling), 8, 10, 12, 14, 15 or 16.

Author:
  • Created by ijdoc2js
Returns:

int

getDimensions(varify)

Parameters:
Name Type Description
varify boolean

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getDimensions()

Returns the dimensions of this image (width, height, nChannels, nSlices, nFrames) as a 5 element int array.

Author:
  • Created by ijdoc2js
Returns:

int[]

getDisplayMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a composite color image, or 0 if it not.

Author:
  • Created by ijdoc2js
Returns:

int

getDisplayRangeMax()

Author:
  • Created by ijdoc2js
Returns:

double

getDisplayRangeMin()

Author:
  • Created by ijdoc2js
Returns:

double

getFileInfo()

Returns a FileInfo object containing information, including the pixel array, needed to save this image. Use getOriginalFileInfo() to get a copy of the FileInfo object used to open the image.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getFrame()

Author:
  • Created by ijdoc2js
Returns:

int

getGlobalCalibration()

Returns the system-wide calibration, or null.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getHeight()

Author:
  • Created by ijdoc2js
Returns:

int

getHideOverlay()

Author:
  • Created by ijdoc2js
Returns:

boolean

getID()

Returns this image's unique numeric ID.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns this image as a AWT image.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Image

getImageStack()

Returns the base image stack.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getImageStackSize()

If this is a stack, returns the actual number of images in the stack, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getInfoProperty()

Returns the "Info" property string, or null if it is not found.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLocalCalibration()

Returns this image's local calibration, ignoring the "Global" calibration flag.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getLocationAsString(x, y)

Converts the current cursor location to a string.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLuts()

Returns an array containing the lookup tables used by this image, one per channel, or an empty array if this is an RGB image.

Author:
  • Created by ijdoc2js
Returns:

LUT[]

getMask()

For images with irregular ROIs, returns a byte mask, otherwise, returns null. Mask pixels have a non-zero value.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getNChannels()

Returns the number of channels.

Author:
  • Created by ijdoc2js
Returns:

int

getNDimensions()

Returns the number of dimensions (2, 3, 4 or 5).

Author:
  • Created by ijdoc2js
Returns:

int

getNFrames()

Returns the number of frames (time-points).

Author:
  • Created by ijdoc2js
Returns:

int

getNSlices()

Returns the image depth (number of z-slices).

Author:
  • Created by ijdoc2js
Returns:

int

getNumericProperty(key)

Returns the numeric value from the "Info" property string associated with 'key', or NaN if the key is not found or the value associated with the key is not numeric. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

double

getOpenAsHyperStack()

Author:
  • Created by ijdoc2js
Returns:

boolean

getOriginalFileInfo()

Returns the FileInfo object that was used to open this image. Returns null for images created using the File/New command.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getOverlay()

Returns the current overly, or null if this image does not have an overlay.

Author:
  • Created by ijdoc2js
Returns:

Overlay

getPixel(x, y)

Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getProcessor()

Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getProp(key)

Deprecated. 

Parameters:
Name Type Description
key java.lang.String

-

Deprecated:
Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperties()

Returns this image's Properties. May return null.

Author:
  • Created by ijdoc2js
Returns:

java.util.Properties

getProperty(key)

Returns the property associated with 'key', or null if it is not found.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

getRawStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getRoi()

Returns the current selection, or null if there is no selection.

Author:
  • Created by ijdoc2js
Returns:

Roi

getShortTitle()

Returns a shortened version of image name that does not include spaces or a file name extension.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getSlice()

Author:
  • Created by ijdoc2js
Returns:

int

getStack()

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getStackIndex(channel, slice, frame)

Returns that stack index (one-based) corresponding to the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js
Returns:

int

getStackSize()

If this is a stack, returns the number of slices, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getStartTime()

Returns the time in milliseconds when startTiming() was last called.

Author:
  • Created by ijdoc2js
Returns:

long

getStaticGlobalCalibration()

This is a version of getGlobalCalibration() that can be called from a static context.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getStatistics(mOptions, nBins, histMin, histMax)

Returns an ImageStatistics object generated using the specified measurement options, histogram bin count and histogram range. Note: for 8-bit and RGB images, the number of bins is fixed at 256 and the histogram range is always 0-255.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

histMin double

-

histMax double

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions, nBins)

Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. Note: except for float images, the number of bins is currently fixed at 256.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics()

Get calibrated statistics for this image or ROI, including histogram, area, mean, min and max, standard deviation and mode. This code demonstrates how to get the area, mean max and median of the current image or selection:

 imp = IJ.getImage();
stats = imp.getStatistics();
IJ.log("Area: "+stats.area);
IJ.log("Mean: "+stats.mean);
IJ.log("Max: "+stats.max);
Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions)

Returns an ImageStatistics object generated using the specified measurement options.

Parameters:
Name Type Description
mOptions int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStringProperty(key)

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getT()

Returns the current hyperstack frame position.

Author:
  • Created by ijdoc2js
Returns:

int

getTitle()

Returns the image name.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getType()

Returns the current image type (ImagePlus.GRAY8, ImagePlus.GRAY16, ImagePlus.GRAY32, ImagePlus.COLOR_256 or ImagePlus.COLOR_RGB).

Author:
  • Created by ijdoc2js
Returns:

int

getWidth()

Author:
  • Created by ijdoc2js
Returns:

int

getWindow()

Returns the ImageWindow that is being used to display this image. Returns null if show() has not be called or the ImageWindow has been closed.

Author:
  • Created by ijdoc2js
Returns:

ImageWindow

getZ()

Returns the current hyperstack slice position.

Author:
  • Created by ijdoc2js
Returns:

int

hide()

Closes the window, if any, that is displaying this image.

Author:
  • Created by ijdoc2js

imageUpdate(img, flags, x, y, w, h)

Used by ImagePlus to monitor loading of images.

Parameters:
Name Type Description
img java.awt.Image

-

flags int

-

x int

-

y int

-

w int

-

h int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

isComposite()

Returns true if this is a CompositeImage.

Author:
  • Created by ijdoc2js
Returns:

boolean

isDisplayedHyperStack()

Returns 'true' if this is a hyperstack currently being displayed in a StackWindow.

Author:
  • Created by ijdoc2js
Returns:

boolean

isHyperStack()

Returns 'true' if this image is a hyperstack.

Author:
  • Created by ijdoc2js
Returns:

boolean

isInvertedLut()

Returns true is this image uses an inverting LUT that displays zero as white and 255 as black.

Author:
  • Created by ijdoc2js
Returns:

boolean

isLocked()

Returns 'true' if the image is locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

isProcessor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isThreshold()

Returns 'true' if this image is thresholded.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this image is currently being displayed in a window.

Author:
  • Created by ijdoc2js
Returns:

boolean

killRoi()

Deletes the current region of interest.

Author:
  • Created by ijdoc2js

killStack()

Author:
  • Created by ijdoc2js

lock()

Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

lockSilently()

Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails.

Author:
  • Created by ijdoc2js
Returns:

boolean

mouseMoved(x, y)

Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

paste()

Inserts the contents of the internal clipboard into the active image. If there is a selection the same size as the image on the clipboard, the image is inserted into that selection, otherwise the selection is inserted into the center of the image.

Author:
  • Created by ijdoc2js

removeImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

resetClipboard()

Clears the internal clipboard.

Author:
  • Created by ijdoc2js

resetDisplayRange()

Author:
  • Created by ijdoc2js

resetStack()

Author:
  • Created by ijdoc2js

restoreRoi()

Author:
  • Created by ijdoc2js

revert()

Implements the File/Revert command.

Author:
  • Created by ijdoc2js

saveRoi()

Author:
  • Created by ijdoc2js

setActivated()

Called by ImageWindow.windowActivated().

Author:
  • Created by ijdoc2js

setActiveChannels(channels)

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

Parameters:
Name Type Description
channels java.lang.String

-

Author:
  • Created by ijdoc2js

setAntialiasRendering(antialiasRendering)

Enable/disable use of antialiasing by the flatten() method.

Parameters:
Name Type Description
antialiasRendering boolean

-

Author:
  • Created by ijdoc2js

setC(channel)

Sets the hyperstack channel position (one based).

Parameters:
Name Type Description
channel int

-

Author:
  • Created by ijdoc2js

setCalibration(cal)

Sets this image's calibration.

Parameters:
Name Type Description
cal Calibration

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets current foreground color.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setDefault16bitRange(bitDepth)

Set the default 16-bit display range, where 'bitDepth' must be 0 (auto-scaling), 8 (0-255), 10 (0-1023), 12 (0-4095, 14 (0-16383), 15 (0-32767) or 16 (0-65535).

Parameters:
Name Type Description
bitDepth int

-

Author:
  • Created by ijdoc2js

setDimensions(nChannels, nSlices, nFrames)

Sets the 3rd, 4th and 5th dimensions, where nChannelsnSlicesnFrames must be equal to the stack size.

Parameters:
Name Type Description
nChannels int

-

nSlices int

-

nFrames int

-

Author:
  • Created by ijdoc2js

setDisplayMode(mode)

Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE.

Parameters:
Name Type Description
mode int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max, channels)

Sets the display range of specified channels in an RGB image, where 4=red, 2=green, 1=blue, 6=red+green, etc. With non-RGB images, this method is identical to setDisplayRange(min, max). This method is used by the Image/Adjust/Color Balance tool .

Parameters:
Name Type Description
min double

-

max double

-

channels int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max)

Sets the display range of the current channel. With non-composite images it is identical to ip.setMinAndMax(min, max).

Parameters:
Name Type Description
min double

-

max double

-

Author:
  • Created by ijdoc2js

setFileInfo(fi)

Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo().

Parameters:
Name Type Description
fi FileInfo

-

Author:
  • Created by ijdoc2js

setGlobalCalibration(global)

Sets the system-wide calibration.

Parameters:
Name Type Description
global Calibration

-

Author:
  • Created by ijdoc2js

setHideOverlay(hide)

Parameters:
Name Type Description
hide boolean

-

Author:
  • Created by ijdoc2js

setIgnoreFlush(ignoreFlush)

Parameters:
Name Type Description
ignoreFlush boolean

-

Author:
  • Created by ijdoc2js

setIgnoreGlobalCalibration(ignoreGlobalCalibration)

Parameters:
Name Type Description
ignoreGlobalCalibration boolean

-

Author:
  • Created by ijdoc2js

setIJMenuBar()

Author:
  • Created by ijdoc2js
Returns:

boolean

setIJMenuBar(b)

Parameters:
Name Type Description
b boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Replaces this image with the specified ImagePlus. May not work as expected if 'imp' is a CompositeImage and this image is not.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setImage(img)

Replaces the image, if any, with the one specified. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
img java.awt.Image

-

Author:
  • Created by ijdoc2js

setLut(lut)

Assigns a LUT (lookup table) to this image.

Parameters:
Name Type Description
lut LUT

-

Author:
  • Created by ijdoc2js

setOpenAsHyperStack(openAsHyperStack)

Parameters:
Name Type Description
openAsHyperStack boolean

-

Author:
  • Created by ijdoc2js

setOverlay(roi, strokeColor, strokeWidth, fillColor)

Creates an Overlay from the specified ROI, and assigns it to this image.

Parameters:
Name Type Description
roi Roi

-

strokeColor java.awt.Color

-

strokeWidth int

-

fillColor java.awt.Color

-

Author:
  • Created by ijdoc2js

setOverlay(shape, color, stroke)

Creates an Overlay from the specified Shape, Color and BasicStroke, and assigns it to this image.

Parameters:
Name Type Description
shape java.awt.Shape

-

color java.awt.Color

-

stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

setOverlay(overlay)

Installs a list of ROIs that will be drawn on this image as a non-destructive overlay.

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setPosition(n)

Set the current hyperstack position based on the stack index 'n' (one-based).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setPositionWithoutUpdate(channel, slice, frame)

Sets the current hyperstack position without updating the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setProcessor(title, ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as other images in the stack and it must be the same width and height. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProcessor(ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as the other images in the stack and it must be the same width and height.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Adds a key-value pair to this image's properties. The key is removed from the properties table if value is null.

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.Object

-

Author:
  • Created by ijdoc2js

setRoi(newRoi, updateDisplay)

Assigns 'newRoi' to this image and displays it if 'updateDisplay' is true.

Parameters:
Name Type Description
newRoi Roi

-

updateDisplay boolean

-

Author:
  • Created by ijdoc2js

setRoi(newRoi)

Assigns the specified ROI to this image and displays it. Any existing ROI is deleted if roi is null or its width or height is zero.

Parameters:
Name Type Description
newRoi Roi

-

Author:
  • Created by ijdoc2js

setRoi(r)

Creates a rectangular selection.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

setRoi(x, y, width, height)

Creates a rectangular selection.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

setSlice(n)

Displays the specified stack image, where 1<=n<=stackSize. Does nothing if this image is not a stack.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setSliceWithoutUpdate(n)

Displays the specified stack image (1<=n<=stackSize) without updating the display.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setStack(stack)

Replaces the image with the specified stack and updates the display.

Parameters:
Name Type Description
stack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(title, newStack)

Replaces the image with the specified stack and updates the display. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

newStack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(newStack, channels, slices, frames)

Parameters:
Name Type Description
newStack ImageStack

-

channels int

-

slices int

-

frames int

-

Author:
  • Created by ijdoc2js

setT(frame)

Sets the hyperstack frame position (one based).

Parameters:
Name Type Description
frame int

-

Author:
  • Created by ijdoc2js

setTitle(title)

Sets the image name.

Parameters:
Name Type Description
title java.lang.String

-

Author:
  • Created by ijdoc2js

setWindow(win)

This method should only be called from an ImageWindow.

Parameters:
Name Type Description
win ImageWindow

-

Author:
  • Created by ijdoc2js

setZ(slice)

Sets the hyperstack slice position (one based).

Parameters:
Name Type Description
slice int

-

Author:
  • Created by ijdoc2js

show()

Opens a window to display this image and clears the status bar.

Author:
  • Created by ijdoc2js

show(statusMessage)

Opens a window to display this image and displays 'statusMessage' in the status bar.

Parameters:
Name Type Description
statusMessage java.lang.String

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

trimProcessor()

Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null.

Author:
  • Created by ijdoc2js

unlock()

Unlocks the image.

Author:
  • Created by ijdoc2js

updateAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

updateChannelAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel.

Author:
  • Created by ijdoc2js

updateImage()

ImageCanvas.paint() calls this method when the ImageProcessor has generated new image.

Author:
  • Created by ijdoc2js

updatePosition(c, z, t)

Parameters:
Name Type Description
c int

-

z int

-

t int

-

Author:
  • Created by ijdoc2js

updateStatusbarValue()

Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value.

Author:
  • Created by ijdoc2js

ImagePlus

new ImagePlus(title, ip)

Constructs an ImagePlus from an ImageProcessor.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

Members

(static, constant) changes :boolean

True if any changes have been made to this image.

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) COLOR_256 :int

8-bit indexed color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COLOR_RGB :int

32-bit RGB color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY8 :int

8-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY16 :int

16-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY32 :int

32-bit floating-point grayscale

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) setIJMenuBar :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) typeSet :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

Methods

addImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a shallow copy of this ImagePlus.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

close()

Closes this image and sets the ImageProcessor to null. To avoid the "Save changes?" dialog, first set the public 'changes' variable to false.

Author:
  • Created by ijdoc2js

convertIndexToPosition(n)

Converts the stack index 'n' (one-based) into a hyperstack position (channel, slice, frame).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

copy()

Copies the contents of the current selection, or the entire image if there is no selection, to the internal clipboard.

Author:
  • Created by ijdoc2js

copy(cut)

Copies the contents of the current selection to the internal clipboard. Copies the entire image if there is no selection. Also clears the selection if cut is true.

Parameters:
Name Type Description
cut boolean

-

Author:
  • Created by ijdoc2js

copyAttributes(imp)

Copies attributes (name, ID, calibration, path) of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

copyScale(imp)

Copies the calibration of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

createEmptyStack()

Returns an empty image stack that has the same width, height and color table as this image.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

createHyperStack(title, channels, slices, frames, bitDepth)

This method has been replaced by IJ.createHyperStack().

Parameters:
Name Type Description
title java.lang.String

-

channels int

-

slices int

-

frames int

-

bitDepth int

-

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createImagePlus()

Returns a new ImagePlus with this image's attributes (e.g. spatial scale), but no image.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createLut()

Creates a LookUpTable object that corresponds to this image.

Author:
  • Created by ijdoc2js
Returns:

LookUpTable

createNewRoi(sx, sy)

Starts the process of creating a new selection, where sx and sy are the starting screen coordinates. The selection type is determined by which tool in the tool bar is active. The user interactively sets the selection size and shape.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js

crop()

Returns a copy this image or stack slice, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

deleteRoi()

Deletes the current region of interest. Makes a copy of the ROI so it can be recovered by Edit/Selection/Restore Selection.

Author:
  • Created by ijdoc2js

draw()

Draws the image. If there is an ROI, its outline is also displayed. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

draw(x, y, width, height)

Draws image and roi outline using a clip rect.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

duplicate()

Returns a copy of this image or stack, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flatten()

Returns a "flattened" version of this image, in RGB format.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flattenStack()

Flattens all slices of this stack or HyperStack.

Author:
  • Created by ijdoc2js

flush()

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

Author:
  • Created by ijdoc2js

getAllStatistics()

This method returns complete calibrated statistics for this image or ROI (with "Limit to threshold"), but it is up to 70 times slower than getStatistics().

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getBitDepth()

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getBufferedImage()

Returns a copy of this image as an 8-bit or RGB BufferedImage.

Author:
  • Created by ijdoc2js
Returns:

java.awt.image.BufferedImage

getBytesPerPixel()

Returns the number of bytes per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getC()

Returns the current hyperstack channel position.

Author:
  • Created by ijdoc2js
Returns:

int

getCalibration()

Returns this image's calibration.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getCanvas()

Returns the ImageCanvas being used to display this image, or null.

Author:
  • Created by ijdoc2js
Returns:

ImageCanvas

getChannel()

Author:
  • Created by ijdoc2js
Returns:

int

getChannelProcessor()

Returns a reference to the current ImageProcessor. The CompositeImage class overrides this method to return the processor associated with the current channel.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getClipboard()

Returns the internal clipboard or null if the internal clipboard is empty.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getCompositeMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a CompositeImage, otherwise returns -1.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentSlice()

Returns the current stack index (one-based) or 1 if this is a single image.

Author:
  • Created by ijdoc2js
Returns:

int

getDefault16bitRange()

Returns the default 16-bit display range, 0 (auto-scaling), 8, 10, 12, 14, 15 or 16.

Author:
  • Created by ijdoc2js
Returns:

int

getDimensions(varify)

Parameters:
Name Type Description
varify boolean

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getDimensions()

Returns the dimensions of this image (width, height, nChannels, nSlices, nFrames) as a 5 element int array.

Author:
  • Created by ijdoc2js
Returns:

int[]

getDisplayMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a composite color image, or 0 if it not.

Author:
  • Created by ijdoc2js
Returns:

int

getDisplayRangeMax()

Author:
  • Created by ijdoc2js
Returns:

double

getDisplayRangeMin()

Author:
  • Created by ijdoc2js
Returns:

double

getFileInfo()

Returns a FileInfo object containing information, including the pixel array, needed to save this image. Use getOriginalFileInfo() to get a copy of the FileInfo object used to open the image.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getFrame()

Author:
  • Created by ijdoc2js
Returns:

int

getGlobalCalibration()

Returns the system-wide calibration, or null.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getHeight()

Author:
  • Created by ijdoc2js
Returns:

int

getHideOverlay()

Author:
  • Created by ijdoc2js
Returns:

boolean

getID()

Returns this image's unique numeric ID.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns this image as a AWT image.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Image

getImageStack()

Returns the base image stack.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getImageStackSize()

If this is a stack, returns the actual number of images in the stack, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getInfoProperty()

Returns the "Info" property string, or null if it is not found.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLocalCalibration()

Returns this image's local calibration, ignoring the "Global" calibration flag.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getLocationAsString(x, y)

Converts the current cursor location to a string.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLuts()

Returns an array containing the lookup tables used by this image, one per channel, or an empty array if this is an RGB image.

Author:
  • Created by ijdoc2js
Returns:

LUT[]

getMask()

For images with irregular ROIs, returns a byte mask, otherwise, returns null. Mask pixels have a non-zero value.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getNChannels()

Returns the number of channels.

Author:
  • Created by ijdoc2js
Returns:

int

getNDimensions()

Returns the number of dimensions (2, 3, 4 or 5).

Author:
  • Created by ijdoc2js
Returns:

int

getNFrames()

Returns the number of frames (time-points).

Author:
  • Created by ijdoc2js
Returns:

int

getNSlices()

Returns the image depth (number of z-slices).

Author:
  • Created by ijdoc2js
Returns:

int

getNumericProperty(key)

Returns the numeric value from the "Info" property string associated with 'key', or NaN if the key is not found or the value associated with the key is not numeric. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

double

getOpenAsHyperStack()

Author:
  • Created by ijdoc2js
Returns:

boolean

getOriginalFileInfo()

Returns the FileInfo object that was used to open this image. Returns null for images created using the File/New command.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getOverlay()

Returns the current overly, or null if this image does not have an overlay.

Author:
  • Created by ijdoc2js
Returns:

Overlay

getPixel(x, y)

Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getProcessor()

Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getProp(key)

Deprecated. 

Parameters:
Name Type Description
key java.lang.String

-

Deprecated:
Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperties()

Returns this image's Properties. May return null.

Author:
  • Created by ijdoc2js
Returns:

java.util.Properties

getProperty(key)

Returns the property associated with 'key', or null if it is not found.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

getRawStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getRoi()

Returns the current selection, or null if there is no selection.

Author:
  • Created by ijdoc2js
Returns:

Roi

getShortTitle()

Returns a shortened version of image name that does not include spaces or a file name extension.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getSlice()

Author:
  • Created by ijdoc2js
Returns:

int

getStack()

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getStackIndex(channel, slice, frame)

Returns that stack index (one-based) corresponding to the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js
Returns:

int

getStackSize()

If this is a stack, returns the number of slices, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getStartTime()

Returns the time in milliseconds when startTiming() was last called.

Author:
  • Created by ijdoc2js
Returns:

long

getStaticGlobalCalibration()

This is a version of getGlobalCalibration() that can be called from a static context.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getStatistics(mOptions, nBins, histMin, histMax)

Returns an ImageStatistics object generated using the specified measurement options, histogram bin count and histogram range. Note: for 8-bit and RGB images, the number of bins is fixed at 256 and the histogram range is always 0-255.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

histMin double

-

histMax double

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions, nBins)

Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. Note: except for float images, the number of bins is currently fixed at 256.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics()

Get calibrated statistics for this image or ROI, including histogram, area, mean, min and max, standard deviation and mode. This code demonstrates how to get the area, mean max and median of the current image or selection:

 imp = IJ.getImage();
stats = imp.getStatistics();
IJ.log("Area: "+stats.area);
IJ.log("Mean: "+stats.mean);
IJ.log("Max: "+stats.max);
Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions)

Returns an ImageStatistics object generated using the specified measurement options.

Parameters:
Name Type Description
mOptions int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStringProperty(key)

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getT()

Returns the current hyperstack frame position.

Author:
  • Created by ijdoc2js
Returns:

int

getTitle()

Returns the image name.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getType()

Returns the current image type (ImagePlus.GRAY8, ImagePlus.GRAY16, ImagePlus.GRAY32, ImagePlus.COLOR_256 or ImagePlus.COLOR_RGB).

Author:
  • Created by ijdoc2js
Returns:

int

getWidth()

Author:
  • Created by ijdoc2js
Returns:

int

getWindow()

Returns the ImageWindow that is being used to display this image. Returns null if show() has not be called or the ImageWindow has been closed.

Author:
  • Created by ijdoc2js
Returns:

ImageWindow

getZ()

Returns the current hyperstack slice position.

Author:
  • Created by ijdoc2js
Returns:

int

hide()

Closes the window, if any, that is displaying this image.

Author:
  • Created by ijdoc2js

imageUpdate(img, flags, x, y, w, h)

Used by ImagePlus to monitor loading of images.

Parameters:
Name Type Description
img java.awt.Image

-

flags int

-

x int

-

y int

-

w int

-

h int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

isComposite()

Returns true if this is a CompositeImage.

Author:
  • Created by ijdoc2js
Returns:

boolean

isDisplayedHyperStack()

Returns 'true' if this is a hyperstack currently being displayed in a StackWindow.

Author:
  • Created by ijdoc2js
Returns:

boolean

isHyperStack()

Returns 'true' if this image is a hyperstack.

Author:
  • Created by ijdoc2js
Returns:

boolean

isInvertedLut()

Returns true is this image uses an inverting LUT that displays zero as white and 255 as black.

Author:
  • Created by ijdoc2js
Returns:

boolean

isLocked()

Returns 'true' if the image is locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

isProcessor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isThreshold()

Returns 'true' if this image is thresholded.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this image is currently being displayed in a window.

Author:
  • Created by ijdoc2js
Returns:

boolean

killRoi()

Deletes the current region of interest.

Author:
  • Created by ijdoc2js

killStack()

Author:
  • Created by ijdoc2js

lock()

Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

lockSilently()

Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails.

Author:
  • Created by ijdoc2js
Returns:

boolean

mouseMoved(x, y)

Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

paste()

Inserts the contents of the internal clipboard into the active image. If there is a selection the same size as the image on the clipboard, the image is inserted into that selection, otherwise the selection is inserted into the center of the image.

Author:
  • Created by ijdoc2js

removeImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

resetClipboard()

Clears the internal clipboard.

Author:
  • Created by ijdoc2js

resetDisplayRange()

Author:
  • Created by ijdoc2js

resetStack()

Author:
  • Created by ijdoc2js

restoreRoi()

Author:
  • Created by ijdoc2js

revert()

Implements the File/Revert command.

Author:
  • Created by ijdoc2js

saveRoi()

Author:
  • Created by ijdoc2js

setActivated()

Called by ImageWindow.windowActivated().

Author:
  • Created by ijdoc2js

setActiveChannels(channels)

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

Parameters:
Name Type Description
channels java.lang.String

-

Author:
  • Created by ijdoc2js

setAntialiasRendering(antialiasRendering)

Enable/disable use of antialiasing by the flatten() method.

Parameters:
Name Type Description
antialiasRendering boolean

-

Author:
  • Created by ijdoc2js

setC(channel)

Sets the hyperstack channel position (one based).

Parameters:
Name Type Description
channel int

-

Author:
  • Created by ijdoc2js

setCalibration(cal)

Sets this image's calibration.

Parameters:
Name Type Description
cal Calibration

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets current foreground color.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setDefault16bitRange(bitDepth)

Set the default 16-bit display range, where 'bitDepth' must be 0 (auto-scaling), 8 (0-255), 10 (0-1023), 12 (0-4095, 14 (0-16383), 15 (0-32767) or 16 (0-65535).

Parameters:
Name Type Description
bitDepth int

-

Author:
  • Created by ijdoc2js

setDimensions(nChannels, nSlices, nFrames)

Sets the 3rd, 4th and 5th dimensions, where nChannelsnSlicesnFrames must be equal to the stack size.

Parameters:
Name Type Description
nChannels int

-

nSlices int

-

nFrames int

-

Author:
  • Created by ijdoc2js

setDisplayMode(mode)

Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE.

Parameters:
Name Type Description
mode int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max, channels)

Sets the display range of specified channels in an RGB image, where 4=red, 2=green, 1=blue, 6=red+green, etc. With non-RGB images, this method is identical to setDisplayRange(min, max). This method is used by the Image/Adjust/Color Balance tool .

Parameters:
Name Type Description
min double

-

max double

-

channels int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max)

Sets the display range of the current channel. With non-composite images it is identical to ip.setMinAndMax(min, max).

Parameters:
Name Type Description
min double

-

max double

-

Author:
  • Created by ijdoc2js

setFileInfo(fi)

Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo().

Parameters:
Name Type Description
fi FileInfo

-

Author:
  • Created by ijdoc2js

setGlobalCalibration(global)

Sets the system-wide calibration.

Parameters:
Name Type Description
global Calibration

-

Author:
  • Created by ijdoc2js

setHideOverlay(hide)

Parameters:
Name Type Description
hide boolean

-

Author:
  • Created by ijdoc2js

setIgnoreFlush(ignoreFlush)

Parameters:
Name Type Description
ignoreFlush boolean

-

Author:
  • Created by ijdoc2js

setIgnoreGlobalCalibration(ignoreGlobalCalibration)

Parameters:
Name Type Description
ignoreGlobalCalibration boolean

-

Author:
  • Created by ijdoc2js

setIJMenuBar()

Author:
  • Created by ijdoc2js
Returns:

boolean

setIJMenuBar(b)

Parameters:
Name Type Description
b boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Replaces this image with the specified ImagePlus. May not work as expected if 'imp' is a CompositeImage and this image is not.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setImage(img)

Replaces the image, if any, with the one specified. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
img java.awt.Image

-

Author:
  • Created by ijdoc2js

setLut(lut)

Assigns a LUT (lookup table) to this image.

Parameters:
Name Type Description
lut LUT

-

Author:
  • Created by ijdoc2js

setOpenAsHyperStack(openAsHyperStack)

Parameters:
Name Type Description
openAsHyperStack boolean

-

Author:
  • Created by ijdoc2js

setOverlay(roi, strokeColor, strokeWidth, fillColor)

Creates an Overlay from the specified ROI, and assigns it to this image.

Parameters:
Name Type Description
roi Roi

-

strokeColor java.awt.Color

-

strokeWidth int

-

fillColor java.awt.Color

-

Author:
  • Created by ijdoc2js

setOverlay(shape, color, stroke)

Creates an Overlay from the specified Shape, Color and BasicStroke, and assigns it to this image.

Parameters:
Name Type Description
shape java.awt.Shape

-

color java.awt.Color

-

stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

setOverlay(overlay)

Installs a list of ROIs that will be drawn on this image as a non-destructive overlay.

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setPosition(n)

Set the current hyperstack position based on the stack index 'n' (one-based).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setPositionWithoutUpdate(channel, slice, frame)

Sets the current hyperstack position without updating the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setProcessor(title, ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as other images in the stack and it must be the same width and height. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProcessor(ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as the other images in the stack and it must be the same width and height.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Adds a key-value pair to this image's properties. The key is removed from the properties table if value is null.

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.Object

-

Author:
  • Created by ijdoc2js

setRoi(newRoi, updateDisplay)

Assigns 'newRoi' to this image and displays it if 'updateDisplay' is true.

Parameters:
Name Type Description
newRoi Roi

-

updateDisplay boolean

-

Author:
  • Created by ijdoc2js

setRoi(newRoi)

Assigns the specified ROI to this image and displays it. Any existing ROI is deleted if roi is null or its width or height is zero.

Parameters:
Name Type Description
newRoi Roi

-

Author:
  • Created by ijdoc2js

setRoi(r)

Creates a rectangular selection.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

setRoi(x, y, width, height)

Creates a rectangular selection.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

setSlice(n)

Displays the specified stack image, where 1<=n<=stackSize. Does nothing if this image is not a stack.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setSliceWithoutUpdate(n)

Displays the specified stack image (1<=n<=stackSize) without updating the display.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setStack(stack)

Replaces the image with the specified stack and updates the display.

Parameters:
Name Type Description
stack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(title, newStack)

Replaces the image with the specified stack and updates the display. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

newStack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(newStack, channels, slices, frames)

Parameters:
Name Type Description
newStack ImageStack

-

channels int

-

slices int

-

frames int

-

Author:
  • Created by ijdoc2js

setT(frame)

Sets the hyperstack frame position (one based).

Parameters:
Name Type Description
frame int

-

Author:
  • Created by ijdoc2js

setTitle(title)

Sets the image name.

Parameters:
Name Type Description
title java.lang.String

-

Author:
  • Created by ijdoc2js

setWindow(win)

This method should only be called from an ImageWindow.

Parameters:
Name Type Description
win ImageWindow

-

Author:
  • Created by ijdoc2js

setZ(slice)

Sets the hyperstack slice position (one based).

Parameters:
Name Type Description
slice int

-

Author:
  • Created by ijdoc2js

show()

Opens a window to display this image and clears the status bar.

Author:
  • Created by ijdoc2js

show(statusMessage)

Opens a window to display this image and displays 'statusMessage' in the status bar.

Parameters:
Name Type Description
statusMessage java.lang.String

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

trimProcessor()

Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null.

Author:
  • Created by ijdoc2js

unlock()

Unlocks the image.

Author:
  • Created by ijdoc2js

updateAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

updateChannelAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel.

Author:
  • Created by ijdoc2js

updateImage()

ImageCanvas.paint() calls this method when the ImageProcessor has generated new image.

Author:
  • Created by ijdoc2js

updatePosition(c, z, t)

Parameters:
Name Type Description
c int

-

z int

-

t int

-

Author:
  • Created by ijdoc2js

updateStatusbarValue()

Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value.

Author:
  • Created by ijdoc2js

ImagePlus

new ImagePlus()

Constructs an uninitialized ImagePlus.

Author:
  • Created by ijdoc2js

Members

(static, constant) changes :boolean

True if any changes have been made to this image.

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) COLOR_256 :int

8-bit indexed color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COLOR_RGB :int

32-bit RGB color

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY8 :int

8-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY16 :int

16-bit grayscale (unsigned)

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) GRAY32 :int

32-bit floating-point grayscale

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) setIJMenuBar :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

(static, constant) typeSet :boolean

Type:
  • boolean
Author:
  • Created by ijdoc2js

Methods

addImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a shallow copy of this ImagePlus.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

close()

Closes this image and sets the ImageProcessor to null. To avoid the "Save changes?" dialog, first set the public 'changes' variable to false.

Author:
  • Created by ijdoc2js

convertIndexToPosition(n)

Converts the stack index 'n' (one-based) into a hyperstack position (channel, slice, frame).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

copy()

Copies the contents of the current selection, or the entire image if there is no selection, to the internal clipboard.

Author:
  • Created by ijdoc2js

copy(cut)

Copies the contents of the current selection to the internal clipboard. Copies the entire image if there is no selection. Also clears the selection if cut is true.

Parameters:
Name Type Description
cut boolean

-

Author:
  • Created by ijdoc2js

copyAttributes(imp)

Copies attributes (name, ID, calibration, path) of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

copyScale(imp)

Copies the calibration of the specified image to this image.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

createEmptyStack()

Returns an empty image stack that has the same width, height and color table as this image.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

createHyperStack(title, channels, slices, frames, bitDepth)

This method has been replaced by IJ.createHyperStack().

Parameters:
Name Type Description
title java.lang.String

-

channels int

-

slices int

-

frames int

-

bitDepth int

-

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createImagePlus()

Returns a new ImagePlus with this image's attributes (e.g. spatial scale), but no image.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

createLut()

Creates a LookUpTable object that corresponds to this image.

Author:
  • Created by ijdoc2js
Returns:

LookUpTable

createNewRoi(sx, sy)

Starts the process of creating a new selection, where sx and sy are the starting screen coordinates. The selection type is determined by which tool in the tool bar is active. The user interactively sets the selection size and shape.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js

crop()

Returns a copy this image or stack slice, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

deleteRoi()

Deletes the current region of interest. Makes a copy of the ROI so it can be recovered by Edit/Selection/Restore Selection.

Author:
  • Created by ijdoc2js

draw()

Draws the image. If there is an ROI, its outline is also displayed. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

draw(x, y, width, height)

Draws image and roi outline using a clip rect.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

duplicate()

Returns a copy of this image or stack, cropped if there is an ROI.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flatten()

Returns a "flattened" version of this image, in RGB format.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

flattenStack()

Flattens all slices of this stack or HyperStack.

Author:
  • Created by ijdoc2js

flush()

Sets the ImageProcessor, Roi, AWT Image and stack image arrays to null. Does nothing if the image is locked.

Author:
  • Created by ijdoc2js

getAllStatistics()

This method returns complete calibrated statistics for this image or ROI (with "Limit to threshold"), but it is up to 70 times slower than getStatistics().

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getBitDepth()

Returns the bit depth, 8, 16, 24 (RGB) or 32, or 0 if the bit depth is unknown. RGB images actually use 32 bits per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getBufferedImage()

Returns a copy of this image as an 8-bit or RGB BufferedImage.

Author:
  • Created by ijdoc2js
Returns:

java.awt.image.BufferedImage

getBytesPerPixel()

Returns the number of bytes per pixel.

Author:
  • Created by ijdoc2js
Returns:

int

getC()

Returns the current hyperstack channel position.

Author:
  • Created by ijdoc2js
Returns:

int

getCalibration()

Returns this image's calibration.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getCanvas()

Returns the ImageCanvas being used to display this image, or null.

Author:
  • Created by ijdoc2js
Returns:

ImageCanvas

getChannel()

Author:
  • Created by ijdoc2js
Returns:

int

getChannelProcessor()

Returns a reference to the current ImageProcessor. The CompositeImage class overrides this method to return the processor associated with the current channel.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getClipboard()

Returns the internal clipboard or null if the internal clipboard is empty.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getCompositeMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a CompositeImage, otherwise returns -1.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentSlice()

Returns the current stack index (one-based) or 1 if this is a single image.

Author:
  • Created by ijdoc2js
Returns:

int

getDefault16bitRange()

Returns the default 16-bit display range, 0 (auto-scaling), 8, 10, 12, 14, 15 or 16.

Author:
  • Created by ijdoc2js
Returns:

int

getDimensions(varify)

Parameters:
Name Type Description
varify boolean

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getDimensions()

Returns the dimensions of this image (width, height, nChannels, nSlices, nFrames) as a 5 element int array.

Author:
  • Created by ijdoc2js
Returns:

int[]

getDisplayMode()

Returns the display mode (IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE) if this is a composite color image, or 0 if it not.

Author:
  • Created by ijdoc2js
Returns:

int

getDisplayRangeMax()

Author:
  • Created by ijdoc2js
Returns:

double

getDisplayRangeMin()

Author:
  • Created by ijdoc2js
Returns:

double

getFileInfo()

Returns a FileInfo object containing information, including the pixel array, needed to save this image. Use getOriginalFileInfo() to get a copy of the FileInfo object used to open the image.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getFrame()

Author:
  • Created by ijdoc2js
Returns:

int

getGlobalCalibration()

Returns the system-wide calibration, or null.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getHeight()

Author:
  • Created by ijdoc2js
Returns:

int

getHideOverlay()

Author:
  • Created by ijdoc2js
Returns:

boolean

getID()

Returns this image's unique numeric ID.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns this image as a AWT image.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Image

getImageStack()

Returns the base image stack.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getImageStackSize()

If this is a stack, returns the actual number of images in the stack, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getInfoProperty()

Returns the "Info" property string, or null if it is not found.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLocalCalibration()

Returns this image's local calibration, ignoring the "Global" calibration flag.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getLocationAsString(x, y)

Converts the current cursor location to a string.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getLuts()

Returns an array containing the lookup tables used by this image, one per channel, or an empty array if this is an RGB image.

Author:
  • Created by ijdoc2js
Returns:

LUT[]

getMask()

For images with irregular ROIs, returns a byte mask, otherwise, returns null. Mask pixels have a non-zero value.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getNChannels()

Returns the number of channels.

Author:
  • Created by ijdoc2js
Returns:

int

getNDimensions()

Returns the number of dimensions (2, 3, 4 or 5).

Author:
  • Created by ijdoc2js
Returns:

int

getNFrames()

Returns the number of frames (time-points).

Author:
  • Created by ijdoc2js
Returns:

int

getNSlices()

Returns the image depth (number of z-slices).

Author:
  • Created by ijdoc2js
Returns:

int

getNumericProperty(key)

Returns the numeric value from the "Info" property string associated with 'key', or NaN if the key is not found or the value associated with the key is not numeric. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

double

getOpenAsHyperStack()

Author:
  • Created by ijdoc2js
Returns:

boolean

getOriginalFileInfo()

Returns the FileInfo object that was used to open this image. Returns null for images created using the File/New command.

Author:
  • Created by ijdoc2js
Returns:

FileInfo

getOverlay()

Returns the current overly, or null if this image does not have an overlay.

Author:
  • Created by ijdoc2js
Returns:

Overlay

getPixel(x, y)

Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

getProcessor()

Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated.

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getProp(key)

Deprecated. 

Parameters:
Name Type Description
key java.lang.String

-

Deprecated:
Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperties()

Returns this image's Properties. May return null.

Author:
  • Created by ijdoc2js
Returns:

java.util.Properties

getProperty(key)

Returns the property associated with 'key', or null if it is not found.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

getRawStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getRoi()

Returns the current selection, or null if there is no selection.

Author:
  • Created by ijdoc2js
Returns:

Roi

getShortTitle()

Returns a shortened version of image name that does not include spaces or a file name extension.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getSlice()

Author:
  • Created by ijdoc2js
Returns:

int

getStack()

Returns the image stack. The stack may have only one slice. After adding or removing slices, call setStack() to update the image and the window that is displaying it.

Author:
  • Created by ijdoc2js
Returns:

ImageStack

getStackIndex(channel, slice, frame)

Returns that stack index (one-based) corresponding to the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js
Returns:

int

getStackSize()

If this is a stack, returns the number of slices, else returns 1.

Author:
  • Created by ijdoc2js
Returns:

int

getStartTime()

Returns the time in milliseconds when startTiming() was last called.

Author:
  • Created by ijdoc2js
Returns:

long

getStaticGlobalCalibration()

This is a version of getGlobalCalibration() that can be called from a static context.

Author:
  • Created by ijdoc2js
Returns:

Calibration

getStatistics(mOptions, nBins, histMin, histMax)

Returns an ImageStatistics object generated using the specified measurement options, histogram bin count and histogram range. Note: for 8-bit and RGB images, the number of bins is fixed at 256 and the histogram range is always 0-255.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

histMin double

-

histMax double

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions, nBins)

Returns an ImageStatistics object generated using the specified measurement options and histogram bin count. Note: except for float images, the number of bins is currently fixed at 256.

Parameters:
Name Type Description
mOptions int

-

nBins int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics()

Get calibrated statistics for this image or ROI, including histogram, area, mean, min and max, standard deviation and mode. This code demonstrates how to get the area, mean max and median of the current image or selection:

 imp = IJ.getImage();
stats = imp.getStatistics();
IJ.log("Area: "+stats.area);
IJ.log("Mean: "+stats.mean);
IJ.log("Max: "+stats.max);
Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStatistics(mOptions)

Returns an ImageStatistics object generated using the specified measurement options.

Parameters:
Name Type Description
mOptions int

-

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStringProperty(key)

Returns the string value from the "Info" property string associated with 'key', or null if the key is not found. Works with DICOM tags and Bio-Formats metadata.

Parameters:
Name Type Description
key java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getT()

Returns the current hyperstack frame position.

Author:
  • Created by ijdoc2js
Returns:

int

getTitle()

Returns the image name.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getType()

Returns the current image type (ImagePlus.GRAY8, ImagePlus.GRAY16, ImagePlus.GRAY32, ImagePlus.COLOR_256 or ImagePlus.COLOR_RGB).

Author:
  • Created by ijdoc2js
Returns:

int

getWidth()

Author:
  • Created by ijdoc2js
Returns:

int

getWindow()

Returns the ImageWindow that is being used to display this image. Returns null if show() has not be called or the ImageWindow has been closed.

Author:
  • Created by ijdoc2js
Returns:

ImageWindow

getZ()

Returns the current hyperstack slice position.

Author:
  • Created by ijdoc2js
Returns:

int

hide()

Closes the window, if any, that is displaying this image.

Author:
  • Created by ijdoc2js

imageUpdate(img, flags, x, y, w, h)

Used by ImagePlus to monitor loading of images.

Parameters:
Name Type Description
img java.awt.Image

-

flags int

-

x int

-

y int

-

w int

-

h int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

isComposite()

Returns true if this is a CompositeImage.

Author:
  • Created by ijdoc2js
Returns:

boolean

isDisplayedHyperStack()

Returns 'true' if this is a hyperstack currently being displayed in a StackWindow.

Author:
  • Created by ijdoc2js
Returns:

boolean

isHyperStack()

Returns 'true' if this image is a hyperstack.

Author:
  • Created by ijdoc2js
Returns:

boolean

isInvertedLut()

Returns true is this image uses an inverting LUT that displays zero as white and 255 as black.

Author:
  • Created by ijdoc2js
Returns:

boolean

isLocked()

Returns 'true' if the image is locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

isProcessor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isThreshold()

Returns 'true' if this image is thresholded.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this image is currently being displayed in a window.

Author:
  • Created by ijdoc2js
Returns:

boolean

killRoi()

Deletes the current region of interest.

Author:
  • Created by ijdoc2js

killStack()

Author:
  • Created by ijdoc2js

lock()

Locks the image so other threads can test to see if it is in use. Returns true if the image was successfully locked. Beeps, displays a message in the status bar, and returns false if the image is already locked.

Author:
  • Created by ijdoc2js
Returns:

boolean

lockSilently()

Similar to lock, but doesn't beep and display an error message if the attempt to lock the image fails.

Author:
  • Created by ijdoc2js
Returns:

boolean

mouseMoved(x, y)

Displays the cursor coordinates and pixel value in the status bar. Called by ImageCanvas when the mouse moves. Can be overridden by ImagePlus subclasses.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

paste()

Inserts the contents of the internal clipboard into the active image. If there is a selection the same size as the image on the clipboard, the image is inserted into that selection, otherwise the selection is inserted into the center of the image.

Author:
  • Created by ijdoc2js

removeImageListener(listener)

Parameters:
Name Type Description
listener ImageListener

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

resetClipboard()

Clears the internal clipboard.

Author:
  • Created by ijdoc2js

resetDisplayRange()

Author:
  • Created by ijdoc2js

resetStack()

Author:
  • Created by ijdoc2js

restoreRoi()

Author:
  • Created by ijdoc2js

revert()

Implements the File/Revert command.

Author:
  • Created by ijdoc2js

saveRoi()

Author:
  • Created by ijdoc2js

setActivated()

Called by ImageWindow.windowActivated().

Author:
  • Created by ijdoc2js

setActiveChannels(channels)

Controls which channels in a composite color image are displayed, where 'channels' is a list of ones and zeros that specify the channels to display. For example, "101" causes channels 1 and 3 to be displayed.

Parameters:
Name Type Description
channels java.lang.String

-

Author:
  • Created by ijdoc2js

setAntialiasRendering(antialiasRendering)

Enable/disable use of antialiasing by the flatten() method.

Parameters:
Name Type Description
antialiasRendering boolean

-

Author:
  • Created by ijdoc2js

setC(channel)

Sets the hyperstack channel position (one based).

Parameters:
Name Type Description
channel int

-

Author:
  • Created by ijdoc2js

setCalibration(cal)

Sets this image's calibration.

Parameters:
Name Type Description
cal Calibration

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets current foreground color.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setDefault16bitRange(bitDepth)

Set the default 16-bit display range, where 'bitDepth' must be 0 (auto-scaling), 8 (0-255), 10 (0-1023), 12 (0-4095, 14 (0-16383), 15 (0-32767) or 16 (0-65535).

Parameters:
Name Type Description
bitDepth int

-

Author:
  • Created by ijdoc2js

setDimensions(nChannels, nSlices, nFrames)

Sets the 3rd, 4th and 5th dimensions, where nChannelsnSlicesnFrames must be equal to the stack size.

Parameters:
Name Type Description
nChannels int

-

nSlices int

-

nFrames int

-

Author:
  • Created by ijdoc2js

setDisplayMode(mode)

Sets the display mode of composite color images, where 'mode' should be IJ.COMPOSITE, IJ.COLOR or IJ.GRAYSCALE.

Parameters:
Name Type Description
mode int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max, channels)

Sets the display range of specified channels in an RGB image, where 4=red, 2=green, 1=blue, 6=red+green, etc. With non-RGB images, this method is identical to setDisplayRange(min, max). This method is used by the Image/Adjust/Color Balance tool .

Parameters:
Name Type Description
min double

-

max double

-

channels int

-

Author:
  • Created by ijdoc2js

setDisplayRange(min, max)

Sets the display range of the current channel. With non-composite images it is identical to ip.setMinAndMax(min, max).

Parameters:
Name Type Description
min double

-

max double

-

Author:
  • Created by ijdoc2js

setFileInfo(fi)

Saves this image's FileInfo so it can be later retieved using getOriginalFileInfo().

Parameters:
Name Type Description
fi FileInfo

-

Author:
  • Created by ijdoc2js

setGlobalCalibration(global)

Sets the system-wide calibration.

Parameters:
Name Type Description
global Calibration

-

Author:
  • Created by ijdoc2js

setHideOverlay(hide)

Parameters:
Name Type Description
hide boolean

-

Author:
  • Created by ijdoc2js

setIgnoreFlush(ignoreFlush)

Parameters:
Name Type Description
ignoreFlush boolean

-

Author:
  • Created by ijdoc2js

setIgnoreGlobalCalibration(ignoreGlobalCalibration)

Parameters:
Name Type Description
ignoreGlobalCalibration boolean

-

Author:
  • Created by ijdoc2js

setIJMenuBar()

Author:
  • Created by ijdoc2js
Returns:

boolean

setIJMenuBar(b)

Parameters:
Name Type Description
b boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Replaces this image with the specified ImagePlus. May not work as expected if 'imp' is a CompositeImage and this image is not.

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setImage(img)

Replaces the image, if any, with the one specified. Throws an IllegalStateException if an error occurs while loading the image.

Parameters:
Name Type Description
img java.awt.Image

-

Author:
  • Created by ijdoc2js

setLut(lut)

Assigns a LUT (lookup table) to this image.

Parameters:
Name Type Description
lut LUT

-

Author:
  • Created by ijdoc2js

setOpenAsHyperStack(openAsHyperStack)

Parameters:
Name Type Description
openAsHyperStack boolean

-

Author:
  • Created by ijdoc2js

setOverlay(roi, strokeColor, strokeWidth, fillColor)

Creates an Overlay from the specified ROI, and assigns it to this image.

Parameters:
Name Type Description
roi Roi

-

strokeColor java.awt.Color

-

strokeWidth int

-

fillColor java.awt.Color

-

Author:
  • Created by ijdoc2js

setOverlay(shape, color, stroke)

Creates an Overlay from the specified Shape, Color and BasicStroke, and assigns it to this image.

Parameters:
Name Type Description
shape java.awt.Shape

-

color java.awt.Color

-

stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

setOverlay(overlay)

Installs a list of ROIs that will be drawn on this image as a non-destructive overlay.

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setPosition(n)

Set the current hyperstack position based on the stack index 'n' (one-based).

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setPositionWithoutUpdate(channel, slice, frame)

Sets the current hyperstack position without updating the display, where 'channel', 'slice' and 'frame' are one-based indexes.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

setProcessor(title, ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as other images in the stack and it must be the same width and height. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProcessor(ip)

Replaces the ImageProcessor with the one specified and updates the display. With stacks, the ImageProcessor must be the same type as the other images in the stack and it must be the same width and height.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Adds a key-value pair to this image's properties. The key is removed from the properties table if value is null.

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.Object

-

Author:
  • Created by ijdoc2js

setRoi(newRoi, updateDisplay)

Assigns 'newRoi' to this image and displays it if 'updateDisplay' is true.

Parameters:
Name Type Description
newRoi Roi

-

updateDisplay boolean

-

Author:
  • Created by ijdoc2js

setRoi(newRoi)

Assigns the specified ROI to this image and displays it. Any existing ROI is deleted if roi is null or its width or height is zero.

Parameters:
Name Type Description
newRoi Roi

-

Author:
  • Created by ijdoc2js

setRoi(r)

Creates a rectangular selection.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

setRoi(x, y, width, height)

Creates a rectangular selection.

Parameters:
Name Type Description
x int

-

y int

-

width int

-

height int

-

Author:
  • Created by ijdoc2js

setSlice(n)

Displays the specified stack image, where 1<=n<=stackSize. Does nothing if this image is not a stack.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setSliceWithoutUpdate(n)

Displays the specified stack image (1<=n<=stackSize) without updating the display.

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setStack(stack)

Replaces the image with the specified stack and updates the display.

Parameters:
Name Type Description
stack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(title, newStack)

Replaces the image with the specified stack and updates the display. Set 'title' to null to leave the title unchanged.

Parameters:
Name Type Description
title java.lang.String

-

newStack ImageStack

-

Author:
  • Created by ijdoc2js

setStack(newStack, channels, slices, frames)

Parameters:
Name Type Description
newStack ImageStack

-

channels int

-

slices int

-

frames int

-

Author:
  • Created by ijdoc2js

setT(frame)

Sets the hyperstack frame position (one based).

Parameters:
Name Type Description
frame int

-

Author:
  • Created by ijdoc2js

setTitle(title)

Sets the image name.

Parameters:
Name Type Description
title java.lang.String

-

Author:
  • Created by ijdoc2js

setWindow(win)

This method should only be called from an ImageWindow.

Parameters:
Name Type Description
win ImageWindow

-

Author:
  • Created by ijdoc2js

setZ(slice)

Sets the hyperstack slice position (one based).

Parameters:
Name Type Description
slice int

-

Author:
  • Created by ijdoc2js

show()

Opens a window to display this image and clears the status bar.

Author:
  • Created by ijdoc2js

show(statusMessage)

Opens a window to display this image and displays 'statusMessage' in the status bar.

Parameters:
Name Type Description
statusMessage java.lang.String

-

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

trimProcessor()

Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null.

Author:
  • Created by ijdoc2js

unlock()

Unlocks the image.

Author:
  • Created by ijdoc2js

updateAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. Does nothing if there is no window associated with this image (i.e. show() has not been called).

Author:
  • Created by ijdoc2js

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.

Author:
  • Created by ijdoc2js

updateChannelAndDraw()

Updates this image from the pixel data in its associated ImageProcessor, then displays it. The CompositeImage class overrides this method to only update the current channel.

Author:
  • Created by ijdoc2js

updateImage()

ImageCanvas.paint() calls this method when the ImageProcessor has generated new image.

Author:
  • Created by ijdoc2js

updatePosition(c, z, t)

Parameters:
Name Type Description
c int

-

z int

-

t int

-

Author:
  • Created by ijdoc2js

updateStatusbarValue()

Redisplays the (x,y) coordinates and pixel value (which may have changed) in the status bar. Called by the Next Slice and Previous Slice commands to update the z-coordinate and pixel value.

Author:
  • Created by ijdoc2js