volume
Class VolumeFloat

java.lang.Object
  |
  +--volume.Volume
        |
        +--volume.VolumeFloat
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
VolumeIO

public class VolumeFloat
extends Volume

This class implements float volumes and operations including convolutions on it. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.

See Also:
Serialized Form

Field Summary
 float[][][] v
           
 
Fields inherited from class volume.Volume
aspectx, aspecty, aspectz, depth, edge, height, width
 
Constructor Summary
VolumeFloat()
          creates the null volume.
VolumeFloat(float[][][] fv)
          Creates a float volume from a float vector with the same contents.
VolumeFloat(ij.process.ImageProcessor ip)
          Creates a float volume 1 voxel deep from the contents of an ImageJ ImageProcessor.
VolumeFloat(ij.ImageStack s)
          Creates a float volume from an ImageJ ImageStack.
VolumeFloat(ij.ImageStack s, double aspectx, double aspecty, double aspectz)
          Creates a float volume from an ImageJ ImageStack.
VolumeFloat(ij.ImageStack s, int depth, int n)
          Creates a float volume from an ImageJ ImageStack.
VolumeFloat(ij.ImageStack s, int depth, int n, double aspectx, double aspecty, double aspectz)
          Creates a float volume from an ImageJ ImageStack.
VolumeFloat(int width, int height, int depth)
          Creates a float volume of defined size and default aspect ratios.
VolumeFloat(int width, int height, int depth, double aspectx, double aspecty, double aspectz)
          Creates a float volume of defined size and aspect ratio.
VolumeFloat(VolumeFloat v1)
          Creates a float volume which is an exact copy of vl.
 
Method Summary
 void add(VolumeFloat v1)
           
 void convolvet(ij.ImageStack s, int center, Kernel1D kernel)
          Load a volume from a ImageStack, convert to float and do 1D z convolution on the fly.
 void convolvex(VolumeFloat v1, Kernel1D kernel)
           
 void convolvex(VolumeFloat v1, Kernel2D kernel)
           
 void convolvex(VolumeFloat v1, Kernel3D kernel)
           
 void convolvexy(Kernel1D kernel)
          2D xy convolution separated over x and y.
 void convolvexy(Kernel2D kernel)
           
 void convolvexyz(Kernel1D kernel)
          XYZ convolution with separated 1D kernel.
 void convolvexyz(Kernel3D kernel)
           
 void convolvey(VolumeFloat v1, Kernel1D kernel)
           
 void convolvey(VolumeFloat v1, Kernel2D kernel)
           
 void convolvey(VolumeFloat v1, Kernel3D kernel)
           
 void convolvez(VolumeFloat v1)
           
 void convolvez(VolumeFloat v1, Kernel1D kernel)
           
 void convolvez(VolumeFloat v1, Kernel2D kernel)
           
 void convolvez(VolumeFloat v1, Kernel3D kernel)
           
 void copy(VolumeFloat v1)
           
 float dx(int x, int y, int z, Kernel1D kernel)
           
 float dy(int x, int y, int z, Kernel1D kernel)
           
 float dz(int x, int y, int z, Kernel1D kernel)
           
 java.lang.Object get(int x, int y, int z)
          Get the voxel value as a Number.
 ij.ImageStack getImageStack()
           
 float[][][] getVolume()
           
 void intoStack(ij.ImageStack is)
           
 void load(ij.ImageStack s, int start)
           
 void loadInverse(ij.ImageStack s, int center)
           
 float[] map()
           
 void mul(double constant)
           
 void mul(VolumeFloat a)
           
 void mul(VolumeFloat a, VolumeFloat b)
           
 void set(java.lang.Object value, int x, int y, int z)
          Set the voxel value to a Number.
 void sqrt()
           
 void sub(VolumeFloat v1)
          Subtract volume v1 from this volume.
 float ux(int j, int i, Kernel2D kernel)
           
 float uy(int j, int i, Kernel2D kernel)
           
 
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

v

public float[][][] v
Constructor Detail

VolumeFloat

public VolumeFloat()
creates the null volume.

VolumeFloat

public VolumeFloat(int width,
                   int height,
                   int depth,
                   double aspectx,
                   double aspecty,
                   double aspectz)
Creates a float 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.

VolumeFloat

public VolumeFloat(int width,
                   int height,
                   int depth)
Creates a float volume of defined size and default aspect ratios.
Parameters:
width, - height, depth the dimensions of the volume

VolumeFloat

public VolumeFloat(VolumeFloat v1)
Creates a float volume which is an exact copy of vl.
Parameters:
vl - the VolumeFloat to be copied.

VolumeFloat

public VolumeFloat(ij.ImageStack s)
Creates a float volume from an ImageJ ImageStack.
Parameters:
s - the ImageStack to be used.

VolumeFloat

public VolumeFloat(ij.ImageStack s,
                   double aspectx,
                   double aspecty,
                   double aspectz)
Creates a float volume from an ImageJ ImageStack.
Parameters:
s - the ImageStack to be used.
aspectx, - aspecty, aspectz the aspect ratios of the volume dimensions.

VolumeFloat

public VolumeFloat(ij.ImageStack s,
                   int depth,
                   int n)
Creates a float volume from an ImageJ ImageStack. with depth slices from n * depth. This is used to extract the n-th volume from an ImageStack representing a hypervolume (multiple volumes in one stack).
Parameters:
s - the ImageStack to be used.
depth - the numebr of slices per volume.
n - the number of volumes in the hypervolume.

VolumeFloat

public VolumeFloat(float[][][] fv)
Creates a float volume from a float vector with the same contents.
Parameters:
fv - the array of float to be used.

VolumeFloat

public VolumeFloat(ij.ImageStack s,
                   int depth,
                   int n,
                   double aspectx,
                   double aspecty,
                   double aspectz)
Creates a float volume from an ImageJ ImageStack. with depth slices from n * depth. This is used to extract the n-th volume from an ImageStack representing a hypervolume (multiple volumes in one stack).
Parameters:
s - the ImageStack to be used.
depth - the numebr of slices per volume.
n - the number of volumes in the hypervolume.
aspectx, - aspecty, aspectz the aspect ratios of the volume dimensions.

VolumeFloat

public VolumeFloat(ij.process.ImageProcessor ip)
Creates a float volume 1 voxel deep from the contents of an ImageJ ImageProcessor.
Parameters:
ip - the ImageProcessor from which to obtain the voxels.
Method Detail

getVolume

public float[][][] getVolume()

get

public java.lang.Object get(int x,
                            int y,
                            int z)
Get the voxel value as a Number.
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 voxel value to a Number.
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

convolvet

public void convolvet(ij.ImageStack s,
                      int center,
                      Kernel1D kernel)
Load a volume from a ImageStack, convert to float and do 1D z convolution on the fly.
Parameters:
s - the ImageStack to use.
center - the index of the central slice in s.
kernel - the kernel to use for 1D convolution.

load

public void load(ij.ImageStack s,
                 int start)

loadInverse

public void loadInverse(ij.ImageStack s,
                        int center)

convolvexy

public void convolvexy(Kernel1D kernel)
2D xy convolution separated over x and y.

convolvexy

public void convolvexy(Kernel2D kernel)

convolvexyz

public void convolvexyz(Kernel3D kernel)

convolvexyz

public void convolvexyz(Kernel1D kernel)
XYZ convolution with separated 1D kernel.
Parameters:
kernel - a 1D convolution kernel.

convolvex

public void convolvex(VolumeFloat v1,
                      Kernel1D kernel)

convolvey

public void convolvey(VolumeFloat v1,
                      Kernel1D kernel)

convolvex

public void convolvex(VolumeFloat v1,
                      Kernel2D kernel)

convolvey

public void convolvey(VolumeFloat v1,
                      Kernel2D kernel)

convolvez

public void convolvez(VolumeFloat v1,
                      Kernel1D kernel)

convolvez

public void convolvez(VolumeFloat v1)

convolvez

public void convolvez(VolumeFloat v1,
                      Kernel2D kernel)

convolvex

public void convolvex(VolumeFloat v1,
                      Kernel3D kernel)

convolvey

public void convolvey(VolumeFloat v1,
                      Kernel3D kernel)

convolvez

public void convolvez(VolumeFloat v1,
                      Kernel3D kernel)

copy

public void copy(VolumeFloat v1)

add

public void add(VolumeFloat v1)

sub

public void sub(VolumeFloat v1)
Subtract volume v1 from this volume.

mul

public void mul(double constant)

mul

public void mul(VolumeFloat a,
                VolumeFloat b)

mul

public void mul(VolumeFloat a)

sqrt

public void sqrt()

dx

public float dx(int x,
                int y,
                int z,
                Kernel1D kernel)

dy

public float dy(int x,
                int y,
                int z,
                Kernel1D kernel)

dz

public float dz(int x,
                int y,
                int z,
                Kernel1D kernel)

ux

public float ux(int j,
                int i,
                Kernel2D kernel)

uy

public float uy(int j,
                int i,
                Kernel2D kernel)

map

public float[] map()

intoStack

public void intoStack(ij.ImageStack is)

getImageStack

public ij.ImageStack getImageStack()