ImageScience 3.0.0

imagescience.utility
Class I5DResource

java.lang.Object
  extended by imagescience.utility.I5DResource

public class I5DResource
extends java.lang.Object

Provides Image5D utility methods. Use of this class requires the Image5D package to be installed.


Field Summary
static int COLOR
          The color displaying mode.
static int GRAY
          The gray-scale displaying mode.
static int OVERLAY
          The overlay displaying mode.
static int TILED
          The tiled displaying mode.
 
Constructor Summary
I5DResource()
          Default constructor.
 
Method Summary
static ij.ImagePlus convert(ij.ImagePlus image, boolean properties)
          Converts an image to an Image5D object.
static ij.measure.Calibration density(ij.ImagePlus image, int channel)
          Returns the density calibration of a specific channel of an image.
static boolean instance(ij.ImagePlus image)
          Indicates whether an image is an instance of Image5D.
static void minmax(ij.ImagePlus image, double min, double max)
          Sets the minimum and maximum displayed value of all channels of an image.
static void mode(ij.ImagePlus image, int mode)
          Sets the displaying mode of an image.
static void nocolor(ij.ImagePlus image)
          Disables the color model of all channels of an image.
static void nodensity(ij.ImagePlus image)
          Disables the density calibration of all channels of an image.
static int position(ij.ImagePlus image, int dimension)
          Returns the current position of an image in a specific dimension.
static void position(ij.ImagePlus image, int dimension, int position)
          Sets the position of an image in a specific dimension.
static void position(ij.ImagePlus image, int x, int y, int c, int z, int t)
          Sets the position of an image in each dimension.
static ij.process.ImageProcessor processor(ij.ImagePlus image, int channel)
          Returns the processor of a specific channel of an image.
static void transfer(ij.ImagePlus source, ij.ImagePlus destination)
          Transfers all channel properties from source to destination image.
static void transfer(ij.ImagePlus source, ij.ImagePlus destination, int channel)
          Transfers the properties of a specific source image channel to the current processor and stack of a destination image.
static void transfer(ij.ImagePlus source, ij.ImagePlus destination, int[][] channels)
          Transfers the properties of specific channels from source to destination image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAY

public static final int GRAY
The gray-scale displaying mode.

See Also:
Constant Field Values

COLOR

public static final int COLOR
The color displaying mode.

See Also:
Constant Field Values

OVERLAY

public static final int OVERLAY
The overlay displaying mode.

See Also:
Constant Field Values

TILED

public static final int TILED
The tiled displaying mode.

See Also:
Constant Field Values
Constructor Detail

I5DResource

public I5DResource()
Default constructor.

Method Detail

mode

public static void mode(ij.ImagePlus image,
                        int mode)
Sets the displaying mode of an image.

Parameters:
image - The image.
mode - The displaying mode. Must be one of GRAY, COLOR, OVERLAY, TILED.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object or if mode is invalid.
java.lang.NullPointerException - If image is null.

density

public static ij.measure.Calibration density(ij.ImagePlus image,
                                             int channel)
Returns the density calibration of a specific channel of an image.

Parameters:
image - The image.
channel - The channel number. Must be larger than or equal to 1 and less than or equal to the number of channels.
Returns:
The density calibration of the given channel of the given image.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object or if channel is out of range.
java.lang.NullPointerException - If image is null.

instance

public static boolean instance(ij.ImagePlus image)
Indicates whether an image is an instance of Image5D.

Parameters:
image - The image whose identity is to be tested.
Returns:
Value true if image is an instance of Image5D, or false if this is not the case.

position

public static int position(ij.ImagePlus image,
                           int dimension)
Returns the current position of an image in a specific dimension.

Parameters:
image - The image.
dimension - The dimension. Must be 0 (x), 1 (y), 2 (c), 3 (z), or 4 (t).
Returns:
The current position of the given image in the given dimension.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object.
java.lang.ArrayIndexOutOfBoundsException - If dimension is out of range.
java.lang.NullPointerException - If image is null.

position

public static void position(ij.ImagePlus image,
                            int dimension,
                            int position)
Sets the position of an image in a specific dimension.

Parameters:
image - The image.
dimension - The dimension. Must be 0 (x), 1 (y), 2 (c), 3 (z), or 4 (t).
position - The position. Should be larger than or equal to 0 and less than N, where N is the size of the image in the specified dimension. Values outside this range are simply ignored (no exception is generated).
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object, or if dimension is out of range.
java.lang.NullPointerException - If image is null.

position

public static void position(ij.ImagePlus image,
                            int x,
                            int y,
                            int c,
                            int z,
                            int t)
Sets the position of an image in each dimension.

Parameters:
image - The image.
x - y - c - z - t - The position in, respectively, the x, y, c, z, and t dimension. Should be larger than or equal to 0 and less than N, where N is the size of the image in the corresponding dimension. Values outside this range are simply ignored (no exception is generated).
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object.
java.lang.NullPointerException - If image is null.

processor

public static ij.process.ImageProcessor processor(ij.ImagePlus image,
                                                  int channel)
Returns the processor of a specific channel of an image.

Parameters:
image - The image.
channel - The channel number. Must be larger than or equal to 1 and less than or equal to the number of channels.
Returns:
The processor of the given channel of the given image.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object, or if channel is out of range.
java.lang.NullPointerException - If image is null.

convert

public static ij.ImagePlus convert(ij.ImagePlus image,
                                   boolean properties)
Converts an image to an Image5D object.

Parameters:
image - The image to be converted.
properties - If true, the density calibration, color model, and window/level settings of image are copied to every channel of the new Image5D object; if false, these properties assume their default values.
Returns:
An Image5D version of the given image. Returns the given image directly if it is already an Image5D object. Otherwise it converts the image to a new Image5D object.
Throws:
java.lang.IllegalArgumentException - If image is not a gray-level image or if the ImageJ version is not supported.
java.lang.NullPointerException - If image is null.

minmax

public static void minmax(ij.ImagePlus image,
                          double min,
                          double max)
Sets the minimum and maximum displayed value of all channels of an image.

Parameters:
image - The image whose minimum and maximum displayed values are to be set.
min - The minimum value to be displayed.
max - The maximum value to be displayed.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object.
java.lang.NullPointerException - If image is null.

transfer

public static void transfer(ij.ImagePlus source,
                            ij.ImagePlus destination)
Transfers all channel properties from source to destination image. These include both the display properties and the calibration properties.

Parameters:
source - The source image from which channel properties are to be copied.
destination - The destination image to which channel properties are to be copied.
Throws:
java.lang.IllegalArgumentException - If source or destination is not an Image5D object, or if they do not have an equal number of channels.
java.lang.NullPointerException - If source or destination is null.

transfer

public static void transfer(ij.ImagePlus source,
                            ij.ImagePlus destination,
                            int[][] channels)
Transfers the properties of specific channels from source to destination image. These include both the display properties and the calibration properties.

Parameters:
source - The source image from which channel properties are to be copied.
destination - The destination image to which channel properties are to be copied.
channels - A double array containing the source and destination channel indices. The channels[0] array contains the channel indices of the source image, and the channels[1] array the corresponding channel indices of the destination image. Channel indices may range from 1 to the number of channels (inclusive).
Throws:
java.lang.IllegalArgumentException - If source or destination is not an Image5D object, if the channels[0] and channels[1] arrays have different lengths, or if any of the indices in these arrays is out of range.
java.lang.NullPointerException - If any of the parameters is null.

transfer

public static void transfer(ij.ImagePlus source,
                            ij.ImagePlus destination,
                            int channel)
Transfers the properties of a specific source image channel to the current processor and stack of a destination image. These include both the display properties and the calibration properties.

Parameters:
source - The source image from which channel properties are to be copied.
destination - The destination image to which channel properties are to be copied.
channel - The source channel index. Must be larger than or equal to 1 and less than or equal to the number of channels.
Throws:
java.lang.IllegalArgumentException - If source is not an Image5D object, or if channel is out of range.
java.lang.NullPointerException - If source or destination is null.

nodensity

public static void nodensity(ij.ImagePlus image)
Disables the density calibration of all channels of an image.

Parameters:
image - The image whose density calibrations are to be disabled.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object.
java.lang.NullPointerException - If image is null.

nocolor

public static void nocolor(ij.ImagePlus image)
Disables the color model of all channels of an image. The color model of each channel is set to the gray-scale color model.

Parameters:
image - The image whose color models are to be disabled.
Throws:
java.lang.IllegalArgumentException - If image is not an Image5D object.
java.lang.NullPointerException - If image is null.

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.