|
|||
PREV CLASS NEXT CLASS | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ImageAccess
ImageAccess is an interface layer to facilitate the access to the pixels of ImageJ images. Methods of ImageAccess provides an easy and robust way to access to the pixels of images. The data are stored in an double array. Many methods get/put allows to access to the data. If the user try to access outside of the image, the mirror boundary conditions are applied.
Field Summary | |
static int |
PATTERN_CROSS_3x3
|
static int |
PATTERN_SQUARE_3x3
|
Constructor Summary | |
ImageAccess(ij.process.ColorProcessor cp,
int colorPlane)
Creates a new object of the class ImageAccess from an ColorProcessor object. |
|
ImageAccess(double[][] array)
Creates a new ImageAccess object from a 2D double array of pixels. |
|
ImageAccess(ij.process.ImageProcessor ip)
Creates a new object of the class ImageAccess from an ImageProcessor object. |
|
ImageAccess(int nx,
int ny)
Creates a new object of the class ImageAccess. |
Method Summary | |
void |
abs()
Compute the absolute value. |
void |
add(double constant)
An ImageAccess object calls this method for adding a constant to each pixel. |
void |
add(ImageAccess im1,
ImageAccess im2)
An ImageAccess object calls this method for adding two ImageAccess objects. |
ij.process.ByteProcessor |
createByteProcessor()
Create a ByteProcessor from the pixel data. |
ij.process.FloatProcessor |
createFloatProcessor()
Create a FloatProcessor from the pixel data. |
void |
divide(double constant)
An ImageAccess object calls this method for dividing a constant to each pixel. |
void |
divide(ImageAccess im1,
ImageAccess im2)
An ImageAccess object calls this method for dividing two ImageAccess objects. |
ImageAccess |
duplicate()
Create a new ImageAccess object by duplication of the current the ImageAccess object. |
double[][] |
getArrayPixels()
Returns a copy of the pixel data organize in a 2D array. |
void |
getColumn(int x,
double[] column)
An ImageAccess object calls this method for getting a whole column of the image. |
void |
getColumn(int x,
int y,
double[] column)
An ImageAccess object calls this method for getting a part of column. |
int |
getHeight()
Return the height of the image. |
double |
getInterpolatedPixel(double x,
double y)
An ImageAccess object calls this method for getting the gray level of a selected pixel using a bilinear interpolation. |
double |
getMaximum()
Return the maximum value of ImageAccess. |
double |
getMean()
Return the mean value of ImageAccess. |
double |
getMinimum()
Return the minimum value of ImageAccess. |
void |
getNeighborhood(int x,
int y,
double[][] neigh)
An ImageAccess object calls this method for getting a neighborhood arround a pixel position. |
void |
getPattern(int x,
int y,
double[] neigh,
int pattern)
An ImageAccess object calls this method for getting a neighborhood of a predefined pattern around a selected pixel (x,y). |
double |
getPixel(int x,
int y)
An ImageAccess object calls this method for getting the gray level of a selected pixel. |
double[] |
getPixels()
Returns a reference to the pixel data in double (1D). |
void |
getRow(int y,
double[] row)
An ImageAccess object calls this method for getting a whole row of the image. |
void |
getRow(int x,
int y,
double[] row)
An ImageAccess object calls this method for getting a part of row. |
void |
getSubImage(int x,
int y,
ImageAccess output)
An ImageAccess object calls this method to get a sub-image with the upper left corner in the coordinate (x,y). |
int |
getWidth()
Return the width of the image. |
void |
multiply(double constant)
An ImageAccess object calls this method for multiplying a constant to each pixel. |
void |
multiply(ImageAccess im1,
ImageAccess im2)
An ImageAccess object calls this method for multiplying two ImageAccess objects. |
void |
normalizeContrast()
Stretches the contrast inside an image so that the gray levels are in the range 0 to 255. |
void |
pow(double a)
Raised an ImageAccess object to the power a. |
void |
putArrayPixels(double[][] array)
An ImageAccess object calls this method in order to put an 2D array of double in an ImageAccess. |
void |
putColumn(int x,
double[] column)
An ImageAccess object calls this method to put a whole column in a specified position into the image. |
void |
putColumn(int x,
int y,
double[] column)
An ImageAccess object calls this method to put a part of column into the image. |
void |
putPixel(int x,
int y,
double value)
An ImageAccess object calls this method in order a value of the gray level to be put to a position inside it given by the coordinates. |
void |
putRow(int y,
double[] row)
An ImageAccess object calls this method to put a whole row in a specified position into the image. |
void |
putRow(int x,
int y,
double[] row)
An ImageAccess object calls this method to put a part of row into the image. |
void |
putSubImage(int x,
int y,
ImageAccess input)
An ImageAccess object calls this method to put a sub-image with the upper left corner in the coordinate (x,y). |
void |
setConstant(double constant)
An ImageAccess object calls this method to set a constant value to all pixels of the image. |
void |
show(java.lang.String title)
Display an image. |
void |
show(java.lang.String title,
java.awt.Point loc)
Display an image at a specific position (x, y). |
void |
sqrt()
Compute the square root of an ImageAccess. |
void |
subtract(double constant)
An ImageAccess object calls this method for adding a constant to each pixel. |
void |
subtract(ImageAccess im1,
ImageAccess im2)
An ImageAccess object calls this method for subtracting two ImageAccess objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PATTERN_SQUARE_3x3
public static final int PATTERN_CROSS_3x3
Constructor Detail |
public ImageAccess(double[][] array)
array
- an array of pixel (2D)public ImageAccess(ij.process.ImageProcessor ip)
ip
- an ImageProcessor object provided by ImageJpublic ImageAccess(ij.process.ColorProcessor cp, int colorPlane)
cp
- an ColorProcessor objectcolorPlane
- index of the color plane 0, 1 or 2public ImageAccess(int nx, int ny)
nx
- the size of the image along the X-axisny
- the size of the image along the Y-axisMethod Detail |
public int getWidth()
public int getHeight()
public double getMaximum()
public double getMinimum()
public double getMean()
public double[][] getArrayPixels()
public double[] getPixels()
public ij.process.FloatProcessor createFloatProcessor()
public ij.process.ByteProcessor createByteProcessor()
public ImageAccess duplicate()
public double getPixel(int x, int y)
x
- input, the integer x-coordinate of a pixely
- input, the integer y-coordinate of a pixelpublic double getInterpolatedPixel(double x, double y)
x
- input, the double x-coordinate of a pixely
- input, the double y-coordinate of a pixelpublic void getColumn(int x, double[] column)
x
- input, the integer x-coordinate of a columncolumn
- output, an array of the type doublepublic void getColumn(int x, int y, double[] column)
x
- input, the integer x-coordinate of a columny
- input, starting pointcolumn
- output, an array of the type doublepublic void getRow(int y, double[] row)
y
- input, the integer y-coordinate of a rowrow
- output, an array of the type doublepublic void getRow(int x, int y, double[] row)
x
- input, starting pointy
- input, the integer y-coordinate of a rowrow
- output, an array of the type doublepublic void getNeighborhood(int x, int y, double[][] neigh)
x
- the integer x-coordinate of a selected central pixely
- the integer y-coordinate of a selected central pixelneigh
- output, a 2D array spublic void getPattern(int x, int y, double[] neigh, int pattern)
x
- x-coordinate of a selected central pixely
- y-coordinate of a selected central pixelneigh
- output, an array consisting of 9 or 5 elementspattern
- PATTERN_SQUARE_3x3 or PATTERN_CROSS_3x3.public void getSubImage(int x, int y, ImageAccess output)
x
- x-coordinate in the source imagey
- y-coordinate in the source imageoutput
- an ImageAccess object with the sub-image;public void putPixel(int x, int y, double value)
x
- input, the integer x-coordinate of a pixely
- input, the integer y-coordinate of a pixelvalue
- input, a value of the gray level of the type doublepublic void putColumn(int x, double[] column)
x
- input, the integer x-coordinate of a columncolumn
- input, an array of the type doublepublic void putColumn(int x, int y, double[] column)
x
- input, the integer x-coordinate of a columny
- input, the integer y-coordinate of a columncolumn
- input, an array of the type doublepublic void putRow(int y, double[] row)
y
- input, the integer x-coordinate of a columnrow
- input, an array of the type doublepublic void putRow(int x, int y, double[] row)
x
- input, the integer x-coordinate of a columny
- input, the integer y-coordinate of a columnrow
- input, an array of the type doublepublic void putArrayPixels(double[][] array)
array
- input, the double arraypublic void putSubImage(int x, int y, ImageAccess input)
x
- x-coordinate in the source imagey
- y-coordinate in the source imageinput
- an ImageAccess object that we want to put;public void setConstant(double constant)
constant
- a constant valuepublic void normalizeContrast()
public void show(java.lang.String title, java.awt.Point loc)
title
- a string for the titleloc
- Point for the locationpublic void show(java.lang.String title)
title
- a string for the title of the windowpublic void abs()
public void sqrt()
public void pow(double a)
a
- inputpublic void add(double constant)
constant
- a constant to be addedpublic void multiply(double constant)
constant
- a constant to be multipliedpublic void subtract(double constant)
constant
- a constant to be addedpublic void divide(double constant)
constant
- a constant to be multipliedpublic void add(ImageAccess im1, ImageAccess im2)
im1
- an ImageAccess object to be addedim2
- an ImageAccess object to be addedpublic void multiply(ImageAccess im1, ImageAccess im2)
im1
- an ImageAccess object to be multipliedim2
- an ImageAccess object to be multipliedpublic void subtract(ImageAccess im1, ImageAccess im2)
im1
- an ImageAccess object to be subtractedim2
- an ImageAccess object to be subtractedpublic void divide(ImageAccess im1, ImageAccess im2)
im1
- numeratorim2
- denominator
|
|||
PREV CLASS NEXT CLASS | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |