- java.lang.Object
-
- ij.process.ImageProcessor
-
- ij.process.ByteProcessor
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
BinaryProcessor
public class ByteProcessor extends ImageProcessor
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
Fields Modifier and Type Field Description protected byte[]pixelsprotected byte[]snapshotPixels-
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 ByteProcessor(int width, int height)Creates a blank ByteProcessor of the specified dimensions.ByteProcessor(int width, int height, byte[] pixels)Creates a ByteProcessor from a byte array.ByteProcessor(int width, int height, byte[] pixels, java.awt.image.ColorModel cm)Creates a ByteProcessor from a pixel array and IndexColorModel.ByteProcessor(ImageProcessor ip, boolean scale)Creates a ByteProcessor from an ImageProcessor.ByteProcessor(java.awt.Image img)Creates a ByteProcessor from an AWT Image.ByteProcessor(java.awt.image.BufferedImage bi)Creates a ByteProcessor from a TYPE_BYTE_GRAY BufferedImage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyLut()voidapplyTable(int[] lut)Transforms the image or ROI using a lookup table.voidconvolve(float[] kernel, int kernelWidth, int kernelHeight)Performs a convolution operation using the specified kernel.voidconvolve3x3(int[] kernel)Convolves the image or ROI with the specified 3x3 integer convolution kernel.voidcopyBits(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.ImagecreateImage()Returns a copy of this image is the form of an AWT Image.ByteProcessorcreateMask()Returns a binary mask, or null if a threshold is not set.ImageProcessorcreateProcessor(int width, int height)Returns a new, blank ByteProcessor with the specified width and height.ImageProcessorcrop()Returns a new processor containing an image that corresponds to the current ROI.voiddilate()Dilates the image or ROI using a 3x3 minimum filter.voiddilate(int count, int background)voiddrawPixel(int x, int y)Draws a pixel in the current foreground color.ImageProcessorduplicate()Returns a duplicate of this image.voiderode()Erodes the image or ROI using a 3x3 maximum filter.voiderode(int count, int background)voidfill(ImageProcessor mask)Sets pixels that are within roi and part of the mask to the foreground color.voidfilter(int type)Filters using a 3x3 neighborhood.voidflipVertical()Flips the image or ROI vertically.intget(int index)intget(int x, int y)This is a faster version of getPixel() that does not do bounds checking.doublegetBackgroundValue()Returns the background fill value.intgetBitDepth()Returns the bit depth, 8, 16, 24 (RGB) or 32.java.awt.image.BufferedImagegetBufferedImage()Returns this image as a BufferedImage.floatgetf(int index)floatgetf(int x, int y)Returns the value of the pixel at (x,y) as a float.doublegetForegroundValue()Returns the foreground fill/draw value.int[]getHistogram()Returns the histogram of the image or ROI.int[]getHistogram(ImageProcessor mask)doublegetInterpolatedPixel(double x, double y)Uses the current interpolation method (BILINEAR or BICUBIC) to calculate the pixel value at real coordinates (x,y).doublegetMax()Returns the largest displayed pixel value.doublegetMin()Returns the smallest displayed pixel value.intgetPixel(int x, int y)Returns the value of the pixel at (x,y).intgetPixelInterpolated(double x, double y)Uses the current interpolation method to find the pixel value at real coordinates (x,y).java.lang.ObjectgetPixels()Returns a reference to the byte array containing this image's pixel data.java.lang.ObjectgetPixelsCopy()Returns a copy of the pixel data.floatgetPixelValue(int x, int y)Returns the value of the pixel at (x,y).java.lang.ObjectgetSnapshotPixels()Returns a reference to the snapshot (undo) buffer, or null.booleanisBinary()Returns 'true' if this is a binary image (8-bit-image with only 0 and 255).voidmedianFilter()A 3x3 median filter.voidnoise(double standardDeviation)Adds pseudorandom, Gaussian ("normally") distributed values, with mean 0.0 and the specified standard deviation, to this image or ROI.voidoutline()voidputPixel(int x, int y, int value)Stores the specified value at (x,y).voidputPixelValue(int x, int y, double value)Stores the specified real value at (x,y).voidreset()Reset the image from snapshot.voidreset(ImageProcessor mask)Restore pixels that are within roi but not part of mask.voidresetMinAndMax()Resets this image's LUT.ImageProcessorresize(int dstWidth, int dstHeight)Creates a new ByteProcessor containing a scaled copy of this image or selection.voidrotate(double angle)Rotates the image or ROI 'angle' degrees clockwise.voidscale(double xScale, double yScale)Scales the image or selection using the specified scale factors.voidset(int index, int value)voidset(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.voidsetBackgroundColor(java.awt.Color color)Sets the background fill/draw color.voidsetBackgroundValue(double value)Sets the background fill value, where 0<=value<=255.voidsetColor(java.awt.Color color)Sets the foreground drawing color.voidsetf(int index, float value)voidsetf(int x, int y, float value)Sets the value of the pixel at (x,y) to 'value'.voidsetFromFloatArrays(float[][] arrays)voidsetFromFloatProcessors(FloatProcessor[] fp)voidsetMinAndMax(double min, double max)Maps the entries in this image's LUT from min-max to 0-255.voidsetPixels(int channelNumber, FloatProcessor fp)Sets the pixels from a FloatProcessor, no scaling.voidsetPixels(java.lang.Object pixels)Sets a new pixel array for the image.voidsetSnapshotPixels(java.lang.Object pixels)Sets a new pixel array for the snapshot (undo) buffer.voidsetThreshold(double minThreshold, double maxThreshold, int lutUpdate)Sets the lower and upper threshold levels.voidsetValue(double value)Sets the default fill/draw value, where 0<=value<=255.voidskeletonize()Converts black objects in a binary image to single pixel skeletons.voidskeletonize(int foreground)Converts objects with pixel values of 'forground' (255 or 0) in a binary imager to single pixel skeletons.voidsnapshot()Make a snapshot of the current image.voidswapPixelArrays()Swaps the pixel and snapshot (undo) arrays.voidthreshold(int level)Sets pixels less than or equal to 'level' to 0 and all other pixels to 255.voidthreshold(int level1, int level2)Sets pixels less than 'level1' or greater than 'level2' to 0 and all other pixels to 255.FloatProcessortoFloat(int channelNumber, FloatProcessor fp)Returns a FloatProcessor with the same image, no scaling or calibration (pixel values 0 to 255).float[][]toFloatArrays()FloatProcessor[]toFloatProcessors()-
Methods inherited from class ij.process.ImageProcessor
abs, add, add, and, applyMacro, autoThreshold, 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, exp, fill, fill, fillOutside, fillOval, fillPolygon, fillRect, fillValueSet, findEdges, flipHorizontal, gamma, getAutoThreshold, getAutoThreshold, getBestIndex, getBicubicInterpolatedPixel, 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, getPixel, getPixelCount, getProgressIncrement, getRoi, getRow, getRow, getSliceNumber, getStatistics, getStats, getStringBounds, getStringWidth, getThresholdColorModel, getValue, getWidth, hideProgress, insert, invert, invertLut, isColorLut, isDefaultLut, isGrayscale, isInvertedLut, isKillable, isPseudoColorLut, isSigned16Bit, isThreshold, lineTo, ln, log, makeDefaultColorModel, maskSizeError, max, maxValue, min, minValue, moveTo, multiply, or, putColumn, putColumn, putPixel, putRow, putRow, resetBinaryThreshold, resetRoi, resetThreshold, resize, resize, resizeLinearly, rotateLeft, rotateRight, scaleAndSetThreshold, set, setAntialiasedText, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setAutoThreshold, setBinaryThreshold, setCalibrationTable, setClipRect, setColor, setColor, setColor, setColorModel, setFloatArray, setFont, setFontSize, setGlobalBackgroundColor, setGlobalForegroundColor, setHistogramRange, setHistogramSize, setIntArray, setInterpolate, setInterpolationMethod, setJustification, setLineWidth, setLut, setLutAnimation, setMask, setOverColor, setOverlay, setProgressBar, setRandomSeed, setRoi, setRoi, setRoi, setRoi, setSliceNumber, setSnapshotCopyMode, setThreshold, setUnderColor, setUseBicubic, sharpen, showProgress, smooth, sqr, sqrt, subtract, toString, translate, translate, updateComposite, xor
-
-
-
-
Constructor Detail
-
ByteProcessor
public ByteProcessor(java.awt.Image img)
Creates a ByteProcessor from an AWT Image.
-
ByteProcessor
public ByteProcessor(int width, int height)Creates a blank ByteProcessor of the specified dimensions.
-
ByteProcessor
public ByteProcessor(int width, int height, byte[] pixels)Creates a ByteProcessor from a byte array.
-
ByteProcessor
public ByteProcessor(int width, int height, byte[] pixels, java.awt.image.ColorModel cm)Creates a ByteProcessor from a pixel array and IndexColorModel.
-
ByteProcessor
public ByteProcessor(java.awt.image.BufferedImage bi)
Creates a ByteProcessor from a TYPE_BYTE_GRAY BufferedImage.
-
ByteProcessor
public ByteProcessor(ImageProcessor ip, boolean scale)
Creates a ByteProcessor from an ImageProcessor. 16-bit and 32-bit pixel data are scaled from min-max to 0-255 if 'scale' is true.
-
-
Method Detail
-
createImage
public java.awt.Image createImage()
Description copied from class:ImageProcessorReturns a copy of this image is the form of an AWT Image.- Specified by:
createImagein classImageProcessor
-
getBufferedImage
public java.awt.image.BufferedImage getBufferedImage()
Returns this image as a BufferedImage.- Overrides:
getBufferedImagein classImageProcessor
-
createProcessor
public ImageProcessor createProcessor(int width, int height)
Returns a new, blank ByteProcessor with the specified width and height.- Specified by:
createProcessorin classImageProcessor
-
crop
public ImageProcessor crop()
Description copied from class:ImageProcessorReturns a new processor containing an image that corresponds to the current ROI.- Specified by:
cropin classImageProcessor
-
duplicate
public ImageProcessor duplicate()
Returns a duplicate of this image.- Specified by:
duplicatein classImageProcessor
-
snapshot
public void snapshot()
Make a snapshot of the current image.- Specified by:
snapshotin classImageProcessor- See Also:
ImageProcessor.reset(),ImageProcessor.reset(ImageProcessor)
-
reset
public void reset()
Reset the image from snapshot.- Specified by:
resetin classImageProcessor
-
swapPixelArrays
public void swapPixelArrays()
Swaps the pixel and snapshot (undo) arrays.- Specified by:
swapPixelArraysin classImageProcessor
-
reset
public void reset(ImageProcessor mask)
Restore pixels that are within roi but not part of mask.- Specified by:
resetin classImageProcessor
-
setSnapshotPixels
public void setSnapshotPixels(java.lang.Object pixels)
Description copied from class:ImageProcessorSets a new pixel array for the snapshot (undo) buffer.- Specified by:
setSnapshotPixelsin classImageProcessor
-
getSnapshotPixels
public java.lang.Object getSnapshotPixels()
Description copied from class:ImageProcessorReturns a reference to the snapshot (undo) buffer, or null.- Specified by:
getSnapshotPixelsin classImageProcessor
-
fill
public void fill(ImageProcessor mask)
Sets pixels that are within roi and part of the mask to the foreground color. Does nothing if the mask is not the same size as the ROI.- Specified by:
fillin classImageProcessor- See Also:
ImageProcessor.setColor(Color),ImageProcessor.setValue(double),ImageProcessor.getMask(),ImageProcessor.fill(Roi)
-
getPixel
public int getPixel(int x, int y)Description copied from class:ImageProcessorReturns the value of the pixel at (x,y). For RGB images, the argb values are packed in an int. For float images, the the value must be converted using Float.intBitsToFloat(). Returns zero if either the x or y coodinate is out of range. Use getValue(x,y) to get calibrated values from 8-bit and 16-bit images, to get intensity values from RGB images and to get float values from 32-bit images.- Specified by:
getPixelin classImageProcessor- See Also:
ImageProcessor.getValue(int, int)
-
get
public final int get(int x, int y)Description copied from class:ImageProcessorThis is a faster version of getPixel() that does not do bounds checking.- Specified by:
getin classImageProcessor
-
set
public final void set(int x, int y, int value)Description copied from class:ImageProcessorThis is a faster version of putPixel() that does not clip out of range values and does not do bounds checking.- Specified by:
setin classImageProcessor
-
get
public final int get(int index)
- Specified by:
getin classImageProcessor
-
set
public final void set(int index, int value)- Specified by:
setin classImageProcessor
-
getf
public final float getf(int x, int y)Description copied from class:ImageProcessorReturns 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:
getfin classImageProcessor
-
setf
public final void setf(int x, int y, float value)Description copied from class:ImageProcessorSets 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:
setfin classImageProcessor
-
getf
public final float getf(int index)
- Specified by:
getfin classImageProcessor
-
setf
public final void setf(int index, float value)- Specified by:
setfin 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:
getInterpolatedPixelin classImageProcessor
-
getPixelInterpolated
public final int getPixelInterpolated(double x, double y)Description copied from class:ImageProcessorUses 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:
getPixelInterpolatedin classImageProcessor
-
getPixelValue
public float getPixelValue(int x, int y)Description copied from class:ImageProcessorReturns the value of the pixel at (x,y). For byte and short images, returns a calibrated value if a calibration table has been set using setCalibraionTable(). For RGB images, returns the luminance value.- Specified by:
getPixelValuein classImageProcessor- See Also:
ImageProcessor.getPixel(int, int),ImageProcessor.getValue(int, int),ImageProcessor.getf(int, int)
-
setColor
public void setColor(java.awt.Color color)
Sets the foreground drawing color.- Specified by:
setColorin classImageProcessor
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Sets the background fill/draw color.- Overrides:
setBackgroundColorin classImageProcessor
-
setValue
public void setValue(double value)
Sets the default fill/draw value, where 0<=value<=255.- Specified by:
setValuein classImageProcessor
-
getForegroundValue
public double getForegroundValue()
Returns the foreground fill/draw value.- Specified by:
getForegroundValuein classImageProcessor
-
setBackgroundValue
public void setBackgroundValue(double value)
Sets the background fill value, where 0<=value<=255.- Specified by:
setBackgroundValuein classImageProcessor
-
getBackgroundValue
public double getBackgroundValue()
Returns the background fill value.- Specified by:
getBackgroundValuein classImageProcessor
-
putPixelValue
public void putPixelValue(int x, int y, double value)Stores the specified real value at (x,y). Does nothing if (x,y) is outside the image boundary. Values outside the range 0-255 are clamped.- Specified by:
putPixelValuein classImageProcessor
-
putPixel
public final void putPixel(int x, int y, int value)Stores the specified value at (x,y). Does nothing if (x,y) is outside the image boundary. Values outside the range 0-255 are clamped.- Specified by:
putPixelin classImageProcessor
-
drawPixel
public void drawPixel(int x, int y)Draws a pixel in the current foreground color.- Specified by:
drawPixelin classImageProcessor
-
getPixels
public java.lang.Object getPixels()
Returns a reference to the byte array containing this image's pixel data. To avoid sign extension, the pixel values must be accessed using a mask (e.g. int i = pixels[j]&0xff).- Specified by:
getPixelsin 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:
getPixelsCopyin classImageProcessor- See Also:
ImageProcessor.snapshot(),ImageProcessor.setSnapshotCopyMode(boolean)
-
setPixels
public void setPixels(java.lang.Object pixels)
Description copied from class:ImageProcessorSets 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:
setPixelsin classImageProcessor
-
getMin
public double getMin()
Returns the smallest displayed pixel value.- Specified by:
getMinin classImageProcessor
-
getMax
public double getMax()
Returns the largest displayed pixel value.- Specified by:
getMaxin classImageProcessor
-
setMinAndMax
public void setMinAndMax(double min, double max)Maps the entries in this image's LUT from min-max to 0-255.- Specified by:
setMinAndMaxin classImageProcessor- See Also:
IJ.setMinAndMax(ij.ImagePlus,double,double)
-
resetMinAndMax
public void resetMinAndMax()
Resets this image's LUT.- Overrides:
resetMinAndMaxin classImageProcessor
-
setThreshold
public void setThreshold(double minThreshold, double maxThreshold, int lutUpdate)Description copied from class:ImageProcessorSets 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:
setThresholdin 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:
copyBitsin classImageProcessor
-
applyTable
public void applyTable(int[] lut)
Description copied from class:ImageProcessorTransforms 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:
applyTablein classImageProcessor
-
convolve3x3
public void convolve3x3(int[] kernel)
Description copied from class:ImageProcessorConvolves the image or ROI with the specified 3x3 integer convolution kernel.- Specified by:
convolve3x3in classImageProcessor
-
filter
public void filter(int type)
Filters using a 3x3 neighborhood. The p1, p2, etc variables, which contain the values of the pixels in the neighborhood, are arranged as follows:p1 p2 p3 p4 p5 p6 p7 p8 p9- Specified by:
filterin classImageProcessor
-
erode
public void erode()
Description copied from class:ImageProcessorErodes the image or ROI using a 3x3 maximum filter. Requires 8-bit or RGB image.- Specified by:
erodein classImageProcessor
-
dilate
public void dilate()
Description copied from class:ImageProcessorDilates the image or ROI using a 3x3 minimum filter. Requires 8-bit or RGB image.- Specified by:
dilatein classImageProcessor
-
erode
public void erode(int count, int background)
-
dilate
public void dilate(int count, int background)
-
outline
public void outline()
-
skeletonize
public void skeletonize()
Converts black objects in a binary image to single pixel skeletons.
-
skeletonize
public void skeletonize(int foreground)
Converts objects with pixel values of 'forground' (255 or 0) in a binary imager to single pixel skeletons.
-
medianFilter
public void medianFilter()
Description copied from class:ImageProcessorA 3x3 median filter. Requires 8-bit or RGB image.- Specified by:
medianFilterin classImageProcessor
-
noise
public void noise(double standardDeviation)
Adds pseudorandom, Gaussian ("normally") distributed values, with mean 0.0 and the specified standard deviation, to this image or ROI.- Specified by:
noisein classImageProcessor
-
scale
public void scale(double xScale, double yScale)Scales the image or selection using the specified scale factors.- Specified by:
scalein classImageProcessor- See Also:
ImageProcessor.setInterpolate(boolean)
-
resize
public ImageProcessor resize(int dstWidth, int dstHeight)
Creates a new ByteProcessor containing a scaled copy of this image or selection.- Specified by:
resizein classImageProcessor- See Also:
ImageProcessor.setInterpolate(boolean)
-
rotate
public void rotate(double angle)
Rotates the image or ROI 'angle' degrees clockwise.- Specified by:
rotatein classImageProcessor- See Also:
ImageProcessor.setInterpolationMethod(int)
-
flipVertical
public void flipVertical()
Description copied from class:ImageProcessorFlips the image or ROI vertically.- Specified by:
flipVerticalin classImageProcessor
-
getHistogram
public int[] getHistogram()
Description copied from class:ImageProcessorReturns the histogram of the image or ROI. Returns a luminosity histogram for RGB images and null for float images.For 8-bit and 16-bit images, returns an array with one entry for each possible value that a pixel can have, from 0 to 255 (8-bit image) or 0-65535 (16-bit image). Thus, the array size is 256 or 65536, and the bin width in uncalibrated units is 1.
For RGB images, the brightness is evaluated using the color weights (which would result in a float value) and rounded to an int. This gives 256 bins. FloatProcessor.getHistogram is not implemented (returns null).
- Specified by:
getHistogramin classImageProcessor
-
getHistogram
public int[] getHistogram(ImageProcessor mask)
-
threshold
public void threshold(int level1, int level2)Sets pixels less than 'level1' or greater than 'level2' to 0 and all other pixels to 255.- Overrides:
thresholdin classImageProcessor
-
threshold
public void threshold(int level)
Sets pixels less than or equal to 'level' to 0 and all other pixels to 255.- Specified by:
thresholdin classImageProcessor
-
applyLut
public void applyLut()
-
convolve
public void convolve(float[] kernel, int kernelWidth, int kernelHeight)Performs a convolution operation using the specified kernel.- Specified by:
convolvein classImageProcessor
-
toFloatProcessors
public FloatProcessor[] toFloatProcessors()
-
setFromFloatProcessors
public void setFromFloatProcessors(FloatProcessor[] fp)
-
toFloatArrays
public float[][] toFloatArrays()
-
setFromFloatArrays
public void setFromFloatArrays(float[][] arrays)
-
toFloat
public FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
Returns a FloatProcessor with the same image, no scaling or calibration (pixel values 0 to 255). The roi, mask, lut (ColorModel), threshold, min&max are also set for the FloatProcessor- Specified by:
toFloatin classImageProcessor- Parameters:
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).- Returns:
- A FloatProcessor with the converted image data
-
setPixels
public void setPixels(int channelNumber, FloatProcessor fp)Sets the pixels from a FloatProcessor, no scaling. Also the min&max values are taken from the FloatProcessor.- Specified by:
setPixelsin classImageProcessor- Parameters:
channelNumber- Ignored (needed for compatibility with ColorProcessor.toFloat)fp- The FloatProcessor where the image data are read from.
-
isBinary
public boolean isBinary()
Returns 'true' if this is a binary image (8-bit-image with only 0 and 255).- Overrides:
isBinaryin classImageProcessor
-
getBitDepth
public int getBitDepth()
Description copied from class:ImageProcessorReturns the bit depth, 8, 16, 24 (RGB) or 32. RGB images actually use 32 bits per pixel.- Overrides:
getBitDepthin classImageProcessor
-
createMask
public ByteProcessor createMask()
Returns a binary mask, or null if a threshold is not set.- Overrides:
createMaskin classImageProcessor- See Also:
ImagePlus.createThresholdMask(),ImagePlus.createRoiMask()
-
-