- java.lang.Object
-
- ij.process.ImageProcessor
-
- ij.process.ShortProcessor
-
- All Implemented Interfaces:
Cloneable
public class ShortProcessor extends ImageProcessor
ShortProcessors contain a 16-bit unsigned image and methods that operate on that image.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanfixedScaleprotected intmaxprotected intminprotected short[]pixelsprotected byte[]pixels8protected intsnapshotMaxprotected intsnapshotMin-
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, 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 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, ColorModel cm)Creates a new ShortProcessor using the specified pixel array and ColorModel.ShortProcessor(int width, int height, short[] pixels, 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.ShortProcessor(BufferedImage bi)Creates a ShortProcessor from a TYPE_USHORT_GRAY BufferedImage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabs()If this is a 32-bit or signed 16-bit image, performs an absolute value transform, otherwise does nothing.voidadd(double value)Adds 'value' to each pixel in the image or ROI.voidadd(int value)Adds 'value' to each pixel in the image or ROI.voidand(int value)Binary AND of each pixel in the image or ROI with 'value'.voidapplyTable(int[] lut)Transforms the pixel data using a 65536 entry lookup table.voidconvolve(float[] kernel, int kernelWidth, int kernelHeight)Performs a convolution operation using the specified kernel.voidconvolve3x3(int[] kernel)Does 3x3 convolution.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.ImagecreateImage()Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255.ByteProcessorcreateMask()Returns a binary mask, or null if a threshold is not set.ImageProcessorcreateProcessor(int width, int height)Returns a new, blank ShortProcessor with the specified width and height.ImageProcessorcrop()Returns a new processor containing an image that corresponds to the current ROI.voiddilate()Not implemented.voiddrawPixel(int x, int y)Draws a pixel in the current foreground color.ImageProcessorduplicate()Returns a duplicate of this image.voiderode()Not implemented.voidexp()Performs a exponential transform on the image or ROI.voidfill()Fills the current rectangular ROI.voidfill(ImageProcessor mask)Fills pixels that are within roi and part of the mask.voidfilter(int type)Filters using a 3x3 neighborhood.voidfindMinAndMax()voidflipVertical()Flips the image or ROI vertically.voidgamma(double value)Performs gamma correction of the image or ROI.intget(int index)intget(int x, int y)This is a faster version of getPixel() that does not do bounds checking.BufferedImageget16BitBufferedImage()Returns a copy of this image as a TYPE_USHORT_GRAY BufferedImage.doublegetBackgroundValue()Returns the background fill value.intgetBitDepth()Returns the bit depth, 8, 16, 24 (RGB) or 32.BufferedImagegetBufferedImage()Returns this image as an 8-bit 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 65,536 bin histogram of the current ROI, which can be non-rectangular.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).ObjectgetPixels()Returns a reference to the short array containing this image's pixel data.ObjectgetPixelsCopy()Returns a copy of the pixel data.floatgetPixelValue(int x, int y)Returns the value of the pixel at (x,y) as a float.ObjectgetSnapshotPixels()Returns a reference to the snapshot (undo) buffer, or null.voidinvert()If "Full range 16-bit inversions" (Prefs.fullRange16bitInversions) is set in Edit/Options/Conversions, the image or ROI is inverted using the full pixel value range (0-65535) or, if set, using the "Unsigned 16-bit range" in the "Set" option of the Image>Adjust>Brightness/Contrast dialog.
Otherwise, each pixel in the image or ROI is inverted using v2=max-(v1-min), where 'min' and 'max' are the image's minimum and maximum pixel values.booleanisSigned16Bit()Returns 'true' if this is a signed 16-bit image.voidlog()Does a natural logarithmic (base e) transform of the image or ROI.voidmax(double value)Pixels greater than 'value' are set to 'value'.doublemaxValue()Returns the maximum possible pixel value.voidmedianFilter()Not implemented.voidmin(double value)Pixels less than 'value' are set to 'value'.voidmultiply(double value)Multiplies each pixel in the image or ROI by 'value'.voidnoise(double standardDeviation)Adds pseudorandom, Gaussian ("normally") distributed values, with mean 0.0 and the specified standard deviation, to this image or ROI.voidor(int value)Binary OR of each pixel in the image or ROI with 'value'.protected voidprocess(int op, double value)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()Restores the pixel data from the snapshot (undo) buffer.voidreset(ImageProcessor mask)Restores pixels from the snapshot buffer that are within the rectangular roi but not part of the mask.voidresetMinAndMax()Recalculates the min and max values used to scale pixel values to 0-255 for display.ImageProcessorresize(int dstWidth, int dstHeight)Creates a new ShortProcessor 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(double value)Assigns 'value' to each pixel in the image or ROI.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(Color color)Sets the background fill/draw color.voidsetBackgroundValue(double value)Sets the background fill value used by the rotate() and scale() methods.voidsetColor(Color color)Sets the foreground fill/draw color.voidsetf(int index, float value)voidsetf(int x, int y, float value)Sets the value of the pixel at (x,y) to 'value'.voidsetLutAnimation(boolean lutAnimation)For 16 and 32 bit processors, set 'lutAnimation' true to have createImage() use the cached 8-bit version of the image.voidsetMinAndMax(double minimum, double maximum)Sets the min and max variables that control how real pixel values are mapped to 0-255 screen values.voidsetPixels(int channelNumber, FloatProcessor fp)Sets the pixels from a FloatProcessor, no scaling.voidsetPixels(Object pixels)Sets a new pixel array for the image.voidsetSnapshotPixels(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<=65535).voidsnapshot()Makes a copy of this image's pixel data that can be later restored using reset() or reset(mask).voidsqr()Performs a square transform on the image or ROI.voidsqrt()Performs a square root transform on the image or ROI.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.FloatProcessortoFloat(int channelNumber, FloatProcessor fp)Returns a FloatProcessor with the same image, no scaling or calibration (pixel values 0 to 65535).voidxor(int value)Binary exclusive OR of each pixel in the image or ROI with 'value'.-
Methods inherited from class ij.process.ImageProcessor
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, fill, fillColorSet, fillOutside, fillOval, fillPolygon, fillRect, fillValueSet, findEdges, flipHorizontal, 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, invertLut, isBinary, isColorLut, isDefaultLut, isGrayscale, isInvertedLut, isKillable, isPseudoColorLut, isThreshold, lineTo, ln, makeDefaultColorModel, maskSizeError, minValue, moveTo, putColumn, putColumn, putPixel, putRow, putRow, resetBinaryThreshold, resetRoi, resetThreshold, resize, resize, resizeLinearly, rotateLeft, rotateRight, scaleAndSetThreshold, 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, setMask, setOverColor, setOverlay, setProgressBar, setRandomSeed, setRoi, setRoi, setRoi, setRoi, setSliceNumber, setSnapshotCopyMode, setThreshold, setUnderColor, setUseBicubic, sharpen, showProgress, smooth, subtract, threshold, toString, translate, translate, updateComposite
-
-
-
-
Constructor Detail
-
ShortProcessor
public ShortProcessor(int width, int height, short[] pixels, ColorModel cm)Creates a new ShortProcessor using the specified pixel array and ColorModel. Set 'cm' to null to use the default grayscale LUT.
-
ShortProcessor
public ShortProcessor(int width, int height)Creates a blank ShortProcessor using the default grayscale LUT that displays zero as black. Call invertLut() to display zero as white.
-
ShortProcessor
public ShortProcessor(BufferedImage bi)
Creates a ShortProcessor from a TYPE_USHORT_GRAY BufferedImage.
-
ShortProcessor
public ShortProcessor(int width, int height, short[] pixels, 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.
-
ShortProcessor
public ShortProcessor(int width, int height, boolean unsigned)Obsolete. 16 bit images are normally unsigned but signed images can be used by subtracting 32768 and using a calibration function to restore the original values.
-
-
Method Detail
-
findMinAndMax
public void findMinAndMax()
-
createImage
public Image createImage()
Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255.- Specified by:
createImagein classImageProcessor
-
getBufferedImage
public BufferedImage getBufferedImage()
Returns this image as an 8-bit BufferedImage .- Overrides:
getBufferedImagein classImageProcessor
-
get16BitBufferedImage
public BufferedImage get16BitBufferedImage()
Returns a copy of this image as a TYPE_USHORT_GRAY BufferedImage.
-
createProcessor
public ImageProcessor createProcessor(int width, int height)
Returns a new, blank ShortProcessor with the specified width and height.- Specified by:
createProcessorin classImageProcessor
-
snapshot
public void snapshot()
Description copied from class:ImageProcessorMakes a copy of this image's pixel data that can be later restored using reset() or reset(mask).- Specified by:
snapshotin classImageProcessor- See Also:
ImageProcessor.reset(),ImageProcessor.reset(ImageProcessor)
-
reset
public void reset()
Description copied from class:ImageProcessorRestores the pixel data from the snapshot (undo) buffer.- Specified by:
resetin classImageProcessor
-
reset
public void reset(ImageProcessor mask)
Description copied from class:ImageProcessorRestores pixels from the snapshot buffer that are within the rectangular roi but not part of the mask.- Specified by:
resetin classImageProcessor
-
swapPixelArrays
public void swapPixelArrays()
Swaps the pixel and snapshot (undo) arrays.- Specified by:
swapPixelArraysin classImageProcessor
-
setSnapshotPixels
public void setSnapshotPixels(Object pixels)
Description copied from class:ImageProcessorSets a new pixel array for the snapshot (undo) buffer.- Specified by:
setSnapshotPixelsin classImageProcessor
-
getSnapshotPixels
public Object getSnapshotPixels()
Description copied from class:ImageProcessorReturns a reference to the snapshot (undo) buffer, or null.- Specified by:
getSnapshotPixelsin 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 minimum, double maximum)Sets the min and max variables that control how real pixel values are mapped to 0-255 screen values. With signed 16-bit images, use IJ.setMinAndMax(imp,min,max).- Specified by:
setMinAndMaxin classImageProcessor- See Also:
resetMinAndMax(),ContrastAdjuster,IJ.setMinAndMax(ij.ImagePlus,double,double)
-
resetMinAndMax
public void resetMinAndMax()
Recalculates the min and max values used to scale pixel values to 0-255 for display. This ensures that this ShortProcessor is set up to correctly display the image.- Overrides:
resetMinAndMaxin classImageProcessor
-
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 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
-
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-65535 are clipped.- Specified by:
putPixelin 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-65535 (-32768-32767 for signed images) are clipped. Support for signed values requires a calibration table, which is set up automatically with PlugInFilters.- Specified by:
putPixelValuein classImageProcessor
-
drawPixel
public void drawPixel(int x, int y)Draws a pixel in the current foreground color.- Specified by:
drawPixelin classImageProcessor
-
getPixelValue
public float getPixelValue(int x, int y)Returns the value of the pixel at (x,y) as a float. For signed images, returns a signed value if a calibration table has been set using setCalibrationTable() (this is done automatically in PlugInFilters).- Specified by:
getPixelValuein classImageProcessor- See Also:
ImageProcessor.getPixel(int, int),ImageProcessor.getValue(int, int),ImageProcessor.getf(int, int)
-
getPixels
public Object getPixels()
Returns a reference to the short 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]&0xffff).- Specified by:
getPixelsin classImageProcessor
-
getPixelsCopy
public 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(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
-
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)
Transforms the pixel data using a 65536 entry lookup table.- Specified by:
applyTablein classImageProcessor
-
process
protected void process(int op, double value)
-
invert
public void invert()
If "Full range 16-bit inversions" (Prefs.fullRange16bitInversions) is set in Edit/Options/Conversions, the image or ROI is inverted using the full pixel value range (0-65535) or, if set, using the "Unsigned 16-bit range" in the "Set" option of the Image>Adjust>Brightness/Contrast dialog.
Otherwise, each pixel in the image or ROI is inverted using v2=max-(v1-min), where 'min' and 'max' are the image's minimum and maximum pixel values.- Overrides:
invertin classImageProcessor- See Also:
ImagePlus.setDefault16bitRange(int)
-
add
public void add(int value)
Description copied from class:ImageProcessorAdds 'value' to each pixel in the image or ROI.- Overrides:
addin classImageProcessor
-
add
public void add(double value)
Description copied from class:ImageProcessorAdds 'value' to each pixel in the image or ROI.- Overrides:
addin classImageProcessor
-
set
public void set(double value)
Description copied from class:ImageProcessorAssigns 'value' to each pixel in the image or ROI.- Overrides:
setin classImageProcessor
-
multiply
public void multiply(double value)
Description copied from class:ImageProcessorMultiplies each pixel in the image or ROI by 'value'.- Overrides:
multiplyin classImageProcessor
-
and
public void and(int value)
Description copied from class:ImageProcessorBinary AND of each pixel in the image or ROI with 'value'.- Overrides:
andin classImageProcessor
-
or
public void or(int value)
Description copied from class:ImageProcessorBinary OR of each pixel in the image or ROI with 'value'.- Overrides:
orin classImageProcessor
-
xor
public void xor(int value)
Description copied from class:ImageProcessorBinary exclusive OR of each pixel in the image or ROI with 'value'.- Overrides:
xorin classImageProcessor
-
gamma
public void gamma(double value)
Description copied from class:ImageProcessorPerforms gamma correction of the image or ROI.- Overrides:
gammain classImageProcessor
-
log
public void log()
Description copied from class:ImageProcessorDoes a natural logarithmic (base e) transform of the image or ROI.- Overrides:
login classImageProcessor
-
exp
public void exp()
Description copied from class:ImageProcessorPerforms a exponential transform on the image or ROI.- Overrides:
expin classImageProcessor
-
sqr
public void sqr()
Description copied from class:ImageProcessorPerforms a square transform on the image or ROI.- Overrides:
sqrin classImageProcessor
-
sqrt
public void sqrt()
Description copied from class:ImageProcessorPerforms a square root transform on the image or ROI.- Overrides:
sqrtin classImageProcessor
-
abs
public void abs()
Description copied from class:ImageProcessorIf this is a 32-bit or signed 16-bit image, performs an absolute value transform, otherwise does nothing.- Overrides:
absin classImageProcessor
-
min
public void min(double value)
Description copied from class:ImageProcessorPixels less than 'value' are set to 'value'.- Overrides:
minin classImageProcessor
-
max
public void max(double value)
Description copied from class:ImageProcessorPixels greater than 'value' are set to 'value'.- Overrides:
maxin classImageProcessor
-
fill
public void fill()
Fills the current rectangular ROI.- Overrides:
fillin 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 ROI.- Specified by:
fillin 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:
convolve3x3in classImageProcessor
-
filter
public void filter(int type)
Filters using a 3x3 neighborhood.- Specified by:
filterin classImageProcessor
-
rotate
public void rotate(double angle)
Rotates the image or ROI 'angle' degrees clockwise.- Specified by:
rotatein classImageProcessor- See Also:
ImageProcessor.setInterpolate(boolean)
-
flipVertical
public void flipVertical()
Description copied from class:ImageProcessorFlips the image or ROI vertically.- Specified by:
flipVerticalin 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.setInterpolationMethod(int)
-
resize
public ImageProcessor resize(int dstWidth, int dstHeight)
Creates a new ShortProcessor containing a scaled copy of this image or selection.- Specified by:
resizein classImageProcessor- See Also:
ImageProcessor.setInterpolate(boolean)
-
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
-
setColor
public void setColor(Color color)
Sets the foreground fill/draw color.- Specified by:
setColorin classImageProcessor
-
setBackgroundColor
public void setBackgroundColor(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<=65535).- Specified by:
setValuein classImageProcessor
-
getForegroundValue
public double getForegroundValue()
Returns the foreground fill/draw value.- Specified by:
getForegroundValuein classImageProcessor
-
setBackgroundValue
public void setBackgroundValue(double value)
Description copied from class:ImageProcessorSets the background fill value used by the rotate() and scale() methods.- Specified by:
setBackgroundValuein classImageProcessor
-
getBackgroundValue
public double getBackgroundValue()
Description copied from class:ImageProcessorReturns the background fill value.- Specified by:
getBackgroundValuein classImageProcessor
-
getHistogram
public int[] getHistogram()
Returns 65,536 bin histogram of the current ROI, which can be non-rectangular.- Specified by:
getHistogramin classImageProcessor
-
setLutAnimation
public void setLutAnimation(boolean lutAnimation)
Description copied from class:ImageProcessorFor 16 and 32 bit processors, set 'lutAnimation' true to have createImage() use the cached 8-bit version of the image.- Overrides:
setLutAnimationin 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
-
convolve
public void convolve(float[] kernel, int kernelWidth, int kernelHeight)Performs a convolution operation using the specified kernel.- Specified by:
convolvein 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
-
threshold
public void threshold(int level)
Description copied from class:ImageProcessorSets pixels less than or equal to level to 0 and all other pixels to 255. Only works with 8-bit and 16-bit images.- Specified by:
thresholdin classImageProcessor
-
toFloat
public FloatProcessor toFloat(int channelNumber, FloatProcessor fp)
Returns a FloatProcessor with the same image, no scaling or calibration (pixel values 0 to 65535). 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.
-
maxValue
public double maxValue()
Returns the maximum possible pixel value.- Overrides:
maxValuein 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
-
isSigned16Bit
public boolean isSigned16Bit()
Returns 'true' if this is a signed 16-bit image.- Overrides:
isSigned16Bitin 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()
-
medianFilter
public void medianFilter()
Not implemented.- Specified by:
medianFilterin classImageProcessor
-
erode
public void erode()
Not implemented.- Specified by:
erodein classImageProcessor
-
dilate
public void dilate()
Not implemented.- Specified by:
dilatein classImageProcessor
-
-