|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimagescience.image.Image
public abstract class Image
Abstract base class for images containing up to 5D elements.
Method Summary | |
---|---|
void |
absolute()
Replaces every image element by its absolute value. |
void |
add(double value)
Adds a value to every image element. |
void |
add(Image image)
Adds an image element-by-element to this image. |
Aspects |
aspects()
Returns the aspect sizes of the image elements. |
void |
aspects(Aspects aspects)
Sets the aspect sizes of the image elements. |
int |
axes()
Returns the current Cartesian coordinate axes activity. |
void |
axes(int axes)
Sets the currently active Cartesian coordinate axis or axes. |
abstract Image |
border(Borders borders)
Returns a bordered copy of this image. |
static Image |
create(Dimensions dims,
java.lang.String type)
Creates a new Image of given dimensions and type. |
Dimensions |
dimensions()
Returns the dimensions of the image. |
void |
divide(double value)
Divides every image element by a value. |
void |
divide(Image image)
Divides this image element-by-element by an image. |
abstract Image |
duplicate()
Duplicates this image. |
int |
elements()
Returns the number of elements in the image. |
double[] |
extrema()
Returns the extreme values in the image. |
abstract double |
get(Coordinates coords)
Returns the value of the image element at the given coordinates. |
abstract void |
get(Coordinates coords,
double[] values)
Reads values in one dimension from the image into the array. |
abstract void |
get(Coordinates coords,
double[][] values)
Reads values in two dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
double[][][] values)
Reads values in three dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
double[][][][] values)
Reads values in four dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
double[][][][][] values)
Reads values in all five dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
float[] values)
Reads values in one dimension from the image into the array. |
abstract void |
get(Coordinates coords,
float[][] values)
Reads values in two dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
float[][][] values)
Reads values in three dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
float[][][][] values)
Reads values in four dimensions from the image into the array. |
abstract void |
get(Coordinates coords,
float[][][][][] values)
Reads values in all five dimensions from the image into the array. |
int |
id()
Returns the image's ID. |
abstract ij.ImagePlus |
imageplus()
Returns this image in the form of an ImagePlus object. |
void |
invert()
Replaces every image element by its inverted value. |
double |
maximum()
Returns the maximum value in the image. |
abstract int |
memory()
Returns the amount of memory occupied by the image data. |
double |
minimum()
Returns the minimum value in the image. |
abstract void |
mirror(Borders borders)
Sets the image elements in the borders by mirroring the remainder of the image. |
void |
multiply(double value)
Multiplies every image element with a value. |
void |
multiply(Image image)
Multiplies this image element-by-element with an image. |
java.lang.String |
name()
Returns the name of this image. |
void |
name(java.lang.String name)
Sets the name of this image. |
void |
power(double power)
Replaces every image element by its value raised to a power. |
abstract void |
set(Borders borders,
double value)
Sets every image element in the borders to the given value. |
abstract void |
set(Coordinates coords,
double value)
Sets the image element at the given coordinates to the given value. |
abstract void |
set(Coordinates coords,
double[] values)
Writes values in one dimension from the array into the image. |
abstract void |
set(Coordinates coords,
double[][] values)
Writes values in two dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
double[][][] values)
Writes values in three dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
double[][][][] values)
Writes values in four dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
double[][][][][] values)
Writes values in all five dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
float[] values)
Writes values in one dimension from the array into the image. |
abstract void |
set(Coordinates coords,
float[][] values)
Writes values in two dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
float[][][] values)
Writes values in three dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
float[][][][] values)
Writes values in four dimensions from the array into the image. |
abstract void |
set(Coordinates coords,
float[][][][][] values)
Writes values in all five dimensions from the array into the image. |
abstract void |
set(double value)
Sets every image element to the given value. |
void |
square()
Replaces every image element by its square value. |
void |
squareroot()
Replaces every image element by its square root value. |
void |
subtract(double value)
Subtracts a value from every image element. |
void |
subtract(Image image)
Subtracts an image element-by-element from this image. |
abstract java.lang.String |
type()
Returns the image type. |
static Image |
wrap(ij.ImagePlus imageplus)
Creates a wrapper Image of the given ImagePlus object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract java.lang.String type()
String
contains the fully qualified name of the subclass which this image is an object of.public abstract Image border(Borders borders)
borders
- Specifies the border size in each dimension.
java.lang.NullPointerException
- If borders
is null
.public static Image create(Dimensions dims, java.lang.String type)
Image
of given dimensions and type.
dims
- The dimensions of the new image.type
- The type of image to be created. Must be a String
containing the fully qualified name of the subclass which the new image must be an instance of.
Image
of given dimensions and type.
java.lang.IllegalArgumentException
- If the given type
is not supported.
java.lang.NullPointerException
- If any of the parameters is null
.
java.lang.UnknownError
- If for any reason the requested image could not be created. In most cases this will be due to insufficient free memory.public static Image wrap(ij.ImagePlus imageplus)
Image
of the given ImagePlus
object. This is done by checking the element type and calling the wrapper constructor of the corresponding Image
subclass.
imageplus
- The ImagePlus
object whose image data is to be wrapped.
Image
object of the given ImagePlus
object. The two objects share the actual image data.
java.lang.IllegalArgumentException
- If the elements of imageplus
are of a non-supported type.
java.lang.NullPointerException
- If imageplus
is null
.public abstract ij.ImagePlus imageplus()
ImagePlus
object.
ImagePlus
object of this Image
object. The two objects share the actual image data.public int elements()
public void aspects(Aspects aspects)
aspects
- Specifies the aspect size in each dimension.
java.lang.NullPointerException
- If aspects
is null
.public Aspects aspects()
public int id()
public abstract int memory()
public Dimensions dimensions()
public abstract Image duplicate()
Image
object that is an exact copy of this object. All information is copied and no memory is shared between this and the returned object.public double[] extrema()
[0]
= the minimum value in the image,[1]
= the maximum value in the image.public double minimum()
public double maximum()
public void axes(int axes)
get
and set
methods for reading and writing values.
axes
- An integer number indicating which axis or axes are to be actived. Must be one or a combination (by addition) of Axes.X
, Axes.Y
, Axes.Z
, Axes.T
, Axes.C
.
java.lang.IllegalArgumentException
- If axes
does not correspond to a valid combination of axes.public int axes()
Axes.X
, Axes.Y
, Axes.Z
, Axes.T
, Axes.C
.public abstract double get(Coordinates coords)
coords
- The coordinates of the image element whose value is to be obtained. Coordinates must be within the range determined by the image dimensions. For consistency with the other get
methods, none of the Cartesian coordinate axes should be active. However, this condition is not strictly necessary in order for this method to behave unambiguously and is therefore not checked, so as to increase efficiency.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates is out of range.
java.lang.NullPointerException
- If coords
is null
.public abstract void get(Coordinates coords, float[] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinate corresponding to the active axis is allowed to be outside the range determined by the image size in the corresponding dimension. Out-of-range positions in the active dimension are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If more than one coordinate axis is active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, double[] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinate corresponding to the active axis is allowed to be outside the range determined by the image size in the corresponding dimension. Out-of-range positions in the active dimension are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If more than one coordinate axis is active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, float[][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly two coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, double[][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly two coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, float[][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly three coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, double[][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly three coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, float[][][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly four coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If the coordinate corresponding to the non-active axis is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, double[][][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly four coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If the coordinate corresponding to the non-active axis is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, float[][][][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. Coordinates are allowed to be outside the range determined by the image size. Out-of-range positions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly five coordinate axes are active.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void get(Coordinates coords, double[][][][][] values)
coords
- The coordinates of the starting position in the image for reading image values into the array. Coordinates are allowed to be outside the range determined by the image size. Out-of-range positions are not actually read but simply skipped.values
- The array to which the image values are copied.
java.lang.IllegalStateException
- If not exactly five coordinate axes are active.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(double value)
value
- The value to which every image element is to be set.public abstract void mirror(Borders borders)
borders
- Specifies the size of the border in each dimension.
java.lang.IllegalArgumentException
- If the given border size is larger than or equal to half the image size in any dimension.
java.lang.NullPointerException
- If borders
is null
.public abstract void set(Borders borders, double value)
borders
- Specifies the size of the border in each dimension.value
- The value to which every border element is to be set.
java.lang.IllegalArgumentException
- If the given border size is larger than half the image size in any dimension.
java.lang.NullPointerException
- If the first parameter is null
.public abstract void set(Coordinates coords, double value)
coords
- The coordinates of the image element to be set. Coordinates must be within the range determined by the image size. For consistency with the other set
methods, none of the Cartesian coordinate axes should be active. However, this condition is not strictly necessary in order for this method to behave unambiguously and is therefore not checked, so as to increase efficiency.value
- The value to which the image element is to be set.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates is out of range.
java.lang.NullPointerException
- If coords
is null
.public abstract void set(Coordinates coords, float[] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinate corresponding to the active axis is allowed to be outside the range determined by the image size in the corresponding dimension. Out-of-range positions in the active dimension are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If more than one coordinate axis is active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, double[] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinate corresponding to the active axis is allowed to be outside the range determined by the image size in the corresponding dimension. Out-of-range positions in the active dimension are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If more than one coordinate axis is active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, float[][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly two coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, double[][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly two coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, float[][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly three coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, double[][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly three coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If any of the coordinates corresponding to the non-active axes is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, float[][][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly four coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If the coordinate corresponding to the non-active axis is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, double[][][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. The coordinates corresponding to the active axes are allowed to be outside the range determined by the image size in the corresponding dimensions. Out-of-range positions in the active dimensions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not exactly four coordinate axes are active.
java.lang.ArrayIndexOutOfBoundsException
- If the coordinate corresponding to the non-active axis is out of range.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, float[][][][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. Coordinates are allowed to be outside the range determined by the image size. Out-of-range positions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not all five coordinate axes are active.
java.lang.NullPointerException
- If any of the parameters is null
.public abstract void set(Coordinates coords, double[][][][][] values)
coords
- The coordinates of the starting position in the image for writing values into the image. Coordinates are allowed to be outside the range determined by the image size. Out-of-range positions are not actually written but simply skipped.values
- The array from which values are copied to the image.
java.lang.IllegalStateException
- If not all five coordinate axes are active.
java.lang.NullPointerException
- If any of the parameters is null
.public void absolute()
Math.abs()
from the Java language to every image element.
public void add(double value)
value
- The value to be added to every image element.public void add(Image image)
image
- The image to be added to this image.
java.lang.IllegalStateException
- If the dimensions of the given image are not equal to those of this image.
java.lang.NullPointerException
- If image
is null
.public void subtract(double value)
value
- The value to be subtracted from every image element.public void subtract(Image image)
image
- The image to be subtracted from this image.
java.lang.IllegalStateException
- If the dimensions of the given image are not equal to those of this image.
java.lang.NullPointerException
- If image
is null
.public void multiply(double value)
value
- The value to multiply every image element with.public void multiply(Image image)
image
- The image to multiply this image with.
java.lang.IllegalStateException
- If the dimensions of the given image are not equal to those of this image.
java.lang.NullPointerException
- If image
is null
.public void divide(double value)
value
- The value to divide every image element by.public void divide(Image image)
image
- The image to divide this image by.
java.lang.IllegalStateException
- If the dimensions of the given image are not equal to those of this image.
java.lang.NullPointerException
- If image
is null
.public void square()
public void squareroot()
Math.sqrt()
from the Java language to every image element.
public void power(double power)
Math.pow()
from the Java language to every image element.
power
- The power to raise every image element to.public void invert()
public void name(java.lang.String name)
name
- The new name of the image. If this parameter is null
, it is replaced by an empty string.public java.lang.String name()
|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.
IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.