public class FloatProcessor extends ImageProcessor
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
pixels8 |
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 and Description |
|---|
FloatProcessor(float[][] array)
Creates a FloatProcessor from a 2D float array using the default LUT.
|
FloatProcessor(int[][] array)
Creates a FloatProcessor from a 2D int array.
|
FloatProcessor(int width,
int height)
Creates a blank FloatProcessor using the default grayscale LUT that
displays zero as black.
|
FloatProcessor(int width,
int height,
double[] pixels)
Creates a FloatProcessor from a double array using the default grayscale LUT.
|
FloatProcessor(int width,
int height,
float[] pixels)
Creates a new FloatProcessor using the specified pixel array.
|
FloatProcessor(int width,
int height,
float[] pixels,
java.awt.image.ColorModel cm)
Creates a new FloatProcessor using the specified pixel array and ColorModel.
|
FloatProcessor(int width,
int height,
int[] pixels)
Creates a FloatProcessor from an int array using the default grayscale LUT.
|
| Modifier and Type | Method and Description |
|---|---|
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 image or ROI using a lookup table.
|
void |
autoThreshold()
Not implemented.
|
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.
|
protected byte[] |
create8BitImage() |
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 FloatProcessor 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()
Calculates the minimum and maximum pixel value for the entire image.
|
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.
|
double |
getBackgroundValue()
Always returns 0.
|
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/).
|
int |
getBitDepth()
Returns the bit depth, 8, 16, 24 (RGB) or 32.
|
java.awt.image.BufferedImage |
getBufferedImage()
Returns this image as an 8-bit BufferedImage.
|
float |
getf(int index) |
float |
getf(int x,
int y)
Returns the value of the pixel at (x,y) as a float.
|
int[] |
getHistogram()
Not implemented.
|
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 a pixel value that must be converted using
Float.intBitsToFloat().
|
int[] |
getPixel(int x,
int y,
int[] iArray)
Returns the value of the pixel at (x,y) in a
one element int array.
|
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 float 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()
Each pixel in the image is inverted using p=max-(p-min), where 'min'
and 'max' are the display range limits set using setMinAndMax().
|
void |
log()
Does a natural logarithmic (base e) transform of the image or ROI.
|
void |
max(double value)
Pixels greater than 'value' are set to 'value'.
|
double |
maxValue()
Returns the largest possible positive finite pixel value.
|
void |
medianFilter()
Not implemented.
|
void |
min(double value)
Pixels less than 'value' are set to 'value'.
|
double |
minValue()
Returns the smallest possible positive nonzero pixel value.
|
void |
multiply(double value)
Multiplies each pixel in the image or ROI by 'value'.
|
void |
noise(double standardDeviation)
Adds pseudorandom, Gaussian ("normally") distributed values, with
mean 0.0 and the specified standard deviation, to this 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 |
putPixel(int x,
int y,
int[] iArray)
Sets a pixel in the image using a one element int array.
|
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 FloatProcessor 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(double value)
Assigns 'value' to each pixel in the image or ROI.
|
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)
Sets the value of the pixel at (x,y) to '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, and min&max values from a FloatProcessor.
|
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.
|
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 |
swapPixelArrays()
Swaps the pixel and snapshot (undo) arrays.
|
void |
threshold(int level)
Not implemented.
|
FloatProcessor |
toFloat(int channelNumber,
FloatProcessor fp)
Returns this FloatProcessor.
|
void |
xor(int value)
Binary exclusive OR of each pixel in the image or ROI with 'value'.
|
applyMacro, bin, blurGaussian, clone, convertToByte, convertToByteProcessor, convertToByteProcessor, convertToColorProcessor, convertToFloat, convertToFloatProcessor, convertToRGB, convertToShort, convertToShortProcessor, convertToShortProcessor, cubic, draw, drawDot, drawDot2, drawLine, drawOval, drawOverlay, drawPolygon, drawRect, drawRoi, drawString, drawString, drawString, fill, fillOutside, fillOval, fillPolygon, findEdges, flipHorizontal, getAutoThreshold, getAutoThreshold, getBestIndex, getCalibrationTable, getColorModel, getColumn, getCurrentColorModel, getDefaultColorModel, getFloatArray, getFont, getFontMetrics, getHeight, getHistogramMax, getHistogramMin, getHistogramSize, getIndexSampleModel, getIntArray, getInterpolate, getInterpolatedValue, getInterpolationMethod, getInterpolationMethods, getLine, getLineWidth, getLut, getLutUpdateMode, getMask, getMaskArray, getMaxThreshold, getMinThreshold, getNChannels, getNeighborhood, getOverlay, getPixelCount, getProgressIncrement, getRoi, getRow, getRow, getSliceNumber, getStatistics, getStringWidth, getWidth, hideProgress, insert, invertLut, isBinary, isColorLut, isDefaultLut, isGrayscale, isInvertedLut, isKillable, isPseudoColorLut, lineTo, ln, makeDefaultColorModel, maskSizeError, moveTo, putColumn, putRow, putRow, resetBinaryThreshold, resetRoi, resetThreshold, resize, resize, resizeLinearly, rotateLeft, rotateRight, setAntialiasedText, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setBinaryThreshold, setCalibrationTable, setClipRect, setColor, setColor, setColorModel, setFloatArray, setFont, setHistogramRange, setHistogramSize, setIntArray, setInterpolate, setInterpolationMethod, setJustification, setLineWidth, setLut, setLutAnimation, setMask, setOverColor, setOverlay, setProgressBar, setRoi, setRoi, setRoi, setRoi, setSliceNumber, setSnapshotCopyMode, setUnderColor, setUseBicubic, sharpen, showProgress, smooth, subtract, toString, translate, translate, updateCompositepublic FloatProcessor(int width,
int height,
float[] pixels)
public FloatProcessor(int width,
int height,
float[] pixels,
java.awt.image.ColorModel cm)
public FloatProcessor(int width,
int height)
public FloatProcessor(int width,
int height,
int[] pixels)
public FloatProcessor(int width,
int height,
double[] pixels)
public FloatProcessor(float[][] array)
public FloatProcessor(int[][] array)
public void findMinAndMax()
public void setMinAndMax(double minimum,
double maximum)
setMinAndMax in class ImageProcessorContrastAdjusterpublic void resetMinAndMax()
resetMinAndMax in class ImageProcessorpublic double getMin()
getMin in class ImageProcessorpublic double getMax()
getMax in class ImageProcessorpublic java.awt.Image createImage()
createImage in class ImageProcessorprotected byte[] create8BitImage()
public java.awt.image.BufferedImage getBufferedImage()
getBufferedImage in class ImageProcessorpublic ImageProcessor createProcessor(int width, int height)
createProcessor in class ImageProcessorpublic void snapshot()
ImageProcessorsnapshot in class ImageProcessorImageProcessor.reset(),
ImageProcessor.reset(ImageProcessor)public void reset()
ImageProcessorreset in class ImageProcessorpublic void reset(ImageProcessor mask)
ImageProcessorreset in class ImageProcessorpublic void swapPixelArrays()
swapPixelArrays in class ImageProcessorpublic void setSnapshotPixels(java.lang.Object pixels)
ImageProcessorsetSnapshotPixels in class ImageProcessorpublic java.lang.Object getSnapshotPixels()
ImageProcessorgetSnapshotPixels in class ImageProcessorpublic int getPixel(int x,
int y)
getPixel in class ImageProcessorpublic final int get(int x,
int y)
ImageProcessorget in class ImageProcessorpublic final void set(int x,
int y,
int value)
ImageProcessorset in class ImageProcessorpublic final int get(int index)
get in class ImageProcessorpublic final void set(int index,
int value)
set in class ImageProcessorpublic final float getf(int x,
int y)
ImageProcessorgetf in class ImageProcessorpublic final void setf(int x,
int y,
float value)
ImageProcessorsetf in class ImageProcessorpublic final float getf(int index)
getf in class ImageProcessorpublic final void setf(int index,
float value)
setf in class ImageProcessorpublic int[] getPixel(int x,
int y,
int[] iArray)
getPixel in class ImageProcessorpublic final void putPixel(int x,
int y,
int[] iArray)
putPixel in class ImageProcessorpublic double getInterpolatedPixel(double x,
double y)
getInterpolatedPixel in class ImageProcessorpublic final int getPixelInterpolated(double x,
double y)
ImageProcessorgetPixelInterpolated in class ImageProcessorpublic final void putPixel(int x,
int y,
int value)
putPixel in class ImageProcessorpublic void putPixelValue(int x,
int y,
double value)
putPixelValue in class ImageProcessorpublic float getPixelValue(int x,
int y)
getPixelValue in class ImageProcessorpublic void drawPixel(int x,
int y)
drawPixel in class ImageProcessorpublic java.lang.Object getPixels()
getPixels in class ImageProcessorpublic java.lang.Object getPixelsCopy()
getPixelsCopy in class ImageProcessorImageProcessor.snapshot(),
ImageProcessor.setSnapshotCopyMode(boolean)public void setPixels(java.lang.Object pixels)
ImageProcessorsetPixels in class ImageProcessorpublic void copyBits(ImageProcessor ip, int xloc, int yloc, int mode)
copyBits in class ImageProcessorpublic void applyTable(int[] lut)
ImageProcessorapplyTable in class ImageProcessorpublic void invert()
invert in class ImageProcessorpublic void add(int value)
ImageProcessoradd in class ImageProcessorpublic void add(double value)
ImageProcessoradd in class ImageProcessorpublic void set(double value)
ImageProcessorset in class ImageProcessorpublic void multiply(double value)
ImageProcessormultiply in class ImageProcessorpublic void and(int value)
ImageProcessorand in class ImageProcessorpublic void or(int value)
ImageProcessoror in class ImageProcessorpublic void xor(int value)
ImageProcessorxor in class ImageProcessorpublic void gamma(double value)
ImageProcessorgamma in class ImageProcessorpublic void log()
ImageProcessorlog in class ImageProcessorpublic void exp()
ImageProcessorexp in class ImageProcessorpublic void sqr()
ImageProcessorsqr in class ImageProcessorpublic void sqrt()
ImageProcessorsqrt in class ImageProcessorpublic void abs()
ImageProcessorabs in class ImageProcessorpublic void min(double value)
ImageProcessormin in class ImageProcessorpublic void max(double value)
ImageProcessormax in class ImageProcessorpublic void fill()
fill in class ImageProcessorImageProcessor.setColor(Color),
ImageProcessor.setValue(double),
ImageProcessor.fill(Roi)public void fill(ImageProcessor mask)
fill in class ImageProcessorImageProcessor.setColor(Color),
ImageProcessor.setValue(double),
ImageProcessor.getMask(),
ImageProcessor.fill(Roi)public void convolve3x3(int[] kernel)
convolve3x3 in class ImageProcessorpublic void filter(int type)
filter in class ImageProcessorpublic void rotate(double angle)
rotate in class ImageProcessorImageProcessor.setInterpolate(boolean)public void flipVertical()
ImageProcessorflipVertical in class ImageProcessorpublic void noise(double standardDeviation)
ImageProcessornoise in class ImageProcessorpublic ImageProcessor crop()
ImageProcessorcrop in class ImageProcessorpublic ImageProcessor duplicate()
duplicate in class ImageProcessorpublic void scale(double xScale,
double yScale)
scale in class ImageProcessorImageProcessor.setInterpolate(boolean)public ImageProcessor resize(int dstWidth, int dstHeight)
resize in class ImageProcessorImageProcessor.setInterpolate(boolean)public double getBicubicInterpolatedPixel(double x0,
double y0,
ImageProcessor ip2)
getBicubicInterpolatedPixel in class ImageProcessorpublic void setColor(java.awt.Color color)
setColor in class ImageProcessorpublic void setValue(double value)
setValue in class ImageProcessorpublic void setBackgroundValue(double value)
setBackgroundValue in class ImageProcessorpublic double getBackgroundValue()
getBackgroundValue in class ImageProcessorpublic void setThreshold(double minThreshold,
double maxThreshold,
int lutUpdate)
ImageProcessorsetThreshold in class ImageProcessorpublic void convolve(float[] kernel,
int kernelWidth,
int kernelHeight)
convolve in class ImageProcessorpublic void threshold(int level)
threshold in class ImageProcessorpublic void autoThreshold()
autoThreshold in class ImageProcessorpublic void medianFilter()
medianFilter in class ImageProcessorpublic int[] getHistogram()
getHistogram in class ImageProcessorpublic void erode()
erode in class ImageProcessorpublic void dilate()
dilate in class ImageProcessorpublic FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
toFloat in class ImageProcessorchannelNumber - Ignored (needed for compatibility with ColorProcessor.toFloat)fp - Ignored (needed for compatibility with the other ImageProcessor types).public void setPixels(int channelNumber,
FloatProcessor fp)
setPixels in class ImageProcessorchannelNumber - Ignored (needed for compatibility with ColorProcessor.toFloat)fp - The FloatProcessor where the image data are read from.public double minValue()
minValue in class ImageProcessorpublic double maxValue()
maxValue in class ImageProcessorpublic int getBitDepth()
ImageProcessorgetBitDepth in class ImageProcessor