|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ij.process.ImageProcessor ij.process.ByteProcessor
public class ByteProcessor
This is an 8-bit image and methods that operate on that image. Based on the ImageProcessor class from "KickAss Java Programming" by Tonny Espeset.
Field Summary | |
---|---|
protected byte[] |
pixels
|
protected byte[] |
snapshotPixels
|
Fields inherited from class ij.process.ImageProcessor |
---|
antialiasedText, baseCM, BLACK, BLACK_AND_WHITE_LUT, bLUT1, bLUT2, boldFont, CENTER_JUSTIFY, clipXMax, clipXMin, clipYMax, clipYMin, cm, cm2, cTable, cx, cy, defaultColorModel, drawingColor, font, fontMetrics, gLUT1, gLUT2, height, histogramMax, histogramMin, histogramSize, image, img, interpolate, inversionTested, invertedLut, justification, LEFT_JUSTIFY, lineWidth, lutAnimation, lutUpdateMode, maxThreshold, minThreshold, newPixels, NO_LUT_UPDATE, NO_THRESHOLD, OVER_UNDER_LUT, raster, RED_LUT, RIGHT_JUSTIFY, rLUT1, rLUT2, roiHeight, roiWidth, roiX, roiY, sampleModel, snapshotHeight, snapshotWidth, source, width, xMax, xMin, yMax, yMin |
Constructor Summary | |
---|---|
ByteProcessor(java.awt.Image img)
Creates a ByteProcessor from an 8-bit, indexed color AWT Image. |
|
ByteProcessor(int width,
int height)
Creates a blank ByteProcessor of the specified dimensions. |
|
ByteProcessor(int width,
int height,
byte[] pixels,
java.awt.image.ColorModel cm)
Creates a ByteProcessor from a pixel array and IndexColorModel. |
Method Summary | |
---|---|
void |
applyLut()
|
void |
applyTable(int[] lut)
Transforms the image or ROI using a lookup table. |
void |
convolve(float[] kernel,
int kernelWidth,
int kernelHeight)
Performs a convolution operation using the specified kernel. |
void |
convolve3x3(int[] kernel)
3x3 convolution contributed by Glynne Casteel. |
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. |
java.awt.Image |
createImage()
Returns a copy of this image is the form of an AWT Image. |
ImageProcessor |
createProcessor(int width,
int height)
Returns a new, blank ByteProcessor with the specified width and height. |
ImageProcessor |
crop()
Creates a new processor containing an image that corresponds to the current ROI. |
void |
dilate()
Dilates the image or ROI using a 3x3 minimum filter. |
void |
dilate(int count,
int background)
|
void |
drawPixel(int x,
int y)
Draws a pixel in the current foreground color. |
ImageProcessor |
duplicate()
Returns a duplicate of this image. |
void |
erode()
Erodes the image or ROI using a 3x3 maximum filter. |
void |
erode(int count,
int background)
|
void |
fill(ImageProcessor mask)
Fills pixels that are within roi and part of the mask. |
void |
filter(int type)
Filters using a 3x3 neighborhood. |
void |
flipVertical()
Flips the image or ROI vertically. |
int |
get(int x,
int y)
This is a faster version of getPixel() that does not do bounds checking. |
float |
getf(int x,
int y)
|
int[] |
getHistogram()
Returns the histogram of the image or ROI. |
int[] |
getHistogram(ImageProcessor mask)
|
double |
getInterpolatedPixel(double x,
double y)
Uses bilinear interpolation to find the pixel value at real coordinates (x,y). |
double |
getMax()
Returns the largest displayed pixel value. |
double |
getMin()
Returns the smallest displayed pixel value. |
int |
getPixel(int x,
int y)
Returns the value of the pixel at (x,y). |
java.lang.Object |
getPixels()
Returns a reference to the byte array containing this image's pixel data. |
java.lang.Object |
getPixelsCopy()
Returns a reference to this image's snapshot (undo) array if it is not null and 'snapshotCopyMode' is true. |
float |
getPixelValue(int x,
int y)
Returns the value of the pixel at (x,y). |
void |
medianFilter()
A 3x3 median filter. |
void |
noise(double range)
Adds random noise to the image or ROI. |
void |
outline()
|
void |
putPixel(int x,
int y,
int value)
Stores the specified value at (x,y). |
void |
putPixelValue(int x,
int y,
double value)
Stores the specified real value at (x,y). |
void |
reset()
Reset the image from snapshot. |
void |
reset(ImageProcessor mask)
Restore pixels that are within roi but not part of mask. |
void |
resetMinAndMax()
Resets this image's LUT. |
ImageProcessor |
resize(int dstWidth,
int dstHeight)
Creates a new ByteProcessor containing a scaled copy of this image or selection. |
void |
rotate(double angle)
Rotates the image or ROI 'angle' degrees clockwise. |
void |
scale(double xScale,
double yScale)
Scales the image or selection using the specified scale factors. |
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 |
setBackgroundValue(double value)
Sets the background fill value, where 0<=value<=255. |
void |
setColor(java.awt.Color color)
Sets the foreground drawing color. |
void |
setf(int x,
int y,
float value)
|
void |
setMinAndMax(double min,
double max)
Maps the entries in this image's LUT from min-max to 0-255. |
void |
setPixels(java.lang.Object pixels)
Sets a new pixel array for the image. |
void |
setSnapshotPixels(java.lang.Object pixels)
Sets a new pixel array for the snapshot (undo) buffer. |
void |
setValue(double value)
Sets the default fill/draw value, where 0<=value<=255. |
void |
skeletonize()
|
void |
snapshot()
Make a snapshot of the current image. |
void |
threshold(int level)
Sets pixels less than or equal to level to 0 and all other pixels to 255. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected byte[] pixels
protected byte[] snapshotPixels
Constructor Detail |
---|
public ByteProcessor(java.awt.Image img)
public ByteProcessor(int width, int height)
public ByteProcessor(int width, int height, byte[] pixels, java.awt.image.ColorModel cm)
Method Detail |
---|
public java.awt.Image createImage()
ImageProcessor
createImage
in class ImageProcessor
public ImageProcessor createProcessor(int width, int height)
createProcessor
in class ImageProcessor
public ImageProcessor crop()
ImageProcessor
crop
in class ImageProcessor
public ImageProcessor duplicate()
duplicate
in class ImageProcessor
public void snapshot()
snapshot
in class ImageProcessor
public void reset()
reset
in class ImageProcessor
public void reset(ImageProcessor mask)
reset
in class ImageProcessor
public void setSnapshotPixels(java.lang.Object pixels)
ImageProcessor
setSnapshotPixels
in class ImageProcessor
public void fill(ImageProcessor mask)
fill
in class ImageProcessor
public int getPixel(int x, int y)
ImageProcessor
getPixel
in class ImageProcessor
public final int get(int x, int y)
ImageProcessor
get
in class ImageProcessor
public final void set(int x, int y, int value)
ImageProcessor
set
in class ImageProcessor
public final float getf(int x, int y)
getf
in class ImageProcessor
public final void setf(int x, int y, float value)
setf
in class ImageProcessor
public double getInterpolatedPixel(double x, double y)
getInterpolatedPixel
in class ImageProcessor
public float getPixelValue(int x, int y)
ImageProcessor
getPixelValue
in class ImageProcessor
public void setColor(java.awt.Color color)
setColor
in class ImageProcessor
public void setValue(double value)
setValue
in class ImageProcessor
public void setBackgroundValue(double value)
setBackgroundValue
in class ImageProcessor
public void putPixelValue(int x, int y, double value)
putPixelValue
in class ImageProcessor
public void putPixel(int x, int y, int value)
putPixel
in class ImageProcessor
public void drawPixel(int x, int y)
drawPixel
in class ImageProcessor
public java.lang.Object getPixels()
getPixels
in class ImageProcessor
public java.lang.Object getPixelsCopy()
getPixelsCopy
in class ImageProcessor
public void setPixels(java.lang.Object pixels)
ImageProcessor
setPixels
in class ImageProcessor
public double getMin()
getMin
in class ImageProcessor
public double getMax()
getMax
in class ImageProcessor
public void setMinAndMax(double min, double max)
setMinAndMax
in class ImageProcessor
public void resetMinAndMax()
resetMinAndMax
in class ImageProcessor
public void copyBits(ImageProcessor ip, int xloc, int yloc, int mode)
copyBits
in class ImageProcessor
public void applyTable(int[] lut)
ImageProcessor
applyTable
in class ImageProcessor
public void convolve3x3(int[] kernel)
convolve3x3
in class ImageProcessor
public void filter(int type)
p1 p2 p3 p4 p5 p6 p7 p8 p9
filter
in class ImageProcessor
public void erode()
ImageProcessor
erode
in class ImageProcessor
public void dilate()
ImageProcessor
dilate
in class ImageProcessor
public void erode(int count, int background)
public void dilate(int count, int background)
public void outline()
public void skeletonize()
public void medianFilter()
ImageProcessor
medianFilter
in class ImageProcessor
public void noise(double range)
ImageProcessor
noise
in class ImageProcessor
range
- the range of random numberspublic void scale(double xScale, double yScale)
scale
in class ImageProcessor
ImageProcessor.setInterpolate(boolean)
public ImageProcessor resize(int dstWidth, int dstHeight)
resize
in class ImageProcessor
ImageProcessor.setInterpolate(boolean)
public void rotate(double angle)
rotate
in class ImageProcessor
ImageProcessor.setInterpolate(boolean)
public void flipVertical()
ImageProcessor
flipVertical
in class ImageProcessor
public int[] getHistogram()
ImageProcessor
getHistogram
in class ImageProcessor
public int[] getHistogram(ImageProcessor mask)
public void threshold(int level)
threshold
in class ImageProcessor
public void applyLut()
public void convolve(float[] kernel, int kernelWidth, int kernelHeight)
convolve
in class ImageProcessor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |