|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.process.ImageProcessor
ij.process.ShortProcessor
public class ShortProcessor
ShortProcessors contain a 16-bit unsigned image and methods that operate on that image.
Field Summary |
---|
Fields inherited from class ij.process.ImageProcessor |
---|
antialiasedText, baseCM, BICUBIC, BILINEAR, BLACK, BLACK_AND_WHITE_LUT, BLUR_MORE, bLUT1, bLUT2, boldFont, CENTER_JUSTIFY, clipXMax, clipXMin, clipYMax, clipYMin, cm, cm2, CONVOLVE, cTable, cx, cy, defaultColorModel, drawingColor, FIND_EDGES, fmImage, font, fontMetrics, gLUT1, gLUT2, height, histogramMax, histogramMin, histogramSize, image, img, interpolate, interpolationMethod, inversionTested, invertedLut, ISODATA, ISODATA2, justification, LEFT_JUSTIFY, lineWidth, lutAnimation, lutUpdateMode, MAX, maxThreshold, MEDIAN_FILTER, MIN, minMaxSet, minThreshold, NEAREST_NEIGHBOR, newPixels, NO_LUT_UPDATE, NO_THRESHOLD, NONE, 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 | |
---|---|
ShortProcessor(java.awt.image.BufferedImage bi)
Creates a ShortProcessor from a TYPE_USHORT_GRAY BufferedImage. |
|
ShortProcessor(int width,
int height)
Creates a blank ShortProcessor using the default grayscale LUT that displays zero as black. |
|
ShortProcessor(int width,
int height,
boolean unsigned)
Obsolete. |
|
ShortProcessor(int width,
int height,
short[] pixels,
java.awt.image.ColorModel cm)
Creates a new ShortProcessor using the specified pixel array and ColorModel. |
|
ShortProcessor(int width,
int height,
short[] pixels,
java.awt.image.ColorModel cm,
boolean unsigned)
Deprecated. 16 bit images are normally unsigned but signed images can be simulated by subtracting 32768 and using a calibration function to restore the original values. |
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'. |
void |
applyTable(int[] lut)
Transforms the pixel data using a 65536 entry lookup table. |
void |
convolve(float[] kernel,
int kernelWidth,
int kernelHeight)
Performs a convolution operation using the specified kernel. |
void |
convolve3x3(int[] kernel)
Does 3x3 convolution. |
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()
Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255. |
ImageProcessor |
createProcessor(int width,
int height)
Returns a new, blank ShortProcessor with the specified width and height. |
ImageProcessor |
crop()
Creates a new processor containing an image that corresponds to the current ROI. |
void |
dilate()
Not implemented. |
void |
drawPixel(int x,
int y)
Draws a pixel in the current foreground color. |
ImageProcessor |
duplicate()
Returns a duplicate of this image. |
void |
erode()
Not implemented. |
void |
exp()
Performs a exponential transform on the image or ROI. |
void |
fill()
Fills the current rectangular ROI. |
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 |
findMinAndMax()
|
void |
flipVertical()
Flips the image or ROI vertically. |
void |
gamma(double value)
Performs gamma correction of the image or ROI. |
int |
get(int index)
|
int |
get(int x,
int y)
This is a faster version of getPixel() that does not do bounds checking. |
java.awt.image.BufferedImage |
get16BitBufferedImage()
Returns a copy of this image as a TYPE_USHORT_GRAY BufferedImage. |
double |
getBackgroundValue()
Always returns 0. |
java.awt.image.BufferedImage |
getBufferedImage()
Returns this image as an 8-bit BufferedImage . |
float |
getf(int index)
|
float |
getf(int x,
int y)
|
int[] |
getHistogram()
Returns 65536 bin histogram of the current ROI, which can be non-rectangular. |
double |
getInterpolatedPixel(double x,
double y)
Uses the current interpolation method (BILINEAR or BICUBIC) to calculate 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). |
int |
getPixelInterpolated(double x,
double y)
Uses the current interpolation method to find the pixel value at real coordinates (x,y). |
java.lang.Object |
getPixels()
Returns a reference to the short array containing this image's pixel data. |
java.lang.Object |
getPixelsCopy()
Returns a copy of the pixel data. |
float |
getPixelValue(int x,
int y)
Returns the value of the pixel at (x,y) as a float. |
java.lang.Object |
getSnapshotPixels()
Returns a reference to the snapshot (undo) buffer, or null. |
void |
invert()
Inverts the image or ROI. |
void |
log()
Performs a log transform on the image or ROI. |
void |
max(double value)
Pixels greater than 'value' are set to 'value'. |
double |
maxValue()
Returns the maximum possible pixel value. |
void |
medianFilter()
Not implemented. |
void |
min(double value)
Pixels less than 'value' are set to 'value'. |
void |
multiply(double value)
Multiplies each pixel in the image or ROI by 'value'. |
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 |
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()
Restores the pixel data from the snapshot (undo) buffer. |
void |
reset(ImageProcessor mask)
Restores pixels from the snapshot buffer that are within the rectangular roi but not part of the mask. |
void |
resetMinAndMax()
Recalculates the min and max values used to scale pixel values to 0-255 for display. |
ImageProcessor |
resize(int dstWidth,
int dstHeight)
Creates a new ShortProcessor 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 index,
int value)
|
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)
Does nothing. |
void |
setColor(java.awt.Color color)
Sets the foreground fill/draw color. |
void |
setf(int index,
float value)
|
void |
setf(int x,
int y,
float value)
|
void |
setMinAndMax(double minimum,
double maximum)
Sets the min and max variables that control how real pixel values are mapped to 0-255 screen values. |
void |
setPixels(int channelNumber,
FloatProcessor fp)
Sets the pixels from a FloatProcessor, no scaling. |
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 |
setThreshold(double minThreshold,
double maxThreshold,
int lutUpdate)
Sets the lower and upper threshold levels. |
void |
setValue(double value)
Sets the default fill/draw value, where 0<=value<=65535). |
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. |
void |
threshold(int level)
Sets pixels less than or equal to level to 0 and all other pixels to 255. |
FloatProcessor |
toFloat(int channelNumber,
FloatProcessor fp)
Returns a FloatProcessor with the same image, no scaling or calibration (pixel values 0 to 65535). |
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 |
Constructor Detail |
---|
public ShortProcessor(int width, int height, short[] pixels, java.awt.image.ColorModel cm)
public ShortProcessor(int width, int height)
public ShortProcessor(java.awt.image.BufferedImage bi)
public ShortProcessor(int width, int height, short[] pixels, java.awt.image.ColorModel cm, boolean unsigned)
public ShortProcessor(int width, int height, boolean unsigned)
Method Detail |
---|
public void findMinAndMax()
public java.awt.Image createImage()
createImage
in class ImageProcessor
public java.awt.image.BufferedImage getBufferedImage()
getBufferedImage
in class ImageProcessor
public java.awt.image.BufferedImage get16BitBufferedImage()
public ImageProcessor createProcessor(int width, int height)
createProcessor
in class ImageProcessor
public void snapshot()
ImageProcessor
snapshot
in class ImageProcessor
ImageProcessor.reset()
,
ImageProcessor.reset(ImageProcessor)
public void reset()
ImageProcessor
reset
in class ImageProcessor
public void reset(ImageProcessor mask)
ImageProcessor
reset
in class ImageProcessor
public void setSnapshotPixels(java.lang.Object pixels)
ImageProcessor
setSnapshotPixels
in class ImageProcessor
public java.lang.Object getSnapshotPixels()
ImageProcessor
getSnapshotPixels
in class ImageProcessor
public double getMin()
getMin
in class ImageProcessor
public double getMax()
getMax
in class ImageProcessor
public void setMinAndMax(double minimum, double maximum)
setMinAndMax
in class ImageProcessor
resetMinAndMax()
,
ContrastAdjuster
public void resetMinAndMax()
resetMinAndMax
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 int get(int index)
get
in class ImageProcessor
public final void set(int index, int value)
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 final float getf(int index)
getf
in class ImageProcessor
public final void setf(int index, float value)
setf
in class ImageProcessor
public double getInterpolatedPixel(double x, double y)
getInterpolatedPixel
in class ImageProcessor
public final int getPixelInterpolated(double x, double y)
ImageProcessor
getPixelInterpolated
in class ImageProcessor
public final void putPixel(int x, int y, int value)
putPixel
in class ImageProcessor
public void putPixelValue(int x, int y, double value)
putPixelValue
in class ImageProcessor
public void drawPixel(int x, int y)
drawPixel
in class ImageProcessor
public float getPixelValue(int x, int y)
getPixelValue
in class ImageProcessor
public java.lang.Object getPixels()
getPixels
in class ImageProcessor
public java.lang.Object getPixelsCopy()
getPixelsCopy
in class ImageProcessor
ImageProcessor.snapshot()
,
ImageProcessor.setSnapshotCopyMode(boolean)
public void setPixels(java.lang.Object pixels)
ImageProcessor
setPixels
in class ImageProcessor
public void copyBits(ImageProcessor ip, int xloc, int yloc, int mode)
copyBits
in class ImageProcessor
public void applyTable(int[] lut)
applyTable
in class ImageProcessor
public void invert()
ImageProcessor
invert
in class ImageProcessor
public void add(int value)
ImageProcessor
add
in class ImageProcessor
public void add(double value)
ImageProcessor
add
in class ImageProcessor
public void multiply(double value)
ImageProcessor
multiply
in class ImageProcessor
public void and(int value)
ImageProcessor
and
in class ImageProcessor
public void or(int value)
ImageProcessor
or
in class ImageProcessor
public void xor(int value)
ImageProcessor
xor
in class ImageProcessor
public void gamma(double value)
ImageProcessor
gamma
in class ImageProcessor
public void log()
ImageProcessor
log
in class ImageProcessor
public void exp()
ImageProcessor
exp
in class ImageProcessor
public void sqr()
ImageProcessor
sqr
in class ImageProcessor
public void sqrt()
ImageProcessor
sqrt
in class ImageProcessor
public void abs()
ImageProcessor
abs
in class ImageProcessor
public void min(double value)
ImageProcessor
min
in class ImageProcessor
public void max(double value)
ImageProcessor
max
in class ImageProcessor
public void fill()
fill
in class ImageProcessor
ImageProcessor.setColor(Color)
,
ImageProcessor.setValue(double)
,
ImageProcessor.fill(Roi)
public void fill(ImageProcessor mask)
fill
in class ImageProcessor
ImageProcessor.setColor(Color)
,
ImageProcessor.setValue(double)
,
ImageProcessor.getMask()
,
ImageProcessor.fill(Roi)
public void convolve3x3(int[] kernel)
convolve3x3
in class ImageProcessor
public void filter(int type)
filter
in class ImageProcessor
public void rotate(double angle)
rotate
in class ImageProcessor
ImageProcessor.setInterpolate(boolean)
public void flipVertical()
ImageProcessor
flipVertical
in class ImageProcessor
public void scale(double xScale, double yScale)
scale
in class ImageProcessor
ImageProcessor.setInterpolationMethod(int)
public ImageProcessor resize(int dstWidth, int dstHeight)
resize
in class ImageProcessor
ImageProcessor.setInterpolate(boolean)
public ImageProcessor crop()
ImageProcessor
crop
in class ImageProcessor
public ImageProcessor duplicate()
duplicate
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 double getBackgroundValue()
getBackgroundValue
in class ImageProcessor
public int[] getHistogram()
getHistogram
in class ImageProcessor
public void setThreshold(double minThreshold, double maxThreshold, int lutUpdate)
ImageProcessor
setThreshold
in class ImageProcessor
public void convolve(float[] kernel, int kernelWidth, int kernelHeight)
convolve
in class ImageProcessor
public void noise(double range)
ImageProcessor
noise
in class ImageProcessor
range
- the range of random numberspublic void threshold(int level)
ImageProcessor
threshold
in class ImageProcessor
public FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
toFloat
in class ImageProcessor
channelNumber
- Ignored (needed for compatibility with ColorProcessor.toFloat)fp
- Here a FloatProcessor can be supplied, or null. The FloatProcessor
is overwritten by this method (re-using its pixels array
improves performance).
public void setPixels(int channelNumber, FloatProcessor fp)
setPixels
in class ImageProcessor
channelNumber
- Ignored (needed for compatibility with ColorProcessor.toFloat)fp
- The FloatProcessor where the image data are read from.public double maxValue()
maxValue
in class ImageProcessor
public void medianFilter()
medianFilter
in class ImageProcessor
public void erode()
erode
in class ImageProcessor
public void dilate()
dilate
in class ImageProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |