|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.process.ImageProcessor
public abstract class ImageProcessor
This abstract class is the superclass for classes that process the four data types (byte, short, float and RGB) supported by ImageJ.
ByteProcessor
,
ShortProcessor
,
FloatProcessor
,
ColorProcessor
Field Summary | |
---|---|
protected boolean |
antialiasedText
|
protected java.awt.image.ColorModel |
baseCM
|
static int |
BICUBIC
Interpolation methods |
static int |
BILINEAR
Interpolation methods |
static int |
BLACK
Value of pixels included in masks. |
static int |
BLACK_AND_WHITE_LUT
|
static int |
BLUR_MORE
|
protected byte[] |
bLUT1
|
protected byte[] |
bLUT2
|
protected boolean |
boldFont
|
static int |
CENTER_JUSTIFY
Center justify text. |
protected int |
clipXMax
|
protected int |
clipXMin
|
protected int |
clipYMax
|
protected int |
clipYMin
|
protected java.awt.image.ColorModel |
cm
|
protected java.awt.image.ColorModel |
cm2
|
static int |
CONVOLVE
|
protected float[] |
cTable
|
protected int |
cx
|
protected int |
cy
|
protected static java.awt.image.IndexColorModel |
defaultColorModel
|
protected java.awt.Color |
drawingColor
|
static int |
FIND_EDGES
|
protected java.awt.image.BufferedImage |
fmImage
|
protected java.awt.Font |
font
|
protected java.awt.FontMetrics |
fontMetrics
|
protected byte[] |
gLUT1
|
protected byte[] |
gLUT2
|
protected int |
height
|
protected double |
histogramMax
|
protected double |
histogramMin
|
protected int |
histogramSize
|
protected java.awt.image.BufferedImage |
image
|
protected java.awt.Image |
img
|
protected boolean |
interpolate
|
protected int |
interpolationMethod
|
protected boolean |
inversionTested
|
protected boolean |
invertedLut
|
static int |
ISODATA
Isodata thresholding method |
static int |
ISODATA2
Modified isodata method used in Image/Adjust/Threshold tool |
protected int |
justification
|
static int |
LEFT_JUSTIFY
Left justify text. |
protected int |
lineWidth
|
protected boolean |
lutAnimation
|
protected int |
lutUpdateMode
|
static int |
MAX
|
protected double |
maxThreshold
|
static int |
MEDIAN_FILTER
|
static int |
MIN
|
protected boolean |
minMaxSet
|
protected double |
minThreshold
|
static int |
NEAREST_NEIGHBOR
Interpolation methods |
protected boolean |
newPixels
|
static int |
NO_LUT_UPDATE
|
static double |
NO_THRESHOLD
Value returned by getMinThreshold() when thresholding is not enabled. |
static int |
NONE
Interpolation methods |
static int |
OVER_UNDER_LUT
|
protected java.awt.image.WritableRaster |
raster
|
static int |
RED_LUT
|
static int |
RIGHT_JUSTIFY
Right justify text. |
protected byte[] |
rLUT1
|
protected byte[] |
rLUT2
|
protected int |
roiHeight
|
protected int |
roiWidth
|
protected int |
roiX
|
protected int |
roiY
|
protected java.awt.image.SampleModel |
sampleModel
|
protected int |
snapshotHeight
|
protected int |
snapshotWidth
|
protected java.awt.image.MemoryImageSource |
source
|
protected int |
width
|
protected int |
xMax
|
protected int |
xMin
|
protected int |
yMax
|
protected int |
yMin
|
Constructor Summary | |
---|---|
ImageProcessor()
|
Method Summary | |
---|---|
void |
abs()
If this is a 32-bit or signed 16-bit image, performs an absolute value transform, otherwise does nothing. |
void |
add(double value)
Adds 'value' to each pixel in the image or ROI. |
void |
add(int value)
Adds 'value' to each pixel in the image or ROI. |
void |
and(int value)
Binary AND of each pixel in the image or ROI with 'value'. |
abstract void |
applyTable(int[] lut)
Transforms the image or ROI using a lookup table. |
void |
autoThreshold()
Converts the image to binary using an automatically determined threshold. |
ImageProcessor |
convertToByte(boolean doScaling)
Returns an 8-bit version of this image as a ByteProcessor. |
ImageProcessor |
convertToFloat()
Returns a 32-bit float version of this image as a FloatProcessor. |
ImageProcessor |
convertToRGB()
Returns an RGB version of this image as a ColorProcessor. |
ImageProcessor |
convertToShort(boolean doScaling)
Returns a 16-bit version of this image as a ShortProcessor. |
abstract void |
convolve(float[] kernel,
int kernelWidth,
int kernelHeight)
Performs a convolution operation using the specified kernel. |
abstract void |
convolve3x3(int[] kernel)
Convolves the image or ROI with the specified 3x3 integer convolution kernel. |
abstract void |
copyBits(ImageProcessor ip,
int xloc,
int yloc,
int mode)
Copies the image contained in 'ip' to (xloc, yloc) using one of the transfer modes defined in the Blitter interface. |
abstract java.awt.Image |
createImage()
Returns a copy of this image is the form of an AWT Image. |
abstract ImageProcessor |
createProcessor(int width,
int height)
Returns a new, blank processor with the specified width and height. |
abstract ImageProcessor |
crop()
Creates a new processor containing an image that corresponds to the current ROI. |
abstract void |
dilate()
Dilates the image or ROI using a 3x3 minimum filter. |
void |
draw(Roi roi)
Draws an Roi. |
void |
drawDot(int xcenter,
int ycenter)
Draws a dot using the current line width and fill/draw value. |
void |
drawDot2(int x,
int y)
Deprecated. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line from (x1,y1) to (x2,y2). |
void |
drawOval(int x,
int y,
int width,
int height)
Draws an elliptical shape. |
abstract void |
drawPixel(int x,
int y)
Sets the pixel at (x,y) to the current fill/draw value. |
void |
drawPolygon(java.awt.Polygon p)
Draws a polygon. |
void |
drawRect(int x,
int y,
int width,
int height)
Draws a rectangle. |
void |
drawString(java.lang.String s)
Draws a string at the current location using the current fill/draw value. |
void |
drawString(java.lang.String s,
int x,
int y)
Draws a string at the specified location using the current fill/draw value. |
abstract ImageProcessor |
duplicate()
Returns a duplicate of this image. |
abstract void |
erode()
Erodes the image or ROI using a 3x3 maximum filter. |
void |
exp()
Performs a exponential transform on the image or ROI. |
void |
fill()
Fills the image or ROI bounding rectangle with the current fill/draw value. |
abstract void |
fill(ImageProcessor mask)
Fills pixels that are within the ROI bounding rectangle and part of the mask (i.e. |
void |
fill(Roi roi)
Fills the ROI with the current fill/draw value. |
void |
fillOutside(Roi roi)
Fills outside an Roi. |
void |
fillOval(int x,
int y,
int width,
int height)
Fills an elliptical shape. |
void |
fillPolygon(java.awt.Polygon p)
Fills a polygon. |
abstract void |
filter(int type)
A 3x3 filter operation, where the argument (BLUR_MORE, FIND_EDGES, MEDIAN_FILTER, MIN or MAX) determines the filter type. |
void |
findEdges()
Finds edges in the image or ROI using a Sobel operator. |
void |
flipHorizontal()
Flips the image or ROI horizontally. |
abstract void |
flipVertical()
Flips the image or ROI vertically. |
void |
gamma(double value)
Performs gamma correction of the image or ROI. |
abstract int |
get(int index)
|
abstract int |
get(int x,
int y)
This is a faster version of getPixel() that does not do bounds checking. |
int |
getAutoThreshold()
Returns a pixel value (threshold) that can be used to divide the image into objects and background. |
int |
getAutoThreshold(int[] histogram)
This is a version of getAutoThreshold() that uses a histogram passed as an argument. |
abstract double |
getBackgroundValue()
Returns the background fill value. |
int |
getBestIndex(java.awt.Color c)
Returns the LUT index that's the best match for this color. |
double |
getBicubicInterpolatedPixel(double x0,
double y0,
ImageProcessor ip2)
This method is from Chapter 16 of "Digital Image Processing: An Algorithmic Introduction Using Java" by Burger and Burge (http://www.imagingbook.com/). |
java.awt.image.BufferedImage |
getBufferedImage()
Returns this image as a BufferedImage. |
float[] |
getCalibrationTable()
Returns the calibration table or null. |
java.awt.image.ColorModel |
getColorModel()
Returns this processor's color model. |
void |
getColumn(int x,
int y,
int[] data,
int length)
Returns the pixel values down the column starting at (x,y). |
java.awt.image.ColorModel |
getCurrentColorModel()
Returns the current color model, which may have been modified by setMinAndMax() or setThreshold(). |
java.awt.image.IndexColorModel |
getDefaultColorModel()
Returns the default grayscale IndexColorModel. |
abstract float |
getf(int index)
|
abstract float |
getf(int x,
int y)
|
float[][] |
getFloatArray()
Returns a copy of the pixel data as a 2D float array with dimensions [x=0..width-1][y=0..height-1]. |
java.awt.Font |
getFont()
Returns the current font. |
java.awt.FontMetrics |
getFontMetrics()
Returns the current FontMetrics. |
int |
getHeight()
Returns the height of this image in pixels. |
abstract int[] |
getHistogram()
Returns the histogram of the image or ROI. |
double |
getHistogramMax()
Returns the maximum histogram value used for histograms of float images. |
double |
getHistogramMin()
Returns the minimum histogram value used for histograms of float images. |
int |
getHistogramSize()
Returns the number of float image histogram bins. |
protected java.awt.image.SampleModel |
getIndexSampleModel()
|
int[][] |
getIntArray()
Returns a copy of the pixel data as a 2D int array with dimensions [x=0..width-1][y=0..height-1]. |
boolean |
getInterpolate()
Returns the value of the interpolate field. |
abstract double |
getInterpolatedPixel(double x,
double y)
Uses the current interpolation method (bilinear or bicubic) to find the pixel value at real coordinates (x,y). |
double |
getInterpolatedValue(double x,
double y)
Uses bilinear interpolation to find the pixel value at real coordinates (x,y). |
static java.lang.String[] |
getInterpolationMethods()
|
double[] |
getLine(double x1,
double y1,
double x2,
double y2)
Returns an array containing the pixel values along the line starting at (x1,y1) and ending at (x2,y2). |
int |
getLineWidth()
Returns the current line width. |
int |
getLutUpdateMode()
Returns the LUT update mode, which can be RED_LUT, BLACK_AND_WHITE_LUT, OVER_UNDER_LUT or NO_LUT_UPDATE. |
ImageProcessor |
getMask()
For images with irregular ROIs, returns a mask, otherwise, returns null. |
byte[] |
getMaskArray()
Returns the mask byte array, or null if there is no mask. |
abstract double |
getMax()
Returns the largest displayed pixel value. |
double |
getMaxThreshold()
Returns the upper threshold level. |
abstract double |
getMin()
Returns the smallest displayed pixel value. |
double |
getMinThreshold()
Returns the lower threshold level. |
int |
getNChannels()
Returns the number of color channels in the image. |
void |
getNeighborhood(int x,
int y,
double[][] arr)
Experimental |
abstract int |
getPixel(int x,
int y)
Returns the value of the pixel at (x,y). |
int[] |
getPixel(int x,
int y,
int[] iArray)
Returns the samples for the pixel at (x,y) in an int array. |
int |
getPixelCount()
|
abstract int |
getPixelInterpolated(double x,
double y)
Uses the current interpolation method to find the pixel value at real coordinates (x,y). |
abstract java.lang.Object |
getPixels()
Returns a reference to this image's pixel array. |
abstract java.lang.Object |
getPixelsCopy()
Returns a copy of the pixel data. |
abstract float |
getPixelValue(int x,
int y)
Returns the value of the pixel at (x,y). |
java.awt.Rectangle |
getRoi()
Returns a Rectangle that represents the current region of interest. |
void |
getRow(int x,
int y,
int[] data,
int length)
Returns the pixel values along the horizontal line starting at (x,y). |
abstract java.lang.Object |
getSnapshotPixels()
Returns a reference to the snapshot (undo) buffer, or null. |
ImageStatistics |
getStatistics()
|
int |
getStringWidth(java.lang.String s)
Returns the width in pixels of the specified string. |
int |
getWidth()
Returns the width of this image in pixels. |
protected void |
hideProgress()
Deprecated. |
void |
insert(ImageProcessor ip,
int xloc,
int yloc)
Inserts the image contained in 'ip' at (xloc, yloc). |
void |
invert()
Inverts the image or ROI. |
void |
invertLut()
Inverts the values in this image's LUT (indexed color model). |
boolean |
isBinary()
Returns 'true' if this is a binary image (8-bit-image with only 0 and 255). |
boolean |
isColorLut()
Returns true if this image uses a color LUT. |
boolean |
isDefaultLut()
Returns true if the image is using the default grayscale LUT. |
boolean |
isInvertedLut()
Returns true if this image uses an inverting LUT that displays zero as white and 255 as black. |
boolean |
isKillable()
Deprecated. |
boolean |
isPseudoColorLut()
Returns true if this image uses a pseudocolor or grayscale LUT, in other words, is this an image that can be filtered. |
void |
lineTo(int x2,
int y2)
Draws a line from the current drawing location to (x2,y2). |
void |
log()
Performs a log transform on the image or ROI. |
protected void |
makeDefaultColorModel()
|
protected java.lang.String |
maskSizeError(ImageProcessor mask)
|
void |
max(double value)
Pixels greater than 'value' are set to 'value'. |
double |
maxValue()
Returns the maximum possible pixel value. |
abstract void |
medianFilter()
A 3x3 median filter. |
void |
min(double value)
Pixels less than 'value' are set to 'value'. |
double |
minValue()
Returns the minimum possible pixel value. |
void |
moveTo(int x,
int y)
Sets the current drawing location. |
void |
multiply(double value)
Multiplies each pixel in the image or ROI by 'value'. |
abstract void |
noise(double range)
Adds random noise to the image or ROI. |
void |
or(int value)
Binary OR of each pixel in the image or ROI with 'value'. |
void |
putColumn(int x,
int y,
int[] data,
int length)
Inserts the pixels contained in 'data' into a column starting at (x,y). |
abstract void |
putPixel(int x,
int y,
int value)
Stores the specified value at (x,y). |
void |
putPixel(int x,
int y,
int[] iArray)
Sets a pixel in the image using an int array of samples. |
abstract void |
putPixelValue(int x,
int y,
double value)
Stores the specified value at (x,y). |
void |
putRow(int x,
int y,
int[] data,
int length)
Inserts the pixels contained in 'data' into a horizontal line starting at (x,y). |
abstract void |
reset()
Restores the pixel data from the snapshot (undo) buffer. |
abstract void |
reset(ImageProcessor mask)
Restores pixels from the snapshot buffer that are within the rectangular roi but not part of the mask. |
void |
resetBinaryThreshold()
Resets the threshold if minThreshold=maxThreshold and lutUpdateMode=NO_LUT_UPDATE. |
void |
resetMinAndMax()
For short and float images, recalculates the min and max image values needed to correctly display the image. |
void |
resetRoi()
Sets the ROI (Region of Interest) and clipping rectangle to the entire image. |
void |
resetThreshold()
Disables thresholding. |
ImageProcessor |
resize(int dstWidth)
Creates a new ImageProcessor containing a scaled copy of this image or ROI, with the aspect ratio maintained. |
abstract ImageProcessor |
resize(int dstWidth,
int dstHeight)
Creates a new ImageProcessor containing a scaled copy of this image or ROI. |
abstract void |
rotate(double angle)
Rotates the image or selection 'angle' degrees clockwise. |
ImageProcessor |
rotateLeft()
Rotates the entire image 90 degrees counter-clockwise. |
ImageProcessor |
rotateRight()
Rotates the entire image 90 degrees clockwise. |
abstract void |
scale(double xScale,
double yScale)
Scales the image by the specified factors. |
abstract void |
set(int index,
int value)
|
abstract void |
set(int x,
int y,
int value)
This is a faster version of putPixel() that does not clip out of range values and does not do bounds checking. |
void |
setAntialiasedText(boolean antialiasedText)
Specifies whether or not text is drawn using antialiasing. |
void |
setAutoThreshold(int method,
int lutUpdate)
Automatically sets the lower and upper threshold levels, where 'method' must be ISODATA or ISODATA2 and 'lutUpdate' must be RED_LUT, BLACK_AND_WHITE_LUT, OVER_UNDER_LUT or NO_LUT_UPDATE. |
void |
setAutoThreshold(java.lang.String method)
|
void |
setAutoThreshold(java.lang.String method,
boolean darkBackground,
int lutUpdate)
|
abstract void |
setBackgroundValue(double value)
Sets the background fill value used by the rotate(), scale() and translate() methods. |
void |
setBinaryThreshold()
|
void |
setCalibrationTable(float[] cTable)
Set a lookup table used by getPixelValue(), getLine() and convertToFloat() to calibrate pixel values. |
void |
setClipRect(java.awt.Rectangle clipRect)
Updates the clipping rectangle used by lineTo(), drawLine(), drawDot() and drawPixel(). |
abstract void |
setColor(java.awt.Color color)
Sets the default fill/draw value to the pixel value closest to the specified color. |
void |
setColor(int value)
Sets the default fill/draw value. |
void |
setColorModel(java.awt.image.ColorModel cm)
Sets the color model. |
abstract void |
setf(int index,
float value)
|
abstract void |
setf(int x,
int y,
float value)
|
void |
setFloatArray(float[][] a)
Replaces the pixel data with contents of the specified 2D float array. |
void |
setFont(java.awt.Font font)
Sets the font used by drawString(). |
void |
setHistogramRange(double histMin,
double histMax)
Set the range used for histograms of float images. |
void |
setHistogramSize(int size)
Set the number of bins to be used for histograms of float images. |
void |
setIntArray(int[][] a)
Replaces the pixel data with contents of the specified 2D int array. |
void |
setInterpolate(boolean interpolate)
This method has been replaced by setInterpolationMethod(). |
void |
setInterpolationMethod(int method)
Use this method to set the interpolation method (NONE, BILINEAR or BICUBIC) used by scale(), resize() and rotate(). |
void |
setJustification(int justification)
Sets the justification used by drawString(), where justification
is CENTER_JUSTIFY, RIGHT_JUSTIFY or LEFT_JUSTIFY. |
void |
setLineWidth(int width)
Sets the line width used by lineTo() and drawDot(). |
void |
setLutAnimation(boolean lutAnimation)
For 16 and 32 bit processors, set 'lutAnimation' true to have createImage() use the cached 8-bit version of the image. |
void |
setMask(ImageProcessor mask)
Defines a byte mask that limits processing to an irregular ROI. |
abstract void |
setMinAndMax(double min,
double max)
This image will be displayed by mapping pixel values in the range min-max to screen values in the range 0-255. |
static void |
setOverColor(int red,
int green,
int blue)
Sets the upper Over/Under threshold color. |
abstract void |
setPixels(int channelNumber,
FloatProcessor fp)
Sets the pixels (of one color channel for RGB images) from a FloatProcessor. |
abstract void |
setPixels(java.lang.Object pixels)
Sets a new pixel array for the image. |
void |
setProgressBar(ProgressBar pb)
Assigns a progress bar to this processor. |
void |
setRoi(int x,
int y,
int rwidth,
int rheight)
Defines a rectangular region of interest and sets the mask to null if this ROI is not the same size as the previous one. |
void |
setRoi(java.awt.Polygon roi)
Defines a polygonal region of interest that will consist of a rectangular ROI and a mask. |
void |
setRoi(java.awt.Rectangle roi)
Defines a rectangular region of interest and sets the mask to null if this ROI is not the same size as the previous one. |
void |
setRoi(Roi roi)
Defines a non-rectangular region of interest that will consist of a rectangular ROI and a mask. |
void |
setSnapshotCopyMode(boolean b)
The getPixelsCopy() method returns a reference to the snapshot buffer if it is not null and 'snapshotCopyMode' is true. |
abstract void |
setSnapshotPixels(java.lang.Object pixels)
Sets a new pixel array for the snapshot (undo) buffer. |
void |
setThreshold(double minThreshold,
double maxThreshold,
int lutUpdate)
Sets the lower and upper threshold levels. |
static void |
setUnderColor(int red,
int green,
int blue)
Set the lower Over/Under thresholding color. |
static void |
setUseBicubic(boolean b)
|
abstract void |
setValue(double value)
Sets the default fill/draw value. |
void |
sharpen()
Sharpens the image or ROI using a 3x3 convolution kernel. |
protected void |
showProgress(double percentDone)
|
void |
smooth()
Replaces each pixel with the 3x3 neighborhood mean. |
abstract void |
snapshot()
Makes a copy of this image's pixel data that can be later restored using reset() or reset(mask). |
void |
sqr()
Performs a square transform on the image or ROI. |
void |
sqrt()
Performs a square root transform on the image or ROI. |
abstract void |
threshold(int level)
Sets pixels less than or equal to level to 0 and all other pixels to 255. |
abstract FloatProcessor |
toFloat(int channelNumber,
FloatProcessor fp)
Returns a FloatProcessor with the image or one color channel thereof. |
java.lang.String |
toString()
Returns a string containing information about this ImageProcessor. |
void |
translate(double xOffset,
double yOffset)
Moves the image or selection vertically or horizontally by a specified number of pixels. |
void |
translate(int xOffset,
int yOffset,
boolean eraseBackground)
Deprecated. replaced by translate(x,y) |
void |
updateComposite(int[] rgbPixels,
int channel)
CompositeImage calls this method to generate an updated color image. |
void |
xor(int value)
Binary exclusive OR of each pixel in the image or ROI with 'value'. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BLACK
public static final double NO_THRESHOLD
public static final int LEFT_JUSTIFY
public static final int CENTER_JUSTIFY
public static final int RIGHT_JUSTIFY
public static final int ISODATA
public static final int ISODATA2
public static final int NEAREST_NEIGHBOR
public static final int NONE
public static final int BILINEAR
public static final int BICUBIC
public static final int BLUR_MORE
public static final int FIND_EDGES
public static final int MEDIAN_FILTER
public static final int MIN
public static final int MAX
public static final int CONVOLVE
public static final int RED_LUT
public static final int BLACK_AND_WHITE_LUT
public static final int NO_LUT_UPDATE
public static final int OVER_UNDER_LUT
protected int lineWidth
protected int cx
protected int cy
protected java.awt.Font font
protected java.awt.FontMetrics fontMetrics
protected boolean antialiasedText
protected boolean boldFont
protected int width
protected int snapshotWidth
protected int height
protected int snapshotHeight
protected int roiX
protected int roiY
protected int roiWidth
protected int roiHeight
protected int xMin
protected int xMax
protected int yMin
protected int yMax
protected java.awt.image.ColorModel baseCM
protected java.awt.image.ColorModel cm
protected byte[] rLUT1
protected byte[] gLUT1
protected byte[] bLUT1
protected byte[] rLUT2
protected byte[] gLUT2
protected byte[] bLUT2
protected boolean interpolate
protected int interpolationMethod
protected double minThreshold
protected double maxThreshold
protected int histogramSize
protected double histogramMin
protected double histogramMax
protected float[] cTable
protected boolean lutAnimation
protected java.awt.image.MemoryImageSource source
protected java.awt.Image img
protected boolean newPixels
protected java.awt.Color drawingColor
protected int clipXMin
protected int clipXMax
protected int clipYMin
protected int clipYMax
protected int justification
protected int lutUpdateMode
protected java.awt.image.WritableRaster raster
protected java.awt.image.BufferedImage image
protected java.awt.image.BufferedImage fmImage
protected java.awt.image.ColorModel cm2
protected java.awt.image.SampleModel sampleModel
protected static java.awt.image.IndexColorModel defaultColorModel
protected boolean minMaxSet
protected boolean inversionTested
protected boolean invertedLut
Constructor Detail |
---|
public ImageProcessor()
Method Detail |
---|
protected void showProgress(double percentDone)
protected void hideProgress()
public int getWidth()
public int getHeight()
public java.awt.image.ColorModel getColorModel()
public java.awt.image.ColorModel getCurrentColorModel()
public void setColorModel(java.awt.image.ColorModel cm)
protected void makeDefaultColorModel()
public void invertLut()
public int getBestIndex(java.awt.Color c)
public boolean isInvertedLut()
public boolean isColorLut()
public boolean isPseudoColorLut()
public boolean isDefaultLut()
public abstract void setColor(java.awt.Color color)
public void setColor(int value)
public abstract void setValue(double value)
public abstract void setBackgroundValue(double value)
public abstract double getBackgroundValue()
public abstract double getMin()
public abstract double getMax()
public abstract void setMinAndMax(double min, double max)
public void resetMinAndMax()
public void setThreshold(double minThreshold, double maxThreshold, int lutUpdate)
public void setAutoThreshold(java.lang.String method)
public void setAutoThreshold(java.lang.String method, boolean darkBackground, int lutUpdate)
public void setAutoThreshold(int method, int lutUpdate)
public void resetThreshold()
public double getMinThreshold()
public double getMaxThreshold()
public int getLutUpdateMode()
public void setBinaryThreshold()
public void resetBinaryThreshold()
setBinaryThreshold()
public void setRoi(java.awt.Rectangle roi)
resetRoi()
public void setRoi(int x, int y, int rwidth, int rheight)
resetRoi()
public void setRoi(Roi roi)
reset(mask)
to restore non-masked pixels. Here is an example:
ip.setRoi(new OvalRoi(50, 50, 100, 50)); ip.fill(); ip.reset(ip.getMask());The example assumes
snapshot()
has been called, which is the case
for code executed in the run()
method of plugins that implement the
PlugInFilter
interface.
ImagePlus.getRoi()
public void setRoi(java.awt.Polygon roi)
reset(mask)
to restore non-masked pixels. Here is an example:
Polygon p = new Polygon(); p.addPoint(50, 0); p.addPoint(100, 100); p.addPoint(0, 100); ip.setRoi(triangle); ip.invert(); ip.reset(ip.getMask());The example assumes
snapshot()
has been called, which is the case
for code executed in the run()
method of plugins that implement the
PlugInFilter
interface.
Roi.getPolygon()
,
drawPolygon(java.awt.Polygon)
,
fillPolygon(java.awt.Polygon)
public void resetRoi()
public java.awt.Rectangle getRoi()
public void setMask(ImageProcessor mask)
public ImageProcessor getMask()
public byte[] getMaskArray()
public void setProgressBar(ProgressBar pb)
public void setInterpolate(boolean interpolate)
public void setInterpolationMethod(int method)
public static java.lang.String[] getInterpolationMethods()
public boolean getInterpolate()
public boolean isKillable()
public double[] getLine(double x1, double y1, double x2, double y2)
setInterpolate(boolean)
public void getRow(int x, int y, int[] data, int length)
public void getColumn(int x, int y, int[] data, int length)
public void putRow(int x, int y, int[] data, int length)
public void putColumn(int x, int y, int[] data, int length)
public void moveTo(int x, int y)
lineTo(int, int)
,
drawString(java.lang.String)
public void setLineWidth(int width)
public int getLineWidth()
public void lineTo(int x2, int y2)
public void drawLine(int x1, int y1, int x2, int y2)
public void drawRect(int x, int y, int width, int height)
public void drawOval(int x, int y, int width, int height)
public void fillOval(int x, int y, int width, int height)
public void drawPolygon(java.awt.Polygon p)
public void fillPolygon(java.awt.Polygon p)
public void drawDot2(int x, int y)
public void drawDot(int xcenter, int ycenter)
public void drawString(java.lang.String s)
public void drawString(java.lang.String s, int x, int y)
public void setJustification(int justification)
justification
is CENTER_JUSTIFY, RIGHT_JUSTIFY or LEFT_JUSTIFY. The default is LEFT_JUSTIFY.
public void setFont(java.awt.Font font)
public void setAntialiasedText(boolean antialiasedText)
public int getStringWidth(java.lang.String s)
public java.awt.Font getFont()
public java.awt.FontMetrics getFontMetrics()
public void smooth()
public void sharpen()
public void findEdges()
public abstract void flipVertical()
public void flipHorizontal()
public ImageProcessor rotateRight()
public ImageProcessor rotateLeft()
public void insert(ImageProcessor ip, int xloc, int yloc)
public java.lang.String toString()
toString
in class java.lang.Object
public void fill()
setColor(Color)
,
setValue(double)
,
fill(Roi)
public abstract void fill(ImageProcessor mask)
setColor(Color)
,
setValue(double)
,
getMask()
,
fill(Roi)
public void fill(Roi roi)
setColor(Color)
,
setValue(double)
,
fill(Roi)
public void fillOutside(Roi roi)
public void draw(Roi roi)
public void setCalibrationTable(float[] cTable)
Calibration.setCTable(float[], java.lang.String)
public float[] getCalibrationTable()
public void setHistogramSize(int size)
public int getHistogramSize()
public void setHistogramRange(double histMin, double histMax)
histMin
and histMax
are zero.
public double getHistogramMin()
public double getHistogramMax()
public abstract java.lang.Object getPixels()
public abstract java.lang.Object getPixelsCopy()
snapshot()
,
setSnapshotCopyMode(boolean)
public abstract int getPixel(int x, int y)
public int getPixelCount()
public abstract int get(int x, int y)
public abstract int get(int index)
public abstract void set(int x, int y, int value)
public abstract void set(int index, int value)
public abstract float getf(int x, int y)
public abstract float getf(int index)
public abstract void setf(int x, int y, float value)
public abstract void setf(int index, float value)
public int[][] getIntArray()
public void setIntArray(int[][] a)
public float[][] getFloatArray()
public void setFloatArray(float[][] a)
public void getNeighborhood(int x, int y, double[][] arr)
public int[] getPixel(int x, int y, int[] iArray)
public void putPixel(int x, int y, int[] iArray)
public abstract double getInterpolatedPixel(double x, double y)
public abstract int getPixelInterpolated(double x, double y)
public final double getInterpolatedValue(double x, double y)
public double getBicubicInterpolatedPixel(double x0, double y0, ImageProcessor ip2)
public abstract void putPixel(int x, int y, int value)
public abstract float getPixelValue(int x, int y)
public abstract void putPixelValue(int x, int y, double value)
public abstract void drawPixel(int x, int y)
public abstract void setPixels(java.lang.Object pixels)
public abstract void copyBits(ImageProcessor ip, int xloc, int yloc, int mode)
public abstract void applyTable(int[] lut)
public void invert()
public void add(int value)
public void add(double value)
public void multiply(double value)
public void and(int value)
public void or(int value)
public void xor(int value)
public void gamma(double value)
public void log()
public void exp()
public void sqr()
public void sqrt()
public void abs()
public void min(double value)
public void max(double value)
public abstract java.awt.Image createImage()
public java.awt.image.BufferedImage getBufferedImage()
public abstract ImageProcessor createProcessor(int width, int height)
public abstract void snapshot()
reset()
,
reset(ImageProcessor)
public abstract void reset()
public abstract void reset(ImageProcessor mask)
public abstract void setSnapshotPixels(java.lang.Object pixels)
public abstract java.lang.Object getSnapshotPixels()
public abstract void convolve3x3(int[] kernel)
public abstract void filter(int type)
public abstract void medianFilter()
public abstract void noise(double range)
range
- the range of random numberspublic abstract ImageProcessor crop()
public abstract void threshold(int level)
public abstract ImageProcessor duplicate()
public abstract void scale(double xScale, double yScale)
setInterpolate(boolean)
,
resize(int, int)
public abstract ImageProcessor resize(int dstWidth, int dstHeight)
setInterpolate(boolean)
public ImageProcessor resize(int dstWidth)
public abstract void rotate(double angle)
setInterpolate(boolean)
public void translate(double xOffset, double yOffset)
public void translate(int xOffset, int yOffset, boolean eraseBackground)
public abstract int[] getHistogram()
public abstract void erode()
public abstract void dilate()
public void setLutAnimation(boolean lutAnimation)
public ImageProcessor convertToByte(boolean doScaling)
public ImageProcessor convertToShort(boolean doScaling)
public ImageProcessor convertToFloat()
public ImageProcessor convertToRGB()
public abstract void convolve(float[] kernel, int kernelWidth, int kernelHeight)
public void autoThreshold()
public int getAutoThreshold()
public int getAutoThreshold(int[] histogram)
public void setClipRect(java.awt.Rectangle clipRect)
protected java.lang.String maskSizeError(ImageProcessor mask)
protected java.awt.image.SampleModel getIndexSampleModel()
public java.awt.image.IndexColorModel getDefaultColorModel()
public void setSnapshotCopyMode(boolean b)
getPixelsCopy()
,
snapshot()
public int getNChannels()
public abstract FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
channelNumber
- Determines the color channel, 0=red, 1=green, 2=blue. Ignored for
grayscale images.fp
- Here a FloatProcessor can be supplied, or null. The FloatProcessor
is overwritten when converting data (re-using its pixels array
improves performance).
public abstract void setPixels(int channelNumber, FloatProcessor fp)
channelNumber
- Determines the color channel, 0=red, 1=green, 2=blue.Ignored for
grayscale images.fp
- The FloatProcessor where the image data are read from.public double minValue()
public double maxValue()
public void updateComposite(int[] rgbPixels, int channel)
public static void setOverColor(int red, int green, int blue)
public static void setUnderColor(int red, int green, int blue)
public boolean isBinary()
public static void setUseBicubic(boolean b)
public ImageStatistics getStatistics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |