GiciTransform
Class InverseDWTCore

java.lang.Object
  extended by GiciTransform.InverseDWTCore

public class InverseDWTCore
extends java.lang.Object

This class receives an arbitrary piece of a 3D transformed image and performs one level of the corresponded 3D discrete inverse wavelet transform. 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
          Definition in ForwardDWTCore.WTAxis
(package private)  int WTTypes
          Definition in ForwardDWTCore.WTTypes
(package private)  int WTXRegionEnd
          Definition in ForwardDWTCore.WTXRegionEnd
(package private)  int WTXRegionStart
          Definition in ForwardDWTCore.WTXRegionStart
(package private)  int WTYRegionEnd
          Definition in ForwardDWTCore.WTYRegionEnd
(package private)  int WTYRegionStart
          Definition in ForwardDWTCore.WTYRegionStart
(package private)  int WTZRegionEnd
          Definition in ForwardDWTCore.WTZRegionEnd
(package private)  int WTZRegionStart
          Definition in ForwardDWTCore.WTZRegionStart
 
Constructor Summary
InverseDWTCore(float[][][] imageSamples)
          Constructor, receives the transformed 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 detransformed 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 inverse wavelete transform and returns the result image.
 void setImageSamples(float[][][] imageSamples)
          Used to set (or reset) the image over which the detransform is going to be applied.
 void setParameters(int WTTypes, int WTAxis)
          Set the parameters used to apply the discrete inverse wavelet transform, compact use, the transform is going to be applied by default on the whole image over the requested axis.
 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 inverse 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
Definition in ForwardDWTCore.WTTypes


WTAxis

int WTAxis
Definition in ForwardDWTCore.WTAxis


WTZRegionStart

int WTZRegionStart
Definition in ForwardDWTCore.WTZRegionStart


WTZRegionEnd

int WTZRegionEnd
Definition in ForwardDWTCore.WTZRegionEnd


WTYRegionStart

int WTYRegionStart
Definition in ForwardDWTCore.WTYRegionStart


WTYRegionEnd

int WTYRegionEnd
Definition in ForwardDWTCore.WTYRegionEnd


WTXRegionStart

int WTXRegionStart
Definition in ForwardDWTCore.WTXRegionStart


WTXRegionEnd

int WTXRegionEnd
Definition in ForwardDWTCore.WTXRegionEnd


parametersSet

boolean parametersSet
To know if parameters are set.

True indicates that they are set otherwise false.

Constructor Detail

InverseDWTCore

public InverseDWTCore(float[][][] imageSamples)
Constructor, receives the transformed image samples.

Parameters:
imageSamples - definition in imageSamples
Method Detail

setParameters

public void setParameters(int WTTypes,
                          int WTAxis)
Set the parameters used to apply the discrete inverse wavelet transform, compact use, the transform is going to be applied by default on the whole image over the requested axis.

Parameters:
WTTypes - definition in WTTypes
WTAxis - definition in WTAxis

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 inverse 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 detransform is going to be applied.

Parameters:
imageSamples - definition in imageSamples

getImageSamples

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

Returns:
the DWT image

run

public void run()
         throws ErrorException
Performs the discrete inverse wavelete transform and returns the result image.

Throws:
ErrorException - when parameters are not set, wavelet type is unrecognized or trying to detransform 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 detransformed 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 transformed image samples
WTTypes - Filter to apply
Returns:
a float array that contains the detransformed 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 detransformed 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 detransformed 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 detransformed 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)