volume
Class Convolver

java.lang.Object
  |
  +--volume.Convolver

public class Convolver
extends java.lang.Object

This class implements convolution operations on image planes and volumes. All convolutions mirror the edges to avoid edge effects. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.


Constructor Summary
Convolver()
           
 
Method Summary
static void convolvex(float[] volume, int width, int height, int depth, Kernel1D kernel)
          Convolution of float volume with symmetric 1D kernel in x dimension.
static float[] convolvex(float[] plane, int width, int height, Kernel1D kernel)
          Convolution of plane with 1D separated kernel along the x-axis.
static void convolvexy(float[] plane, int width, int height, Kernel1D kernel)
          Convolution of plane with 1D separated kernel.
static void convolvexy(float[] plane, int width, int height, Kernel2D kernel)
          Convolution of plane with symmetric 2D kernel in both directions.
static void convolvexy(short[] plane, int width, int height, Kernel1D kernel)
          Convolution of plane with 1D separated kernel.
static void convolvexyz(float[] volume, int width, int height, int depth, Kernel3D kernel)
          Convolution of float volume with symmetric 3D kernel in all dimensions.
static void convolvexyz(short[] volume, int width, int height, int depth, Kernel3D kernel)
          Convolution of short volume with symmetric 3D kernel in all dimensions.
static void convolvey(float[] volume, int width, int height, int depth, Kernel1D kernel)
          Convolution of float volume with symmetric 1D kernel in y dimension.
static float[] convolvey(float[] plane, int width, int height, Kernel1D kernel)
          Convolution of plane with 1D separated kernel along the y-axis.
static void convolvez(float[] volume, int width, int height, int depth, Kernel1D kernel)
          Convolution of float volume with symmetric 1D kernel in x dimension.
static void magConvolutionxy(float[] plane, int width, int height, Kernel1D kernel)
          Deprecated.  
static void magConvolutionxy(float[] plane, int width, int height, Kernel2D kernel)
          Deprecated.  
static void nonlinear(float[] image, double threshold)
          Deprecated.  
static void normalize(float[] plane, double threshold)
          Deprecated.  
static void pow(float[] image, double pow)
          Deprecated.  
static float[] subtract(float[] image1, float[] image2)
          Deprecated.  
static boolean valid(int width, int height, int x, int y, int edge)
           
static boolean valid(int width, int height, int depth, int x, int y, int z, int edge)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Convolver

public Convolver()
Method Detail

convolvexy

public static void convolvexy(float[] plane,
                              int width,
                              int height,
                              Kernel1D kernel)
Convolution of plane with 1D separated kernel. The image plane is organized as one 1D vector of width*height. plane is modified! Can process images masked using NaN values.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel1D kernel object.
See Also:
Kernel1D

convolvex

public static float[] convolvex(float[] plane,
                                int width,
                                int height,
                                Kernel1D kernel)
Convolution of plane with 1D separated kernel along the x-axis. The image plane is organized as one 1D vector of width*height. Return the result as a float array. plane is not touched.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel1D kernel object.
Returns:
a float[] with the resulting convolution.
See Also:
Kernel1D

convolvey

public static float[] convolvey(float[] plane,
                                int width,
                                int height,
                                Kernel1D kernel)
Convolution of plane with 1D separated kernel along the y-axis. The image plane is organized as one 1D vector of width*height. Return the result as a float array. plane is not touched.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel1D kernel object.
Returns:
a float[] with the resulting convolution.
See Also:
Kernel1D

convolvexy

public static void convolvexy(short[] plane,
                              int width,
                              int height,
                              Kernel1D kernel)
Convolution of plane with 1D separated kernel. The image plane is organized as one 1D vector of width*height.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel1D kernel object.
See Also:
Kernel1D

convolvexy

public static void convolvexy(float[] plane,
                              int width,
                              int height,
                              Kernel2D kernel)
Convolution of plane with symmetric 2D kernel in both directions. The image plane is organized as one 1D vector of width*height.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel2D kernel object.
See Also:
Kernel2D

convolvexyz

public static void convolvexyz(float[] volume,
                               int width,
                               int height,
                               int depth,
                               Kernel3D kernel)
Convolution of float volume with symmetric 3D kernel in all dimensions. The volume is organized as one 1D vector of width*height*depth.
Parameters:
v - the volume.
width - the width in pixels of the volume.
height - the height of the volume in pixels.
depth - the height of the volume in pixels.
kernel - a Kernel3D kernel object.
See Also:
Kernel3D

convolvex

public static void convolvex(float[] volume,
                             int width,
                             int height,
                             int depth,
                             Kernel1D kernel)
Convolution of float volume with symmetric 1D kernel in x dimension. The volume is organized as one 1D vector of width*height*depth.
Parameters:
v - the volume.
width - the width in pixels of the volume.
height - the height of the volume in pixels.
depth - the height of the volume in pixels.
kernel - a Kernel1D kernel.
See Also:
Kernel1D

convolvey

public static void convolvey(float[] volume,
                             int width,
                             int height,
                             int depth,
                             Kernel1D kernel)
Convolution of float volume with symmetric 1D kernel in y dimension. The volume is organized as one 1D vector of width*height*depth.
Parameters:
v - the volume.
width - the width in pixels of the volume.
height - the height of the volume in pixels.
depth - the height of the volume in pixels.
kernel - a Kernel1D kernel.
See Also:
Kernel1D

convolvez

public static void convolvez(float[] volume,
                             int width,
                             int height,
                             int depth,
                             Kernel1D kernel)
Convolution of float volume with symmetric 1D kernel in x dimension. The volume is organized as one 1D vector of width*height*depth.
Parameters:
v - the volume.
width - the width in pixels of the volume.
height - the height of the volume in pixels.
depth - the height of the volume in pixels.
kernel - a Kernel1D kernel.
See Also:
Kernel1D

convolvexyz

public static void convolvexyz(short[] volume,
                               int width,
                               int height,
                               int depth,
                               Kernel3D kernel)
Convolution of short volume with symmetric 3D kernel in all dimensions. The volume is organized as one 1D vector of width*height*depth.
Parameters:
v - the volume.
width - the width in pixels of the volume.
height - the height of the volume in pixels.
depth - the height of the volume in pixels.
kernel - a Kernel3D kernel object.
See Also:
Kernel3D

magConvolutionxy

public static void magConvolutionxy(float[] plane,
                                    int width,
                                    int height,
                                    Kernel1D kernel)
Deprecated.  

Magnitude of convolution of plane with asymetric 1D separated kernel in both directions. The image plane is organized as one 1D vector of width*height.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel1D kernel object.
See Also:
Kernel1D

magConvolutionxy

public static void magConvolutionxy(float[] plane,
                                    int width,
                                    int height,
                                    Kernel2D kernel)
Deprecated.  

Magnitude of convolution of plane with symmetric 2D kernel in both directions. The image plane is organized as one 1D vector of width*height.
Parameters:
plane - the image.
width - the width in pixels of the image.
height - the height of the image in pixels.
kernel - a Kernel2D kernel object.
See Also:
Kernel2D

pow

public static void pow(float[] image,
                       double pow)
Deprecated.  

Compute Math.pow(image, pow) for image. The image or volume is organized as one 1D vector.
Parameters:
image - the image.

subtract

public static float[] subtract(float[] image1,
                               float[] image2)
Deprecated.  

Compute image1 = (image1 - image2) for images or volumes. The image or volume is organized as one 1D vector.
Parameters:
image1. -  
image2. -  

nonlinear

public static void nonlinear(float[] image,
                             double threshold)
Deprecated.  

Compute threshold of image. Everything < threshold is set to to 0, rest stays. The image or volume is organized as one 1D vector.
Parameters:
image - the image.
threshold - a double with the treshold.

normalize

public static void normalize(float[] plane,
                             double threshold)
Deprecated.  

Normalize. Everything < threshold is set to to 0, over threshold to 255. The image plane is organized as one 1D vector of width*height.
Parameters:
plane - the image.
threshold - a double with the treshold.

valid

public static boolean valid(int width,
                            int height,
                            int x,
                            int y,
                            int edge)

valid

public static boolean valid(int width,
                            int height,
                            int depth,
                            int x,
                            int y,
                            int z,
                            int edge)