public class ImageAccess
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ImageAccess.Display
Class Display.
|
static class |
ImageAccess.RGB
Class RGB.
|
static class |
ImageAccess.Stack
Class Stack.
|
Modifier and Type | Field and Description |
---|---|
int |
nx
Horizontal size of the image.
|
int |
ny
Vertical size of the image.
|
double[] |
pixels
Array of pixels in double stored row by rows.
|
Constructor and Description |
---|
ImageAccess()
Create an ImageAccess object from the current selected ImagePlus.
|
ImageAccess(ColorProcessor cp,
int colorPlane)
Create a new ImageAccess object from the specified ColorProcessor.
|
ImageAccess(ImagePlus imp)
Create an ImageAccess object from the specified ImagePlus.
|
ImageAccess(ImageProcessor ip)
Create an ImageAccess object from the specified ImageProcessor.
|
ImageAccess(int nx,
int ny)
Create an ImageAccess of size [nx, ny].
|
ImageAccess(int nx,
int ny,
double[] array)
Create an ImageAccess object from a 1D double array of pixels.
|
ImageAccess(java.lang.String name)
Create am ImageAccess object from ImagePlus specified by its name.
|
ImageAccess(java.lang.String path,
java.lang.String filename)
Create an ImageAccess object from a file.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double constant)
Add a constant to each pixel of this image.
|
void |
add(ImageAccess a)
Add a ImageAccess object to this ImageAccess (pixelwise mode).
|
ByteProcessor |
createByteProcessor()
Create a ByteProcessor from the pixel data.
|
FloatProcessor |
createFloatProcessor()
Create a FloatProcessor from the pixel data.
|
void |
divide(double constant)
Divide a constant value to each pixel of this image.
|
void |
divide(ImageAccess a)
Divide this image by by an ImageAccess object (pixelwise mode).
|
ImageAccess |
duplicate()
Duplicate the current image.
|
double[][] |
getArrayPixels()
Return a copy of the pixel data organized in a 2D array.
|
double[] |
getColumn(int x)
Get a whole column of this image.
|
int |
getHeight()
Return the height of the image.
|
double |
getInterpolatedPixel(double x,
double y)
Get 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.
|
double[][] |
getNeighborhood(int x,
int y,
int mx,
int my)
Return a neighborhood around a pixel position.
|
double |
getPixel(int x,
int y)
Get the gray level of a selected pixel.
|
double[] |
getPixels()
Return a reference to the pixel data in double (1D).
|
double[] |
getRow(int y)
Get a whole row of this image.
|
ImageAccess |
getSubImage(int x,
int y,
int mx,
int my)
Return a sub-image from this image.
|
java.lang.String |
getTitle()
Return the title of the image.
|
int |
getWidth()
Return the width of the image.
|
void |
multiply(double constant)
Multiply a constant to each pixel of this image.
|
void |
multiply(ImageAccess a)
Multiply a ImageAccess object to this ImageAccess (pixelwise mode).
|
void |
pow(double a)
Raised an ImageAccess object to the power a.
|
void |
putArrayPixels(double[][] array)
Put an 2D array into this image.
|
void |
putColumn(int x,
double[] column)
Put a whole column in a specified position into this image.
|
void |
putPixel(int x,
int y,
double value)
Put a pixel value to a specified position.
|
void |
putRow(int y,
double[] row)
Put a whole row in a specified position into this image.
|
void |
putSubImage(int x,
int y,
ImageAccess subimage)
Put a sub-image with the upper left corner in the coordinate (x,y).
|
void |
setConstant(double constant)
Set a constant value to all pixels of this image.
|
void |
setTitle(java.lang.String title)
Set the title of the image
|
ImageAccess.Display |
show()
Show an image (ImageAccess object).
|
ImageAccess.Display |
show(java.lang.String title)
Show an image (ImageAccess object) and set the title.
|
void |
sqrt()
Compute the square root of an ImageAccess.
|
void |
subtract(double constant)
Subtract a constant to each pixels of this image.
|
void |
subtract(ImageAccess a)
Subtract a ImageAccess object to this ImageAccess (pixelwise mode).
|
public double[] pixels
public int nx
public int ny
public ImageAccess()
public ImageAccess(java.lang.String name)
name
- Name of the ImagePlus object.public ImageAccess(java.lang.String path, java.lang.String filename)
path
- Path of the filefilename
- Name of the filepublic ImageAccess(ImagePlus imp)
imp
- ImagePlus objectpublic ImageAccess(ImageProcessor ip)
ip
- ImageProcessor objectpublic ImageAccess(int nx, int ny, double[] array)
nx
- Horizontal size of the image along the X-axisny
- Vertical size of the image along the Y-axisarray
- Array of pixel (1D) of size nx * nypublic ImageAccess(int nx, int ny)
nx
- Horizontal size of the image along the X-axisny
- Vertical size of the image along the Y-axispublic ImageAccess(ColorProcessor cp, int colorPlane)
cp
- ColorProcessor objectcolorPlane
- Index of the color plane 0 (red), 1 (green) or 2 (blue)public java.lang.String getTitle()
public int getWidth()
public int getHeight()
public double getMaximum()
public double getMinimum()
public double getMean()
public double[][] getArrayPixels()
public double[] getPixels()
public FloatProcessor createFloatProcessor()
public ByteProcessor createByteProcessor()
public ImageAccess duplicate()
public double getPixel(int x, int y)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelpublic double getInterpolatedPixel(double x, double y)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelpublic double[] getColumn(int x)
x
- X-coordinate of a pixelpublic double[] getRow(int y)
y
- Y-coordinate of a pixelpublic double[][] getNeighborhood(int x, int y, int mx, int my)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelpublic ImageAccess getSubImage(int x, int y, int mx, int my)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelmx
- Horizontal size of sub-imagemy
- Vertical size of sub-imagepublic void putPixel(int x, int y, double value)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelvalue
- Value of the gray levelpublic void putColumn(int x, double[] column)
x
- X-coordinate of a pixelcolumn
- 1D array of the type doublepublic void putRow(int y, double[] row)
y
- Y-coordinate of a pixelrow
- 1D Array of the type doublepublic void putArrayPixels(double[][] array)
array
- Double array to out into this imagepublic void putSubImage(int x, int y, ImageAccess subimage)
x
- X-coordinate of a pixely
- Y-coordinate of a pixelsubimage
- ImageAccess object to insert into this imagepublic void setConstant(double constant)
constant
- Constant valuepublic void setTitle(java.lang.String title)
title
- Title of the imagepublic void sqrt()
public void pow(double a)
a
- Power valuepublic void add(double constant)
constant
- Constant value to be addedpublic void multiply(double constant)
constant
- Constant value to be multipliedpublic void subtract(double constant)
constant
- Constant to be subtractedpublic void divide(double constant)
constant
- Constant to be dividedpublic void add(ImageAccess a)
a
- Image to addpublic void subtract(ImageAccess a)
a
- Image to subtractpublic void multiply(ImageAccess a)
a
- Image to multiplypublic void divide(ImageAccess a)
a
- Dividend imagepublic ImageAccess.Display show()
public ImageAccess.Display show(java.lang.String title)
title
- Title of the window image