ImageScience 3.0.0

imagescience.image
Class Image

java.lang.Object
  extended by imagescience.image.Image
Direct Known Subclasses:
ByteImage, ColorImage, FloatImage, ShortImage

public abstract class Image
extends java.lang.Object

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

type

public abstract java.lang.String type()
Returns the image type.

Returns:
The image type. The returned String contains the fully qualified name of the subclass which this image is an object of.

border

public abstract Image border(Borders borders)
Returns a bordered copy of this image.

Parameters:
borders - Specifies the border size in each dimension.
Returns:
A bordered copy of this image. All information is copied to the newly created image and no memory is shared.
Throws:
java.lang.NullPointerException - If borders is null.

create

public static Image create(Dimensions dims,
                           java.lang.String type)
Creates a new Image of given dimensions and type.

Parameters:
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.
Returns:
A new Image of given dimensions and type.
Throws:
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.

wrap

public static Image wrap(ij.ImagePlus imageplus)
Creates a wrapper Image of the given ImagePlus object. This is done by checking the element type and calling the wrapper constructor of the corresponding Image subclass.

Parameters:
imageplus - The ImagePlus object whose image data is to be wrapped.
Returns:
A wrapper Image object of the given ImagePlus object. The two objects share the actual image data.
Throws:
java.lang.IllegalArgumentException - If the elements of imageplus are of a non-supported type.
java.lang.NullPointerException - If imageplus is null.

imageplus

public abstract ij.ImagePlus imageplus()
Returns this image in the form of an ImagePlus object.

Returns:
A new ImagePlus object of this Image object. The two objects share the actual image data.

elements

public int elements()
Returns the number of elements in the image.

Returns:
The number of elements in the image.

aspects

public void aspects(Aspects aspects)
Sets the aspect sizes of the image elements.

Parameters:
aspects - Specifies the aspect size in each dimension.
Throws:
java.lang.NullPointerException - If aspects is null.

aspects

public Aspects aspects()
Returns the aspect sizes of the image elements.

Returns:
The aspect sizes of the image elements.

id

public int id()
Returns the image's ID.

Returns:
The image's ID. Image IDs are positive integer numbers.

memory

public abstract int memory()
Returns the amount of memory occupied by the image data.

Returns:
The amount of memory occupied by the image data. The amount is expressed in bytes.

dimensions

public Dimensions dimensions()
Returns the dimensions of the image.

Returns:
The dimensions of the image.

duplicate

public abstract Image duplicate()
Duplicates this image.

Returns:
A new 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.

extrema

public double[] extrema()
Returns the extreme values in the image.

Returns:
A new array containing the extreme values in the image. The array contains only two elements:
[0] = the minimum value in the image,
[1] = the maximum value in the image.

minimum

public double minimum()
Returns the minimum value in the image.

Returns:
The minimum value in the image.

maximum

public double maximum()
Returns the maximum value in the image.

Returns:
The maximum value in the image.

axes

public void axes(int axes)
Sets the currently active Cartesian coordinate axis or axes. This method affects the operation of the get and set methods for reading and writing values.

Parameters:
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.
Throws:
java.lang.IllegalArgumentException - If axes does not correspond to a valid combination of axes.

axes

public int axes()
Returns the current Cartesian coordinate axes activity.

Returns:
An integer number indicating which axes are currently active. The returned value is one or a combination (by addition) of Axes.X, Axes.Y, Axes.Z, Axes.T, Axes.C.

get

public abstract double get(Coordinates coords)
Returns the value of the image element at the given coordinates.

Parameters:
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.
Returns:
The value of the image element at the given coordinates.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If any of the coordinates is out of range.
java.lang.NullPointerException - If coords is null.

get

public abstract void get(Coordinates coords,
                         float[] values)
Reads values in one dimension from the image into the array. The dimension from which values are read is determined by the currently active Cartesian coordinate axis. Exactly one axis must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         double[] values)
Reads values in one dimension from the image into the array. The dimension from which values are read is determined by the currently active Cartesian coordinate axis. Exactly one axis must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         float[][] values)
Reads values in two dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly two axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         double[][] values)
Reads values in two dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly two axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         float[][][] values)
Reads values in three dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly three axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         double[][][] values)
Reads values in three dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly three axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         float[][][][] values)
Reads values in four dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly four axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         double[][][][] values)
Reads values in four dimensions from the image into the array. The dimensions from which values are read are determined by the currently active Cartesian coordinate axes. Exactly four axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

get

public abstract void get(Coordinates coords,
                         float[][][][][] values)
Reads values in all five dimensions from the image into the array. All five axes must be active in order for this method to work.

Parameters:
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.
Throws:
java.lang.IllegalStateException - If not exactly five coordinate axes are active.
java.lang.NullPointerException - If any of the parameters is null.

get

public abstract void get(Coordinates coords,
                         double[][][][][] values)
Reads values in all five dimensions from the image into the array. All five axes must be active in order for this method to work.

Parameters:
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.
Throws:
java.lang.IllegalStateException - If not exactly five coordinate axes are active.
java.lang.NullPointerException - If any of the parameters is null.

set

public abstract void set(double value)
Sets every image element to the given value.

Parameters:
value - The value to which every image element is to be set.

mirror

public abstract void mirror(Borders borders)
Sets the image elements in the borders by mirroring the remainder of the image.

Parameters:
borders - Specifies the size of the border in each dimension.
Throws:
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.

set

public abstract void set(Borders borders,
                         double value)
Sets every image element in the borders to the given value.

Parameters:
borders - Specifies the size of the border in each dimension.
value - The value to which every border element is to be set.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         double value)
Sets the image element at the given coordinates to the given value.

Parameters:
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.
Throws:
java.lang.ArrayIndexOutOfBoundsException - If any of the coordinates is out of range.
java.lang.NullPointerException - If coords is null.

set

public abstract void set(Coordinates coords,
                         float[] values)
Writes values in one dimension from the array into the image. The dimension into which values are written is determined by the currently active Cartesian coordinate axis. Exactly one axis must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         double[] values)
Writes values in one dimension from the array into the image. The dimension into which values are written is determined by the currently active Cartesian coordinate axis. Exactly one axis must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         float[][] values)
Writes values in two dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly two axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         double[][] values)
Writes values in two dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly two axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         float[][][] values)
Writes values in three dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly three axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         double[][][] values)
Writes values in three dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly three axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         float[][][][] values)
Writes values in four dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly four axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         double[][][][] values)
Writes values in four dimensions from the array into the image. The dimensions into which values are written are determined by the currently active Cartesian coordinate axes. Exactly four axes must be active in order for this method to work.

Parameters:
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.
Throws:
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.

set

public abstract void set(Coordinates coords,
                         float[][][][][] values)
Writes values in all five dimensions from the array into the image. All five axes must be active in order for this method to work.

Parameters:
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.
Throws:
java.lang.IllegalStateException - If not all five coordinate axes are active.
java.lang.NullPointerException - If any of the parameters is null.

set

public abstract void set(Coordinates coords,
                         double[][][][][] values)
Writes values in all five dimensions from the array into the image. All five axes must be active in order for this method to work.

Parameters:
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.
Throws:
java.lang.IllegalStateException - If not all five coordinate axes are active.
java.lang.NullPointerException - If any of the parameters is null.

absolute

public void absolute()
Replaces every image element by its absolute value. This is done simply by applying method Math.abs() from the Java language to every image element.


add

public void add(double value)
Adds a value to every image element.

Parameters:
value - The value to be added to every image element.

add

public void add(Image image)
Adds an image element-by-element to this image.

Parameters:
image - The image to be added to this image.
Throws:
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.

subtract

public void subtract(double value)
Subtracts a value from every image element.

Parameters:
value - The value to be subtracted from every image element.

subtract

public void subtract(Image image)
Subtracts an image element-by-element from this image.

Parameters:
image - The image to be subtracted from this image.
Throws:
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.

multiply

public void multiply(double value)
Multiplies every image element with a value.

Parameters:
value - The value to multiply every image element with.

multiply

public void multiply(Image image)
Multiplies this image element-by-element with an image.

Parameters:
image - The image to multiply this image with.
Throws:
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.

divide

public void divide(double value)
Divides every image element by a value.

Parameters:
value - The value to divide every image element by.

divide

public void divide(Image image)
Divides this image element-by-element by an image.

Parameters:
image - The image to divide this image by.
Throws:
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.

square

public void square()
Replaces every image element by its square value.


squareroot

public void squareroot()
Replaces every image element by its square root value. This is done simply by applying the method Math.sqrt() from the Java language to every image element.


power

public void power(double power)
Replaces every image element by its value raised to a power. This is done simply by applying the method Math.pow() from the Java language to every image element.

Parameters:
power - The power to raise every image element to.

invert

public void invert()
Replaces every image element by its inverted value. Inversion is constrained to the range defined by the minimum and the maximum value in the image. That is, after this operation, the original minimum has become the maximum, and vice versa, with all other values transformed accordingly.


name

public void name(java.lang.String name)
Sets the name of this image.

Parameters:
name - The new name of the image. If this parameter is null, it is replaced by an empty string.

name

public java.lang.String name()
Returns the name of this image.

Returns:
The name of this image.

ImageScience 3.0.0

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.