volume
Class VolumeRGB

java.lang.Object
  |
  +--volume.Volume
        |
        +--volume.VolumeRGB
All Implemented Interfaces:
java.io.Serializable

public class VolumeRGB
extends Volume

This class implements RGB vector volumes. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.

See Also:
Serialized Form

Field Summary
 byte[] b
          The brightness of each voxel as a byte (0-225).
 byte[] index
          The index value for each voxel, if any.
 java.lang.Object[] sliceArray
          The slices for this volume with the actual RGB data.
 
Fields inherited from class volume.Volume
aspectx, aspecty, aspectz, depth, edge, height, width
 
Constructor Summary
VolumeRGB(int width, int height, int depth, double aspectx, double aspecty, double aspectz)
          Creates an RGB volume of defined size and aspect ratio.
VolumeRGB(java.lang.Object[] sliceArray, int width, int depth, double aspectx, double aspecty, double aspectz)
          Creates an RGB volume of defined aspect ratio from an array of slices.
 
Method Summary
static int ColorToInt(java.awt.Color color)
          Utility routine to convert a java Color to an ARGB int.
 java.lang.Object get(int x, int y, int z)
          Get the brightness of the voxel at x,y,z as an integer between 0-255.
 ij.ImageStack getImageStack()
          Make an ImageJ imagestack from the brightness info.
static float[] intToHSB(float[] hsb, int i)
          Utility routine to convert an ARGB int format to float [] HSB format.
 boolean isIndexed()
           
protected  void load(java.lang.Object[] sliceArray, int start)
          Fill the brightness volume b with the int[] slices, starting at slice start.
 void set(java.lang.Object value, int x, int y, int z)
          Set the brightness of the voxel at x,y,z as an integer between 0-255.
 void setIndex(java.lang.Object[] sliceArray)
          Combine the values of s into the index array of this volume.
 
Methods inherited from class volume.Volume
discreteSupport, getAspectx, getAspecty, getAspectz, getDepth, getEdge, getHeight, getWidth, in, setAspects, setEdge, toString, valid, valid
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

b

public byte[] b
The brightness of each voxel as a byte (0-225). This brightness derives from the HSB color model.

index

public byte[] index
The index value for each voxel, if any.

sliceArray

public java.lang.Object[] sliceArray
The slices for this volume with the actual RGB data.
Constructor Detail

VolumeRGB

public VolumeRGB(int width,
                 int height,
                 int depth,
                 double aspectx,
                 double aspecty,
                 double aspectz)
Creates an RGB volume of defined size and aspect ratio.
Parameters:
width -  
height -  
depth - the dimensions of the volume
aspectx -  
aspecty -  
aspectz - the aspect ratios of the volume dimensions.

VolumeRGB

public VolumeRGB(java.lang.Object[] sliceArray,
                 int width,
                 int depth,
                 double aspectx,
                 double aspecty,
                 double aspectz)
Creates an RGB volume of defined aspect ratio from an array of slices.
Parameters:
sliceArray - an array of Objects, which are int [] with each RGB voxel.
aspectx -  
aspecty -  
aspectz - the aspect ratios of the volume dimensions.
Method Detail

get

public java.lang.Object get(int x,
                            int y,
                            int z)
Get the brightness of the voxel at x,y,z as an integer between 0-255. The brightness is derived from the HSB color model.
Overrides:
get in class Volume
Parameters:
x - the x position of the voxel
y - the y position of the voxel
z - the z position of the voxel
Returns:
an Integer with the brightness converted to a value between 0 (0.0) and 255 (1.0)

set

public void set(java.lang.Object value,
                int x,
                int y,
                int z)
Set the brightness of the voxel at x,y,z as an integer between 0-255. The brightness is derived from the HSB color model.
Overrides:
set in class Volume
Parameters:
value - a Number with the brightness between 0 (0.0) and 255 (1.0)
x - the x position of the voxel
y - the y position of the voxel
z - the z position of the voxel

load

protected void load(java.lang.Object[] sliceArray,
                    int start)
Fill the brightness volume b with the int[] slices, starting at slice start.
Parameters:
sliceArray - an array of Objects, which are byte [] with the index value for each voxel.
start - the first slice to be loaded (starting with slice 1).

getImageStack

public ij.ImageStack getImageStack()
Make an ImageJ imagestack from the brightness info. For debugging purposes only.

intToHSB

public static float[] intToHSB(float[] hsb,
                               int i)
Utility routine to convert an ARGB int format to float [] HSB format.
Parameters:
hsb - a float[3] (at least) that will contain the HSB values on exit
i - a color in int ARGB format.

ColorToInt

public static int ColorToInt(java.awt.Color color)
Utility routine to convert a java Color to an ARGB int.
Parameters:
color - a Color.
Returns:
an int with color in int ARGB format.

setIndex

public void setIndex(java.lang.Object[] sliceArray)
Combine the values of s into the index array of this volume.
Parameters:
sliceArray - an array of Objects, which are byte [] with the index value for each voxel.

isIndexed

public boolean isIndexed()