ImageScience 3.0.0

imagescience.image
Class FloatImage

java.lang.Object
  extended by imagescience.image.Image
      extended by imagescience.image.FloatImage

public class FloatImage
extends Image

An image containing up to 5D elements of type float. Conversion of double-precision floating-point numbers in the set methods is done simply by casting.


Constructor Summary
FloatImage(Dimensions dims)
          Dimensions constructor.
FloatImage(Image image)
          Copy constructor.
FloatImage(Image image, Borders borders)
          Copy constructor that allows adding borders.
FloatImage(ij.ImagePlus imageplus)
          Wrapper constructor.
 
Method Summary
 Image border(Borders borders)
          Returns a bordered copy of this image.
 Image duplicate()
          Duplicates this image.
 double get(Coordinates coords)
          Returns the value of the image element at the given coordinates.
 void get(Coordinates coords, double[] values)
          Reads values in one dimension from the image into the array.
 void get(Coordinates coords, double[][] values)
          Reads values in two dimensions from the image into the array.
 void get(Coordinates coords, double[][][] values)
          Reads values in three dimensions from the image into the array.
 void get(Coordinates coords, double[][][][] values)
          Reads values in four dimensions from the image into the array.
 void get(Coordinates coords, double[][][][][] values)
          Reads values in all five dimensions from the image into the array.
 void get(Coordinates coords, float[] values)
          Reads values in one dimension from the image into the array.
 void get(Coordinates coords, float[][] values)
          Reads values in two dimensions from the image into the array.
 void get(Coordinates coords, float[][][] values)
          Reads values in three dimensions from the image into the array.
 void get(Coordinates coords, float[][][][] values)
          Reads values in four dimensions from the image into the array.
 void get(Coordinates coords, float[][][][][] values)
          Reads values in all five dimensions from the image into the array.
 ij.ImagePlus imageplus()
          Returns this image in the form of an ImagePlus object.
 int memory()
          Returns the amount of memory occupied by the image data.
 void mirror(Borders borders)
          Sets the image elements in the borders by mirroring the remainder of the image.
 void set(Borders borders, double value)
          Sets every image element in the borders to the given value.
 void set(Coordinates coords, double value)
          Sets the image element at the given coordinates to the given value.
 void set(Coordinates coords, double[] values)
          Writes values in one dimension from the array into the image.
 void set(Coordinates coords, double[][] values)
          Writes values in two dimensions from the array into the image.
 void set(Coordinates coords, double[][][] values)
          Writes values in three dimensions from the array into the image.
 void set(Coordinates coords, double[][][][] values)
          Writes values in four dimensions from the array into the image.
 void set(Coordinates coords, double[][][][][] values)
          Writes values in all five dimensions from the array into the image.
 void set(Coordinates coords, float[] values)
          Writes values in one dimension from the array into the image.
 void set(Coordinates coords, float[][] values)
          Writes values in two dimensions from the array into the image.
 void set(Coordinates coords, float[][][] values)
          Writes values in three dimensions from the array into the image.
 void set(Coordinates coords, float[][][][] values)
          Writes values in four dimensions from the array into the image.
 void set(Coordinates coords, float[][][][][] values)
          Writes values in all five dimensions from the array into the image.
 void set(double value)
          Sets every image element to the given value.
 java.lang.String type()
          Returns the image type.
 
Methods inherited from class imagescience.image.Image
absolute, add, add, aspects, aspects, axes, axes, create, dimensions, divide, divide, elements, extrema, id, invert, maximum, minimum, multiply, multiply, name, name, power, square, squareroot, subtract, subtract, wrap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatImage

public FloatImage(Dimensions dims)
Dimensions constructor.

Parameters:
dims - The dimensions of the new image.
Throws:
java.lang.NullPointerException - If dims is null.

FloatImage

public FloatImage(ij.ImagePlus imageplus)
Wrapper constructor.

Parameters:
imageplus - The ImagePlus object whose image data is to be wrapped. The actual image data is not copied but shared.
Throws:
java.lang.IllegalArgumentException - If the image elements of imageplus are not of type float.
java.lang.NullPointerException - If imageplus is null.

FloatImage

public FloatImage(Image image)
Copy constructor.

Parameters:
image - The image to copy from. Image element values are copied using a get method of the given image and the corresponding set method of this image. This enables copying from images that are of different type than this image. Be aware, however, of the value conversion rules of the respective methods when copying from images that are not of the same type as this image.
Throws:
java.lang.NullPointerException - If image is null.

FloatImage

public FloatImage(Image image,
                  Borders borders)
Copy constructor that allows adding borders. Creates a new image whose size in each dimension is equal to that of the given image plus twice the given border size in that dimension.

Parameters:
image - The image to copy from. Image element values are copied using a get method of the given image and the corresponding set method of this image, taking into account the new border sizes. This enables copying from images that are of a different type than this image. Be aware, however, of the value conversion rules of the respective methods when copying from images that are not of the same type as this image.
borders - Specifies the border size in each dimension of the new image.
Throws:
java.lang.NullPointerException - If any of the parameters is null.
Method Detail

border

public Image border(Borders borders)
Description copied from class: Image
Returns a bordered copy of this image.

Specified by:
border in class 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.

imageplus

public ij.ImagePlus imageplus()
Description copied from class: Image
Returns this image in the form of an ImagePlus object.

Specified by:
imageplus in class Image
Returns:
A new ImagePlus object of this Image object. The two objects share the actual image data.

type

public java.lang.String type()
Description copied from class: Image
Returns the image type.

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

memory

public int memory()
Description copied from class: Image
Returns the amount of memory occupied by the image data.

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

duplicate

public Image duplicate()
Description copied from class: Image
Duplicates this image.

Specified by:
duplicate in class 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.

get

public double get(Coordinates coords)
Description copied from class: Image
Returns the value of the image element at the given coordinates.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                double[] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                double[][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                double[][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                double[][][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                double[][][][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                float[] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                float[][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                float[][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                float[][][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

get

public void get(Coordinates coords,
                float[][][][][] values)
Description copied from class: Image
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.

Specified by:
get in class Image
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.

set

public void set(double value)
Description copied from class: Image
Sets every image element to the given value.

Specified by:
set in class Image
Parameters:
value - The value to which every image element is to be set.

mirror

public void mirror(Borders borders)
Description copied from class: Image
Sets the image elements in the borders by mirroring the remainder of the image.

Specified by:
mirror in class Image
Parameters:
borders - Specifies the size of the border in each dimension.

set

public void set(Borders borders,
                double value)
Description copied from class: Image
Sets every image element in the borders to the given value.

Specified by:
set in class Image
Parameters:
borders - Specifies the size of the border in each dimension.
value - The value to which every border element is to be set.

set

public void set(Coordinates coords,
                double value)
Description copied from class: Image
Sets the image element at the given coordinates to the given value.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                double[] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                double[][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                double[][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                double[][][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                double[][][][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                float[] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                float[][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                float[][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                float[][][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

set

public void set(Coordinates coords,
                float[][][][][] values)
Description copied from class: Image
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.

Specified by:
set in class Image
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.

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.