volume
Class HyperVolume

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

public class HyperVolume
extends Volume
implements java.io.Serializable

This is a class that implements a float hyper (4D) volumes and operations including convolutions on it. A hypervolume has dimensions width*height*depth*length, with convenient indices of x,y,z,t. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.

See Also:
Serialized Form

Field Summary
 float[][][][] hv
           
protected  int length
           
 
Fields inherited from class volume.Volume
aspectx, aspecty, aspectz, depth, edge, height, width
 
Constructor Summary
HyperVolume()
          Creates the null hypervolume.
HyperVolume(ij.ImageStack is, int depth)
          Create a new hypervolume from a stack of volumes.
HyperVolume(ij.ImageStack is, int depth, int center, int n, Kernel1D kernel)
          Creates a hypervolume depthxn from a stack containing n volumes of depth depth and convolve around center with a filtering kernel on the fly.
HyperVolume(int width, int height, int depth, int length)
          Creates a hypervolume with width, height, depth, length
 
Method Summary
 void convolvet(HyperVolume hv1, Kernel1D kernel)
          Compute separated 1d convolution: hv=hv1*kernel in t dimension.
 void convolvet(HyperVolume hv1, Kernel3D kernel)
          Compute separated 3d convolution: hv=hv1*kernel in t dimension.
 void convolvet(Kernel1D kernel)
          Compute separated 1d convolution: hv=hv1*kernel in t dimension in place.
 void convolvex(HyperVolume hv1, Kernel1D kernel)
          Compute separated 1d convolution: v=v1*kernel in y dimension.
 void convolvex(HyperVolume hv1, Kernel3D kernel)
          Compute separated 3d convolution: hv=hv1*kernel in x dimension.
 void convolvexyz(Kernel1D kernel)
          Convolve the hypervolume by kernel in xyz in place (so no extra hypervolume needed).
 void convolvey(HyperVolume hv1, Kernel1D kernel)
          Compute separated 1d convolution: hv=hv1*kernel in y dimension.
 void convolvey(HyperVolume hv1, Kernel3D kernel)
          Compute separated 3d convolution: hv=hv1*kernel in y dimension.
 void convolvez(HyperVolume hv1, Kernel1D kernel)
          Compute separated 1d convolution: hv=hv1*kernel in z dimension.
 void convolvez(HyperVolume hv1, Kernel3D kernel)
          Compute separated 3d convolution: hv=hv1*kernel in z dimension.
 java.lang.Object get(int x, int y, int z)
          Get the vector value of the hypervolume that is at x,y,z.
 int getLength()
           
 void intoStack(ij.ImageStack is)
          Transfer hv into stack is.
 void mul(double constant)
          Multiply all voxels in this hypervolume by a constant.
 void mul(HyperVolume a, HyperVolume b)
          Multiply all voxels in this hypervolume by the voxels in b (NOT the inner product).
 void set(java.lang.Object value, int x, int y, int z)
          Set the vector value of the hypervolume that is at x,y,z to value.
 ij.ImageStack toStack()
          Convert this hypervolume to a stack.
 java.lang.String toString()
          Return a string describing the volume.
 boolean valid(int x, int y, int z, int t)
           
 
Methods inherited from class volume.Volume
discreteSupport, getAspectx, getAspecty, getAspectz, getDepth, getEdge, getHeight, getWidth, in, setAspects, setEdge, valid, valid
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hv

public float[][][][] hv

length

protected int length
Constructor Detail

HyperVolume

public HyperVolume()
Creates the null hypervolume.

HyperVolume

public HyperVolume(int width,
                   int height,
                   int depth,
                   int length)
Creates a hypervolume with width, height, depth, length

HyperVolume

public HyperVolume(ij.ImageStack is,
                   int depth)
Create a new hypervolume from a stack of volumes. No convolution. Each volume has a depth of depth (slices).
Parameters:
is - and ImageJ ImageStack containing the slices.
depth - the depth of each volume in the hypervolume.

HyperVolume

public HyperVolume(ij.ImageStack is,
                   int depth,
                   int center,
                   int n,
                   Kernel1D kernel)
Creates a hypervolume depthxn from a stack containing n volumes of depth depth and convolve around center with a filtering kernel on the fly. All n volumes will have depth slices.
Parameters:
is - and ImageJ ImageStack containing the slices.
depth - the depth of each volume in the hypervolume.
center - the index of the slice around which to convolve.
n - the number of volumes in this hypervolume.
kernel - the convolution kernel.
Method Detail

get

public java.lang.Object get(int x,
                            int y,
                            int z)
Get the vector value of the hypervolume that is at x,y,z.
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:
a Number with the voxel value at x,y,z

set

public void set(java.lang.Object value,
                int x,
                int y,
                int z)
Set the vector value of the hypervolume that is at x,y,z to value.
Overrides:
set 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

toStack

public ij.ImageStack toStack()
Convert this hypervolume to a stack. It scales automatically.

getLength

public int getLength()

valid

public boolean valid(int x,
                     int y,
                     int z,
                     int t)

convolvet

public void convolvet(Kernel1D kernel)
Compute separated 1d convolution: hv=hv1*kernel in t dimension in place. Center around center of this volume.

convolvet

public void convolvet(HyperVolume hv1,
                      Kernel1D kernel)
Compute separated 1d convolution: hv=hv1*kernel in t dimension. Center around center of this volume.

convolvez

public void convolvez(HyperVolume hv1,
                      Kernel1D kernel)
Compute separated 1d convolution: hv=hv1*kernel in z dimension. Center around center of this hypervolume.

convolvey

public void convolvey(HyperVolume hv1,
                      Kernel1D kernel)
Compute separated 1d convolution: hv=hv1*kernel in y dimension. Center around center of this volume.

convolvex

public void convolvex(HyperVolume hv1,
                      Kernel1D kernel)
Compute separated 1d convolution: v=v1*kernel in y dimension. Center around center of this volume.

convolvet

public void convolvet(HyperVolume hv1,
                      Kernel3D kernel)
Compute separated 3d convolution: hv=hv1*kernel in t dimension. Center around center of this volume. Disregard the z dimension.

convolvez

public void convolvez(HyperVolume hv1,
                      Kernel3D kernel)
Compute separated 3d convolution: hv=hv1*kernel in z dimension. Center around center of this volume. Disregard the t dimension.

convolvey

public void convolvey(HyperVolume hv1,
                      Kernel3D kernel)
Compute separated 3d convolution: hv=hv1*kernel in y dimension. Center around center of this volume. Disregard the t dimension.

convolvex

public void convolvex(HyperVolume hv1,
                      Kernel3D kernel)
Compute separated 3d convolution: hv=hv1*kernel in x dimension. Center around center of this volume. Disregard the t dimension.

convolvexyz

public void convolvexyz(Kernel1D kernel)
Convolve the hypervolume by kernel in xyz in place (so no extra hypervolume needed).

mul

public void mul(double constant)
Multiply all voxels in this hypervolume by a constant.

mul

public void mul(HyperVolume a,
                HyperVolume b)
Multiply all voxels in this hypervolume by the voxels in b (NOT the inner product).

intoStack

public void intoStack(ij.ImageStack is)
Transfer hv into stack is.

toString

public java.lang.String toString()
Description copied from class: Volume
Return a string describing the volume.
Overrides:
toString in class Volume