- java.lang.Object
-
- ij.process.ImageProcessor
-
- ij.process.FloatProcessor
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
FHT
public class FloatProcessor extends ImageProcessor
This is an 32-bit floating-point image and methods that operate on that image.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
pixels8
-
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, fillValueSet, FIND_EDGES, fmGraphics, fmImage, font, fontMetrics, gLUT1, gLUT2, height, histogramMax, histogramMin, histogramSize, image, img, interpolate, interpolationMethod, inversionTested, INVERT_PROJECTION, invertedLut, ISODATA, ISODATA2, justification, LEFT_JUSTIFY, lineWidth, lutAnimation, lutUpdateMode, MAX, MAX_PROJECTION, maxThreshold, MEDIAN_FILTER, MIN, MIN_PROJECTION, minMaxSet, minThreshold, NEAREST_NEIGHBOR, newPixels, NO_LUT_UPDATE, NO_THRESHOLD, NONE, OVER_UNDER_LUT, raster, RED_LUT, RIGHT_JUSTIFY, rLUT1, rLUT2, rnd, roiHeight, roiWidth, roiX, roiY, sampleModel, seed, SET_FIRST_CHANNEL, snapshotHeight, snapshotWidth, source, SUM_PROJECTION, UPDATE_BLUE, UPDATE_GREEN, UPDATE_RED, width, xMax, xMin, yMax, yMin
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.java.awt.Image
createImage()
Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255.ByteProcessor
createMask()
Returns a binary mask, or null if a threshold is not set.ImageProcessor
createProcessor(int width, int height)
Returns a new, blank FloatProcessor with the specified width and height.ImageProcessor
crop()
Returns 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()
Returns the background fill value.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.double
getForegroundValue()
Returns the foreground fill/draw value.int[]
getHistogram()
Returns a 256 bin histogram of the current ROI or of the entire image if there is no ROI.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
setBackgroundColor(java.awt.Color color)
Sets the background fill/draw color.void
setBackgroundValue(double value)
Sets the background fill value used by the rotate() and scale() methods.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
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
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'.-
Methods inherited from class ij.process.ImageProcessor
applyMacro, bin, blurGaussian, clone, convertToByte, convertToByteProcessor, convertToByteProcessor, convertToColorProcessor, convertToFloat, convertToFloatProcessor, convertToRGB, convertToShort, convertToShortProcessor, convertToShortProcessor, cubic, draw, drawDot, drawDot2, drawLine, drawLine4, drawOval, drawOverlay, drawPolygon, drawRect, drawRoi, drawString, drawString, drawString, fill, fillOutside, fillOval, fillPolygon, fillRect, fillValueSet, findEdges, flipHorizontal, getAutoThreshold, getAutoThreshold, getBestIndex, getCalibrationTable, getColorModel, getColumn, getColumn, getCurrentColorModel, getDefaultColorModel, getFloatArray, getFont, getFontMetrics, getHeight, getHistogram, 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, getStats, getStringBounds, getStringWidth, getThresholdColorModel, getValue, getWidth, hideProgress, insert, invertLut, isBinary, isColorLut, isDefaultLut, isGrayscale, isInvertedLut, isKillable, isPseudoColorLut, isSigned16Bit, lineTo, ln, makeDefaultColorModel, maskSizeError, moveTo, putColumn, putColumn, putRow, putRow, resetBinaryThreshold, resetRoi, resetThreshold, resize, resize, resizeLinearly, rotateLeft, rotateRight, scaleAndSetThreshold, setAntialiasedText, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setBinaryThreshold, setCalibrationTable, setClipRect, setColor, setColor, setColorModel, setFloatArray, setFont, setFontSize, setGlobalBackgroundColor, setGlobalForegroundColor, setHistogramRange, setHistogramSize, setIntArray, setInterpolate, setInterpolationMethod, setJustification, setLineWidth, setLut, setMask, setOverColor, setOverlay, setProgressBar, setRandomSeed, setRoi, setRoi, setRoi, setRoi, setSliceNumber, setSnapshotCopyMode, setThreshold, setUnderColor, setUseBicubic, sharpen, showProgress, smooth, subtract, toString, translate, translate, updateComposite
-
-
-
-
Constructor Detail
-
FloatProcessor
public FloatProcessor(int width, int height, float[] pixels)
Creates a new FloatProcessor using the specified pixel array.
-
FloatProcessor
public FloatProcessor(int width, int height, float[] pixels, java.awt.image.ColorModel cm)
Creates a new FloatProcessor using the specified pixel array and ColorModel.
-
FloatProcessor
public FloatProcessor(int width, int height)
Creates a blank FloatProcessor using the default grayscale LUT that displays zero as black. Call invertLut() to display zero as white.
-
FloatProcessor
public FloatProcessor(int width, int height, int[] pixels)
Creates a FloatProcessor from an int array using the default grayscale LUT.
-
FloatProcessor
public FloatProcessor(int width, int height, double[] pixels)
Creates a FloatProcessor from a double array using the default grayscale LUT.
-
FloatProcessor
public FloatProcessor(float[][] array)
Creates a FloatProcessor from a 2D float array using the default LUT.
-
FloatProcessor
public FloatProcessor(int[][] array)
Creates a FloatProcessor from a 2D int array.
-
-
Method Detail
-
findMinAndMax
public void findMinAndMax()
Calculates the minimum and maximum pixel value for the entire image. Returns without doing anything if fixedScale has been set true as a result of calling setMinAndMax(). In this case, getMin() and getMax() return the fixed min and max defined by setMinAndMax(), rather than the calculated min and max.
-
setMinAndMax
public 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. Use resetMinAndMax() to enable auto-scaling;- Specified by:
setMinAndMax
in classImageProcessor
- See Also:
ContrastAdjuster
-
resetMinAndMax
public void resetMinAndMax()
Recalculates the min and max values used to scale pixel values to 0-255 for display. This ensures that this FloatProcessor is set up to correctly display the image.- Overrides:
resetMinAndMax
in classImageProcessor
-
getMin
public double getMin()
Returns the smallest displayed pixel value.- Specified by:
getMin
in classImageProcessor
-
getMax
public double getMax()
Returns the largest displayed pixel value.- Specified by:
getMax
in classImageProcessor
-
createImage
public java.awt.Image createImage()
Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255.- Specified by:
createImage
in classImageProcessor
-
getBufferedImage
public java.awt.image.BufferedImage getBufferedImage()
Returns this image as an 8-bit BufferedImage.- Overrides:
getBufferedImage
in classImageProcessor
-
createProcessor
public ImageProcessor createProcessor(int width, int height)
Returns a new, blank FloatProcessor with the specified width and height.- Specified by:
createProcessor
in classImageProcessor
-
snapshot
public void snapshot()
Description copied from class:ImageProcessor
Makes a copy of this image's pixel data that can be later restored using reset() or reset(mask).- Specified by:
snapshot
in classImageProcessor
- See Also:
ImageProcessor.reset()
,ImageProcessor.reset(ImageProcessor)
-
reset
public void reset()
Description copied from class:ImageProcessor
Restores the pixel data from the snapshot (undo) buffer.- Specified by:
reset
in classImageProcessor
-
reset
public void reset(ImageProcessor mask)
Description copied from class:ImageProcessor
Restores pixels from the snapshot buffer that are within the rectangular roi but not part of the mask.- Specified by:
reset
in classImageProcessor
-
swapPixelArrays
public void swapPixelArrays()
Swaps the pixel and snapshot (undo) arrays.- Specified by:
swapPixelArrays
in classImageProcessor
-
setSnapshotPixels
public void setSnapshotPixels(java.lang.Object pixels)
Description copied from class:ImageProcessor
Sets a new pixel array for the snapshot (undo) buffer.- Specified by:
setSnapshotPixels
in classImageProcessor
-
getSnapshotPixels
public java.lang.Object getSnapshotPixels()
Description copied from class:ImageProcessor
Returns a reference to the snapshot (undo) buffer, or null.- Specified by:
getSnapshotPixels
in classImageProcessor
-
getPixel
public int getPixel(int x, int y)
Returns a pixel value that must be converted using Float.intBitsToFloat().- Specified by:
getPixel
in classImageProcessor
- See Also:
ImageProcessor.getValue(int, int)
-
get
public final int get(int x, int y)
Description copied from class:ImageProcessor
This is a faster version of getPixel() that does not do bounds checking.- Specified by:
get
in classImageProcessor
-
set
public final void set(int x, int y, int value)
Description copied from class:ImageProcessor
This is a faster version of putPixel() that does not clip out of range values and does not do bounds checking.- Specified by:
set
in classImageProcessor
-
get
public final int get(int index)
- Specified by:
get
in classImageProcessor
-
set
public final void set(int index, int value)
- Specified by:
set
in classImageProcessor
-
getf
public final float getf(int x, int y)
Description copied from class:ImageProcessor
Returns the value of the pixel at (x,y) as a float. Faster than getPixelValue() but does no bounds checking and does not return calibrated values.- Specified by:
getf
in classImageProcessor
-
setf
public final void setf(int x, int y, float value)
Description copied from class:ImageProcessor
Sets the value of the pixel at (x,y) to 'value'. Does no bounds checking or clamping, making it faster than putPixel(). Due to the lack of bounds checking, (x,y) coordinates outside the image may cause an exception. Due to the lack of clamping, values outside the 0-255 range (for byte) or 0-65535 range (for short) are not handled correctly.- Specified by:
setf
in classImageProcessor
-
getf
public final float getf(int index)
- Specified by:
getf
in classImageProcessor
-
setf
public final void setf(int index, float value)
- Specified by:
setf
in classImageProcessor
-
getPixel
public int[] getPixel(int x, int y, int[] iArray)
Returns the value of the pixel at (x,y) in a one element int array. iArray is an optiona preallocated array.- Overrides:
getPixel
in classImageProcessor
-
putPixel
public final void putPixel(int x, int y, int[] iArray)
Sets a pixel in the image using a one element int array.- Overrides:
putPixel
in classImageProcessor
-
getInterpolatedPixel
public double getInterpolatedPixel(double x, double y)
Uses the current interpolation method (BILINEAR or BICUBIC) to calculate the pixel value at real coordinates (x,y).- Specified by:
getInterpolatedPixel
in classImageProcessor
-
getPixelInterpolated
public final int getPixelInterpolated(double x, double y)
Description copied from class:ImageProcessor
Uses the current interpolation method to find the pixel value at real coordinates (x,y). For RGB images, the argb values are packed in an int. For float images, the value must be converted using Float.intBitsToFloat(). Returns zero if the (x, y) is not inside the image.- Specified by:
getPixelInterpolated
in classImageProcessor
-
putPixel
public final void putPixel(int x, int y, int value)
Stores the specified value at (x,y). The value is expected to be a float that has been converted to an int using Float.floatToIntBits().- Specified by:
putPixel
in classImageProcessor
-
putPixelValue
public void putPixelValue(int x, int y, double value)
Stores the specified real value at (x,y).- Specified by:
putPixelValue
in classImageProcessor
-
getPixelValue
public float getPixelValue(int x, int y)
Returns the value of the pixel at (x,y) as a float.- Specified by:
getPixelValue
in classImageProcessor
- See Also:
ImageProcessor.getPixel(int, int)
,ImageProcessor.getValue(int, int)
,ImageProcessor.getf(int, int)
-
drawPixel
public void drawPixel(int x, int y)
Draws a pixel in the current foreground color.- Specified by:
drawPixel
in classImageProcessor
-
getPixels
public java.lang.Object getPixels()
Returns a reference to the float array containing this image's pixel data.- Specified by:
getPixels
in classImageProcessor
-
getPixelsCopy
public java.lang.Object getPixelsCopy()
Returns a copy of the pixel data. Or returns a reference to the snapshot buffer if it is not null and 'snapshotCopyMode' is true.- Specified by:
getPixelsCopy
in classImageProcessor
- See Also:
ImageProcessor.snapshot()
,ImageProcessor.setSnapshotCopyMode(boolean)
-
setPixels
public void setPixels(java.lang.Object pixels)
Description copied from class:ImageProcessor
Sets a new pixel array for the image. The length of the array must be equal to width*height. Use setSnapshotPixels(null) to clear the snapshot buffer.- Specified by:
setPixels
in classImageProcessor
-
copyBits
public 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.- Specified by:
copyBits
in classImageProcessor
-
applyTable
public void applyTable(int[] lut)
Description copied from class:ImageProcessor
Transforms the image or ROI using a lookup table. The length of the table must be 256 for byte images and 65536 for short images. RGB and float images are not supported.- Specified by:
applyTable
in classImageProcessor
-
invert
public 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().- Overrides:
invert
in classImageProcessor
-
add
public void add(int value)
Description copied from class:ImageProcessor
Adds 'value' to each pixel in the image or ROI.- Overrides:
add
in classImageProcessor
-
add
public void add(double value)
Description copied from class:ImageProcessor
Adds 'value' to each pixel in the image or ROI.- Overrides:
add
in classImageProcessor
-
set
public void set(double value)
Description copied from class:ImageProcessor
Assigns 'value' to each pixel in the image or ROI.- Overrides:
set
in classImageProcessor
-
multiply
public void multiply(double value)
Description copied from class:ImageProcessor
Multiplies each pixel in the image or ROI by 'value'.- Overrides:
multiply
in classImageProcessor
-
and
public void and(int value)
Description copied from class:ImageProcessor
Binary AND of each pixel in the image or ROI with 'value'.- Overrides:
and
in classImageProcessor
-
or
public void or(int value)
Description copied from class:ImageProcessor
Binary OR of each pixel in the image or ROI with 'value'.- Overrides:
or
in classImageProcessor
-
xor
public void xor(int value)
Description copied from class:ImageProcessor
Binary exclusive OR of each pixel in the image or ROI with 'value'.- Overrides:
xor
in classImageProcessor
-
gamma
public void gamma(double value)
Description copied from class:ImageProcessor
Performs gamma correction of the image or ROI.- Overrides:
gamma
in classImageProcessor
-
log
public void log()
Description copied from class:ImageProcessor
Does a natural logarithmic (base e) transform of the image or ROI.- Overrides:
log
in classImageProcessor
-
exp
public void exp()
Description copied from class:ImageProcessor
Performs a exponential transform on the image or ROI.- Overrides:
exp
in classImageProcessor
-
sqr
public void sqr()
Description copied from class:ImageProcessor
Performs a square transform on the image or ROI.- Overrides:
sqr
in classImageProcessor
-
sqrt
public void sqrt()
Description copied from class:ImageProcessor
Performs a square root transform on the image or ROI.- Overrides:
sqrt
in classImageProcessor
-
abs
public void abs()
Description copied from class:ImageProcessor
If this is a 32-bit or signed 16-bit image, performs an absolute value transform, otherwise does nothing.- Overrides:
abs
in classImageProcessor
-
min
public void min(double value)
Description copied from class:ImageProcessor
Pixels less than 'value' are set to 'value'.- Overrides:
min
in classImageProcessor
-
max
public void max(double value)
Description copied from class:ImageProcessor
Pixels greater than 'value' are set to 'value'.- Overrides:
max
in classImageProcessor
-
fill
public void fill()
Fills the current rectangular ROI.- Overrides:
fill
in classImageProcessor
- See Also:
ImageProcessor.setColor(Color)
,ImageProcessor.setValue(double)
,ImageProcessor.fill(Roi)
-
fill
public void fill(ImageProcessor mask)
Fills pixels that are within roi and part of the mask. Does nothing if the mask is not the same as the the ROI.- Specified by:
fill
in classImageProcessor
- See Also:
ImageProcessor.setColor(Color)
,ImageProcessor.setValue(double)
,ImageProcessor.getMask()
,ImageProcessor.fill(Roi)
-
convolve3x3
public void convolve3x3(int[] kernel)
Does 3x3 convolution.- Specified by:
convolve3x3
in classImageProcessor
-
filter
public void filter(int type)
Filters using a 3x3 neighborhood.- Specified by:
filter
in classImageProcessor
-
rotate
public void rotate(double angle)
Rotates the image or ROI 'angle' degrees clockwise.- Specified by:
rotate
in classImageProcessor
- See Also:
ImageProcessor.setInterpolate(boolean)
-
flipVertical
public void flipVertical()
Description copied from class:ImageProcessor
Flips the image or ROI vertically.- Specified by:
flipVertical
in classImageProcessor
-
noise
public void noise(double standardDeviation)
Description copied from class:ImageProcessor
Adds pseudorandom, Gaussian ("normally") distributed values, with mean 0.0 and the specified standard deviation, to this image or ROI.- Specified by:
noise
in classImageProcessor
-
crop
public ImageProcessor crop()
Description copied from class:ImageProcessor
Returns a new processor containing an image that corresponds to the current ROI.- Specified by:
crop
in classImageProcessor
-
duplicate
public ImageProcessor duplicate()
Returns a duplicate of this image.- Specified by:
duplicate
in classImageProcessor
-
scale
public void scale(double xScale, double yScale)
Scales the image or selection using the specified scale factors.- Specified by:
scale
in classImageProcessor
- See Also:
ImageProcessor.setInterpolate(boolean)
-
resize
public ImageProcessor resize(int dstWidth, int dstHeight)
Creates a new FloatProcessor containing a scaled copy of this image or selection.- Specified by:
resize
in classImageProcessor
- See Also:
ImageProcessor.setInterpolate(boolean)
-
getBicubicInterpolatedPixel
public 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/).- Overrides:
getBicubicInterpolatedPixel
in classImageProcessor
-
setColor
public void setColor(java.awt.Color color)
Sets the foreground fill/draw color.- Specified by:
setColor
in classImageProcessor
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Sets the background fill/draw color.- Overrides:
setBackgroundColor
in classImageProcessor
-
setValue
public void setValue(double value)
Sets the default fill/draw value.- Specified by:
setValue
in classImageProcessor
-
getForegroundValue
public double getForegroundValue()
Returns the foreground fill/draw value.- Specified by:
getForegroundValue
in classImageProcessor
-
setBackgroundValue
public void setBackgroundValue(double value)
Description copied from class:ImageProcessor
Sets the background fill value used by the rotate() and scale() methods.- Specified by:
setBackgroundValue
in classImageProcessor
-
getBackgroundValue
public double getBackgroundValue()
Description copied from class:ImageProcessor
Returns the background fill value.- Specified by:
getBackgroundValue
in classImageProcessor
-
setLutAnimation
public void setLutAnimation(boolean lutAnimation)
Description copied from class:ImageProcessor
For 16 and 32 bit processors, set 'lutAnimation' true to have createImage() use the cached 8-bit version of the image.- Overrides:
setLutAnimation
in classImageProcessor
-
setThreshold
public void setThreshold(double minThreshold, double maxThreshold, int lutUpdate)
Description copied from class:ImageProcessor
Sets the lower and upper threshold levels. The 'lutUpdate' argument can be RED_LUT, BLACK_AND_WHITE_LUT, OVER_UNDER_LUT or NO_LUT_UPDATE. Thresholding of RGB images is not supported.- Overrides:
setThreshold
in classImageProcessor
-
convolve
public void convolve(float[] kernel, int kernelWidth, int kernelHeight)
Performs a convolution operation using the specified kernel.- Specified by:
convolve
in classImageProcessor
-
getHistogram
public int[] getHistogram()
Returns a 256 bin histogram of the current ROI or of the entire image if there is no ROI.- Specified by:
getHistogram
in classImageProcessor
-
threshold
public void threshold(int level)
Not implemented.- Specified by:
threshold
in classImageProcessor
-
autoThreshold
public void autoThreshold()
Not implemented.- Overrides:
autoThreshold
in classImageProcessor
-
medianFilter
public void medianFilter()
Not implemented.- Specified by:
medianFilter
in classImageProcessor
-
erode
public void erode()
Not implemented.- Specified by:
erode
in classImageProcessor
-
dilate
public void dilate()
Not implemented.- Specified by:
dilate
in classImageProcessor
-
toFloat
public FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
Returns this FloatProcessor.- Specified by:
toFloat
in classImageProcessor
- Parameters:
channelNumber
- Ignored (needed for compatibility with ColorProcessor.toFloat)fp
- Ignored (needed for compatibility with the other ImageProcessor types).- Returns:
- This FloatProcessor
-
setPixels
public void setPixels(int channelNumber, FloatProcessor fp)
Sets the pixels, and min&max values from a FloatProcessor. Also the values are taken from the FloatProcessor.- Specified by:
setPixels
in classImageProcessor
- Parameters:
channelNumber
- Ignored (needed for compatibility with ColorProcessor.toFloat)fp
- The FloatProcessor where the image data are read from.
-
minValue
public double minValue()
Returns the smallest possible positive nonzero pixel value.- Overrides:
minValue
in classImageProcessor
-
maxValue
public double maxValue()
Returns the largest possible positive finite pixel value.- Overrides:
maxValue
in classImageProcessor
-
getBitDepth
public int getBitDepth()
Description copied from class:ImageProcessor
Returns the bit depth, 8, 16, 24 (RGB) or 32. RGB images actually use 32 bits per pixel.- Overrides:
getBitDepth
in classImageProcessor
-
createMask
public ByteProcessor createMask()
Returns a binary mask, or null if a threshold is not set.- Overrides:
createMask
in classImageProcessor
- See Also:
ImagePlus.createThresholdMask()
,ImagePlus.createRoiMask()
-
-