GiciTransform
Class ForwardDWTCore

java.lang.Object
  extended by GiciTransform.ForwardDWTCore

public class ForwardDWTCore
extends java.lang.Object

This class receives an image and performs one level of an arbitrary defined 3D discrete wavelet transform on it. Usage example:
  construct
  setParameters
  run
  getImageSamples

Version:
1.0
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
(package private)  float[][][] imageSamples
          Image samples (index meaning [z][y][x]).
(package private)  boolean parametersSet
          To know if parameters are set.
(package private)  int WTAxis
          Dimensional axis in which the transform is going to be applied.
(package private)  int WTTypes
          Discrete wavelet transform to be applied.
(package private)  int WTXRegionEnd
          Ending coordinate of the X axis region to be computed.
(package private)  int WTXRegionStart
          Initial coordinate of the X axis region to be computed.
(package private)  int WTYRegionEnd
          Ending coordinate of the Y axis region to be computed.
(package private)  int WTYRegionStart
          Initial coordinate of the Y axis region to be computed.
(package private)  int WTZRegionEnd
          Ending coordinate of the Z axis region to be computed.
(package private)  int WTZRegionStart
          Initial coordinate of the Z axis region to be computed.
 
Constructor Summary
ForwardDWTCore(float[][][] imageSamples)
          Constructor that receives the original image samples.
 
Method Summary
private  float[] evenEvenFiltering(float[] src, int WTTypes)
          This function applies the DWT filter to a source with even length and even phase.
private  float[] evenOddFiltering(float[] src, int WTTypes)
          This function applies the DWT filter to a source with even length and odd phase.
private  float[] filtering(float[] src, int WTTypes, int WTLRegionStart)
          This function selects the way to apply the filter depending on the phase and the size of the source.
 float[][][] getImageSamples()
          Used to get the 3DWT transformed image.
private  float[] oddEvenFiltering(float[] src, int WTTypes)
          This function applies the DWT filter to a source with odd length and even phase.
private  float[] oddOddFiltering(float[] src, int WTTypes)
          This function applies the DWT filter to a source with odd length and odd phase.
 void run()
          Performs the discrete wavelete transform.
 void setImageSamples(float[][][] imageSamples)
          Used to set (or reset) the image over which the transform is going to be applied.
 void setParameters(int WTTypes, int WTAxis, int WTZRegionStart, int WTZRegionEnd, int WTYRegionStart, int WTYRegionEnd, int WTXRegionStart, int WTXRegionEnd)
          Set the parameters used to apply the discrete wavelet transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageSamples

float[][][] imageSamples
Image samples (index meaning [z][y][x]).


WTTypes

int WTTypes
Discrete wavelet transform to be applied.

Valid values are:


WTAxis

int WTAxis
Dimensional axis in which the transform is going to be applied.

Valid values are:


WTZRegionStart

int WTZRegionStart
Initial coordinate of the Z axis region to be computed.

Negative Values not allowed


WTZRegionEnd

int WTZRegionEnd
Ending coordinate of the Z axis region to be computed.

Negative Values not allowed


WTYRegionStart

int WTYRegionStart
Initial coordinate of the Y axis region to be computed.

Negative Values not allowed


WTYRegionEnd

int WTYRegionEnd
Ending coordinate of the Y axis region to be computed.

Negative Values not allowed


WTXRegionStart

int WTXRegionStart
Initial coordinate of the X axis region to be computed.

Negative Values not allowed


WTXRegionEnd

int WTXRegionEnd
Ending coordinate of the X axis region to be computed.

Negative Values not allowed


parametersSet

boolean parametersSet
To know if parameters are set.

True indicates that they are set otherwise false.

Constructor Detail

ForwardDWTCore

public ForwardDWTCore(float[][][] imageSamples)
Constructor that receives the original image samples.

Parameters:
imageSamples - definition in imageSamples
Method Detail

setParameters

public void setParameters(int WTTypes,
                          int WTAxis,
                          int WTZRegionStart,
                          int WTZRegionEnd,
                          int WTYRegionStart,
                          int WTYRegionEnd,
                          int WTXRegionStart,
                          int WTXRegionEnd)
Set the parameters used to apply the discrete wavelet transform.

Parameters:
WTTypes - definition in WTTypes
WTAxis - definition in WTAxis
WTZRegionStart - definition in WTZRegionStart
WTZRegionEnd - definition in WTZRegionEnd
WTYRegionStart - definition in WTYRegionStart
WTYRegionEnd - definition in WTYRegionEnd
WTXRegionStart - definition in WTXRegionStart
WTXRegionEnd - definition in WTXRegionEnd

setImageSamples

public void setImageSamples(float[][][] imageSamples)
Used to set (or reset) the image over which the transform is going to be applied.

Parameters:
imageSamples - definition in imageSamples

getImageSamples

public float[][][] getImageSamples()
Used to get the 3DWT transformed image.

Returns:
the DWT image

run

public void run()
         throws ErrorException
Performs the discrete wavelete transform.

Throws:
ErrorException - when parameters are not set, wavelet type is unrecognized or trying to transform over an unimplemented axis

filtering

private float[] filtering(float[] src,
                          int WTTypes,
                          int WTLRegionStart)
                   throws ErrorException
This function selects the way to apply the filter depending on the phase and the size of the source.

Parameters:
src - a float array of the image samples
WTTypes - Filter to apply
WTLRegionStart - The starting coordinate of the original line to transform, used to determine the starting phase.
Returns:
a float array that contains the transformed sources
Throws:
ErrorException - when wavelet type is unrecognized

evenEvenFiltering

private float[] evenEvenFiltering(float[] src,
                                  int WTTypes)
                           throws ErrorException
This function applies the DWT filter to a source with even length and even phase.

Parameters:
src - a float array of the image samples
WTTypes - Filter to apply
Returns:
a float array that contains the transformed sources
Throws:
ErrorException - when wavelet type is unrecognized

evenOddFiltering

private float[] evenOddFiltering(float[] src,
                                 int WTTypes)
                          throws ErrorException
This function applies the DWT filter to a source with even length and odd phase.

Parameters:
src - a float array of the image samples
WTTypes - Filter to apply
Returns:
a float array that contains the transformed sources
Throws:
ErrorException - when wavelet type is unrecognized

oddEvenFiltering

private float[] oddEvenFiltering(float[] src,
                                 int WTTypes)
                          throws ErrorException
This function applies the DWT filter to a source with odd length and even phase.

Parameters:
src - a float array of the image samples
WTTypes - Filter to apply
Returns:
a float array that contains the transformed sources
Throws:
ErrorException - when wavelet type is unrecognized

oddOddFiltering

private float[] oddOddFiltering(float[] src,
                                int WTTypes)
                         throws ErrorException
This function applies the DWT filter to a source with odd length and odd phase.

Parameters:
src - a float array of the image samples
WTTypes - Filter to apply
Returns:
a float array that contains the transformed sources
Throws:
ErrorException - when wavelet type is unrecognized


TER - Copyright (C) 2006
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Group on Interactive Coding of Images (GICI) - UAB (Spain)