Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
ShortProcessor Class Reference
Inheritance diagram for ShortProcessor:
ImageProcessor

Public Member Functions

 ShortProcessor (int width, int height, short[] pixels, ColorModel cm)
 
 ShortProcessor (int width, int height)
 
 ShortProcessor (int width, int height, short[] pixels, ColorModel cm, boolean unsigned)
 
 ShortProcessor (int width, int height, boolean unsigned)
 
void findMinAndMax ()
 
Image createImage ()
 
ImageProcessor createProcessor (int width, int height)
 
void snapshot ()
 
void reset ()
 
void reset (ImageProcessor mask)
 
double getMin ()
 
double getMax ()
 
void setMinAndMax (double min, double max)
 
void resetMinAndMax ()
 
int getPixel (int x, int y)
 
double getInterpolatedPixel (double x, double y)
 
double getInterpolatedValue (double x, double y)
 
void putPixel (int x, int y, int value)
 
void putPixelValue (int x, int y, double value)
 
void drawPixel (int x, int y)
 
float getPixelValue (int x, int y)
 
Object getPixels ()
 
Object getPixelsCopy ()
 
void setPixels (Object pixels)
 
void copyBits (ImageProcessor ip, int xloc, int yloc, int mode)
 
void applyTable (int[] lut)
 
void invert ()
 
void add (int value)
 
void add (double value)
 
void multiply (double value)
 
void and (int value)
 
void or (int value)
 
void xor (int value)
 
void gamma (double value)
 
void log ()
 
void sqr ()
 
void sqrt ()
 
void min (double value)
 
void max (double value)
 
void fill ()
 
void fill (ImageProcessor mask)
 
void convolve3x3 (int[] kernel)
 
void filter (int type)
 
void rotate (double angle)
 
void flipVertical ()
 
void scale (double xScale, double yScale)
 
ImageProcessor resize (int dstWidth, int dstHeight)
 
ImageProcessor crop ()
 
void setColor (Color color)
 
void setValue (double value)
 
int[] getHistogram ()
 
void setThreshold (double minThreshold, double maxThreshold, int lutUpdate)
 
void convolve (float[] kernel, int kernelWidth, int kernelHeight)
 
void noise (double range)
 
void threshold (int level)
 
void medianFilter ()
 
void erode ()
 
void dilate ()
 
- Public Member Functions inherited from ImageProcessor
int getWidth ()
 
int getHeight ()
 
ColorModel getColorModel ()
 
void setColorModel (ColorModel cm)
 
void invertLut ()
 
int getBestIndex (Color c)
 
boolean isInvertedLut ()
 
boolean isColorLut ()
 
boolean isPseudoColorLut ()
 
void setColor (int value)
 
void resetMinAndMax ()
 
void setThreshold (double minThreshold, double maxThreshold, int lutUpdate)
 
void resetThreshold ()
 
double getMinThreshold ()
 
double getMaxThreshold ()
 
void setRoi (Rectangle roi)
 
void setRoi (int x, int y, int rwidth, int rheight)
 
void setRoi (ij.gui.Roi roi)
 
void setRoi (Polygon roi)
 
void resetRoi ()
 
Rectangle getRoi ()
 
void setMask (ImageProcessor mask)
 
ImageProcessor getMask ()
 
byte[] getMaskArray ()
 
void setProgressBar (ProgressBar pb)
 
void setInterpolate (boolean interpolate)
 
boolean getInterpolate ()
 
boolean isKillable ()
 
double[] getLine (double x1, double y1, double x2, double y2)
 
void getRow (int x, int y, int[] data, int length)
 
void getColumn (int x, int y, int[] data, int length)
 
void putRow (int x, int y, int[] data, int length)
 
void putColumn (int x, int y, int[] data, int length)
 
void moveTo (int x, int y)
 
void setLineWidth (int width)
 
void lineTo (int x2, int y2)
 
void drawLine (int x1, int y1, int x2, int y2)
 
void drawRect (int x, int y, int width, int height)
 
void drawPolygon (Polygon p)
 
void fillPolygon (Polygon p)
 
void drawDot2 (int x, int y)
 
void drawDot (int xcenter, int ycenter)
 
void drawString (String s)
 
void drawString (String s, int x, int y)
 
void setJustification (int justification)
 
void setFont (Font font)
 
void setAntialiasedText (boolean antialiasedText)
 
int getStringWidth (String s)
 
FontMetrics getFontMetrics ()
 
void smooth ()
 
void sharpen ()
 
void findEdges ()
 
void flipHorizontal ()
 
ImageProcessor rotateRight ()
 
ImageProcessor rotateLeft ()
 
void insert (ImageProcessor ip, int xloc, int yloc)
 
String toString ()
 
void fill ()
 
void setCalibrationTable (float[] cTable)
 
void setHistogramSize (int size)
 
int getHistogramSize ()
 
void setHistogramRange (double histMin, double histMax)
 
double getHistogramMin ()
 
double getHistogramMax ()
 
int[] getPixel (int x, int y, int[] iArray)
 
void putPixel (int x, int y, int[] iArray)
 
double getInterpolatedValue (double x, double y)
 
void invert ()
 
void add (int value)
 
void add (double value)
 
void multiply (double value)
 
void and (int value)
 
void or (int value)
 
void xor (int value)
 
void gamma (double value)
 
void log ()
 
void sqr ()
 
void sqrt ()
 
void min (double value)
 
void max (double value)
 
ImageProcessor duplicate ()
 
void setLutAnimation (boolean lutAnimation)
 
ImageProcessor convertToByte (boolean doScaling)
 
ImageProcessor convertToShort (boolean doScaling)
 
ImageProcessor convertToFloat ()
 
ImageProcessor convertToRGB ()
 
void autoThreshold ()
 
int getAutoThreshold ()
 
int getAutoThreshold (int[] histogram)
 
void setClipRect (Rectangle clipRect)
 

Additional Inherited Members

- Static Public Attributes inherited from ImageProcessor
static final int BLACK = 0xFF000000
 
static final double NO_THRESHOLD = -808080.0
 
static final int LEFT_JUSTIFY = 0
 
static final int CENTER_JUSTIFY = 1
 
static final int RIGHT_JUSTIFY = 2
 
static final int RED_LUT =0
 
- Protected Member Functions inherited from ImageProcessor
void showProgress (double percentDone)
 
void hideProgress ()
 
void makeDefaultColorModel ()
 
String maskSizeError (ImageProcessor mask)
 
- Protected Attributes inherited from ImageProcessor
int lineWidth = 1
 
int cx
 
Font font
 
FontMetrics fontMetrics
 
boolean antialiasedText
 
boolean boldFont
 
int width
 
int height
 
int roiX
 
int xMin
 
ColorModel baseCM
 
ColorModel cm
 
byte[] rLUT1
 
byte[] rLUT2
 
boolean interpolate
 
double minThreshold =NO_THRESHOLD
 
int histogramSize = 256
 
double histogramMin
 
float[] cTable
 
boolean lutAnimation
 
MemoryImageSource source
 
Image img
 
boolean newPixels
 
Color drawingColor = Color.black
 
int clipXMin
 
int justification = LEFT_JUSTIFY
 
boolean inversionTested = false
 
boolean invertedLut
 

Detailed Description

Objects of the class contain a 16-bit unsigned image and methods that operate on that image.

Definition at line 10 of file ShortProcessor.java.

Constructor & Destructor Documentation

ShortProcessor ( int  width,
int  height,
short[]  pixels,
ColorModel  cm 
)
inline

Creates a new ShortProcessor using the specified pixel array and ColorModel. Set 'cm' to null to use the default grayscale LUT.

Definition at line 21 of file ShortProcessor.java.

ShortProcessor ( int  width,
int  height 
)
inline

Creates a blank ShortProcessor using the default grayscale LUT that displays zero as black. Call invertLut() to display zero as white.

Definition at line 36 of file ShortProcessor.java.

ShortProcessor ( int  width,
int  height,
short[]  pixels,
ColorModel  cm,
boolean  unsigned 
)
inline

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.

Definition at line 42 of file ShortProcessor.java.

ShortProcessor ( int  width,
int  height,
boolean  unsigned 
)
inline

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.

Definition at line 48 of file ShortProcessor.java.

Member Function Documentation

void applyTable ( int[]  lut)
inlinevirtual

Transforms the pixel data using a 65536 entry lookup table.

Implements ImageProcessor.

Definition at line 308 of file ShortProcessor.java.

void convolve ( float[]  kernel,
int  kernelWidth,
int  kernelHeight 
)
inlinevirtual

Performs a convolution operation using the specified kernel.

Implements ImageProcessor.

Definition at line 804 of file ShortProcessor.java.

void convolve3x3 ( int[]  kernel)
inlinevirtual

3x3 convolution contributed by Glynne Casteel.

Implements ImageProcessor.

Definition at line 445 of file ShortProcessor.java.

void copyBits ( ImageProcessor  ip,
int  xloc,
int  yloc,
int  mode 
)
inlinevirtual

Copies the image contained in 'ip' to (xloc, yloc) using one of the transfer modes defined in the Blitter interface.

Implements ImageProcessor.

Definition at line 301 of file ShortProcessor.java.

Image createImage ( )
inlinevirtual

Create an 8-bit AWT image by scaling pixels in the range min-max to 0-255.

Implements ImageProcessor.

Definition at line 70 of file ShortProcessor.java.

ImageProcessor createProcessor ( int  width,
int  height 
)
inlinevirtual

Returns a new, blank ShortProcessor with the specified width and height.

Implements ImageProcessor.

Definition at line 106 of file ShortProcessor.java.

ImageProcessor crop ( )
inlinevirtual

Creates a new processor containing an image that corresponds to the current ROI.

Implements ImageProcessor.

Definition at line 729 of file ShortProcessor.java.

void dilate ( )
inlinevirtual

Not implemented.

Implements ImageProcessor.

Definition at line 846 of file ShortProcessor.java.

void drawPixel ( int  x,
int  y 
)
inlinevirtual

Draws a pixel in the current foreground color.

Implements ImageProcessor.

Definition at line 245 of file ShortProcessor.java.

void erode ( )
inlinevirtual

Not implemented.

Implements ImageProcessor.

Definition at line 844 of file ShortProcessor.java.

void fill ( )
inline

Fills the current rectangular ROI.

Definition at line 420 of file ShortProcessor.java.

void fill ( ImageProcessor  mask)
inlinevirtual

Fills pixels that are within roi and part of the mask. Throws an IllegalArgumentException if the mask is null or the size of the mask is not the same as the size of the ROI.

Implements ImageProcessor.

Definition at line 427 of file ShortProcessor.java.

void filter ( int  type)
inlinevirtual

Filters using a 3x3 neighborhood.

Implements ImageProcessor.

Definition at line 497 of file ShortProcessor.java.

void flipVertical ( )
inlinevirtual

Flips the image or ROI vertically.

Implements ImageProcessor.

Definition at line 599 of file ShortProcessor.java.

int [] getHistogram ( )
inlinevirtual

Returns 65536 bin histogram of the current ROI, which can be non-rectangular.

Implements ImageProcessor.

Definition at line 763 of file ShortProcessor.java.

double getInterpolatedPixel ( double  x,
double  y 
)
inlinevirtual

Uses bilinear interpolation to find the pixel value at real coordinates (x,y).

Implements ImageProcessor.

Definition at line 200 of file ShortProcessor.java.

double getInterpolatedValue ( double  x,
double  y 
)
inline

Uses bilinear interpolation to find the calibrated pixel value at real coordinates (x,y).

Definition at line 210 of file ShortProcessor.java.

double getMax ( )
inlinevirtual

Returns the largest displayed pixel value.

Implements ImageProcessor.

Definition at line 160 of file ShortProcessor.java.

double getMin ( )
inlinevirtual

Returns the smallest displayed pixel value.

Implements ImageProcessor.

Definition at line 155 of file ShortProcessor.java.

int getPixel ( int  x,
int  y 
)
inlinevirtual

Returns 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.

Implements ImageProcessor.

Definition at line 192 of file ShortProcessor.java.

Object getPixels ( )
inlinevirtual

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).

Implements ImageProcessor.

Definition at line 263 of file ShortProcessor.java.

Object getPixelsCopy ( )
inlinevirtual

Returns a reference to this image's snapshot (undo) array. If the snapshot array is null, returns a copy of the pixel data.

Implements ImageProcessor.

Definition at line 269 of file ShortProcessor.java.

float getPixelValue ( int  x,
int  y 
)
inlinevirtual

Returns 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.

Implements ImageProcessor.

Definition at line 250 of file ShortProcessor.java.

void medianFilter ( )
inlinevirtual

Not implemented.

Implements ImageProcessor.

Definition at line 842 of file ShortProcessor.java.

void noise ( double  range)
inlinevirtual

Adds random noise to the image or ROI.

Parameters
rangethe range of random numbers

Implements ImageProcessor.

Definition at line 813 of file ShortProcessor.java.

void putPixel ( int  x,
int  y,
int  value 
)
inlinevirtual

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.

Implements ImageProcessor.

Definition at line 222 of file ShortProcessor.java.

void putPixelValue ( int  x,
int  y,
double  value 
)
inlinevirtual

Stores the specified real value at (x,y). Does nothing if (x,y) is outside the image boundary. Values outside the range 0-65535 are clipped.

Implements ImageProcessor.

Definition at line 234 of file ShortProcessor.java.

void reset ( )
inlinevirtual

Restores the pixel data from the snapshot (undo) buffer.

Implements ImageProcessor.

Definition at line 123 of file ShortProcessor.java.

void reset ( ImageProcessor  mask)
inlinevirtual

Restore pixels that are within roi but not part of the mask.

Implements ImageProcessor.

Definition at line 132 of file ShortProcessor.java.

void resetMinAndMax ( )
inline

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.

Definition at line 186 of file ShortProcessor.java.

ImageProcessor resize ( int  dstWidth,
int  dstHeight 
)
inlinevirtual

Creates a new ShortProcessor containing a scaled copy of this image or selection.

Implements ImageProcessor.

Definition at line 688 of file ShortProcessor.java.

void rotate ( double  angle)
inlinevirtual

Rotates the image or ROI 'angle' degrees clockwise.

See Also
ImageProcessor::setInterpolate

Implements ImageProcessor.

Definition at line 550 of file ShortProcessor.java.

void scale ( double  xScale,
double  yScale 
)
inlinevirtual

Scales the image or selection using the specified scale factors.

See Also
ImageProcessor::setInterpolate

Implements ImageProcessor.

Definition at line 617 of file ShortProcessor.java.

void setColor ( Color  color)
inlinevirtual

Sets the foreground fill/draw color.

Implements ImageProcessor.

Definition at line 742 of file ShortProcessor.java.

void setMinAndMax ( double  min,
double  max 
)
inlinevirtual

Sets the min and max variables that control how real pixel values are mapped to 0-255 screen values.

See Also
resetMinAndMax
ij.plugin.frame.ContrastAdjuster

Implements ImageProcessor.

Definition at line 170 of file ShortProcessor.java.

void setPixels ( Object  pixels)
inlinevirtual

Sets a new pixel array for the image and resets the snapshot buffer. The length of the array must be equal to width*height.

Implements ImageProcessor.

Definition at line 279 of file ShortProcessor.java.

void setValue ( double  value)
inlinevirtual

Sets the default fill/draw value, where 0<=value<=65535).

Implements ImageProcessor.

Definition at line 755 of file ShortProcessor.java.

void snapshot ( )
inlinevirtual

Makes a copy of this image's pixel data.

Implements ImageProcessor.

Definition at line 112 of file ShortProcessor.java.

void threshold ( int  level)
inlinevirtual

Sets pixels less than or equal to level to 0 and all other pixels to 255. Only works with 8-bit and 16-bit images.

Implements ImageProcessor.

Definition at line 830 of file ShortProcessor.java.


The documentation for this class was generated from the following file: