Class Analysis


public class Analysis
extends Thread

Wavelet Transformation Demo: Performs the forward wavelet transformation (Analysis) on a given image.

Field Summary

private String
borderExtMethod
private int
boundSize
private String
decompMethod
private ImageCanvas
destCanvas
private boolean
dispNorm
private TransformDisplay
display
private Filter
filter
private int
filterSize
private double[]
highPass
private ImageMaker
im
private int
lineColor
private double[]
lowPass
private int
maxlevel
private NonStdData
nonStdCoeffs
private byte[][][]
orgByteData
private Data
orgData
private int
orgNumBands
private int
orgNumCols
private int
orgNumRows
private TransformParams
params
private StdData
stdCoeffs
private TransformLength
transLen

Constructor Summary

Analysis(TransformDisplay disp, TransformParams params, ImageCanvas destCanvas)
Constructs a new Anaylsis object

Method Summary

void
anaNotify()
Notify the currently executing thread
void
anaWait()
Let the currently executing thread wait (until notified)
private double[]
convolution(double[] in)
Convolute the samples (using the specified filter)
private double[]
extendSamples(double[] samples, int slen)
Extend the original samples in one row depending on the selected border extension method
String
getBoundMethod()
Returns the currently selected border extension method as a String
Object
getCoeffs(String name)
Returns the current storage object of the wavelet coefficents (which is dependent on the selected decomposition method)
String
getDecompMethod()
Returns the currently selected decomposition method as a String
byte[][][]
getDisplayArray()
Return the byte array
boolean
getDisplayNormalization()
Returns the currently selected display normalization
Filter
getFilter()
Returns the current transformation filter
ImageMaker
getImageMaker()
Returns the current ImageMaker object (that handels the image creation from single pixel values and finally the image display)
int
getOrgNumBands()
Returns the number of color bands of the source image
int
getOrgNumCols()
Returns the number of columns of the source image
int
getOrgNumRows()
Returns the number of rows of the source image
int
getSeperatorColor()
Returns the currently selected seperator line color for display
TransformLength
getTransLen()
Returns an object with the lengths of convoluted samples by level
private void
nonStandardDecomposition(Data data, int level, int dispLevel)
Apply the Non-Standard-Decomposition to the image
void
run()
Start the forward wavelet transformation (Analysis) thread.
private void
setDecompMethod(String method)
Sets the selected decomposition method and creates corresponding image layout objects (ImageMaker)
private void
setFilter(Filter filter)
Initialize filter specific parameters
private void
showImage(int numBands, int numRows, int numCols)
Set the image byte data and display the image
private void
standardDecompositionCol(Data data, StdData storage, int level)
Apply the Standard-Decomposition (in direction of columns) to the image
private void
standardDecompositionRow(Data data, StdData storage, int level)
Apply the Standard-Decomposition (in direction of rows) to the image
private void
waitSomeTime(boolean wait)
Stop the current thread processing (if requested) and wait until time is over, or user selection.

Field Details

borderExtMethod

private String borderExtMethod

boundSize

private int boundSize

decompMethod

private String decompMethod

destCanvas

private ImageCanvas destCanvas

dispNorm

private boolean dispNorm

display

private TransformDisplay display

filter

private Filter filter

filterSize

private int filterSize

highPass

private double[] highPass

im

private ImageMaker im

lineColor

private int lineColor

lowPass

private double[] lowPass

maxlevel

private int maxlevel

nonStdCoeffs

private NonStdData nonStdCoeffs

orgByteData

private byte[][][] orgByteData

orgData

private Data orgData

orgNumBands

private int orgNumBands

orgNumCols

private int orgNumCols

orgNumRows

private int orgNumRows

params

private TransformParams params

stdCoeffs

private StdData stdCoeffs

transLen

private TransformLength transLen

Constructor Details

Analysis

public Analysis(TransformDisplay disp,
                TransformParams params,
                ImageCanvas destCanvas)
Constructs a new Anaylsis object
Parameters:
disp - Frame where the transformation is displayed
params - Transformation parameters
destCanvas - ImageCanvas where image after anylysis should be displayed

Method Details

anaNotify

public void anaNotify()
Notify the currently executing thread

anaWait

public void anaWait()
Let the currently executing thread wait (until notified)

convolution

private double[] convolution(double[] in)
Convolute the samples (using the specified filter)
Parameters:
Returns:
The convoluted samples

extendSamples

private double[] extendSamples(double[] samples,
                               int slen)
Extend the original samples in one row depending on the selected border extension method
Parameters:
samples - The original input samples (one row)
slen - The original input samples length
Returns:
Returns the extended samples

getBoundMethod

public String getBoundMethod()
Returns the currently selected border extension method as a String

getCoeffs

public Object getCoeffs(String name)
Returns the current storage object of the wavelet coefficents (which is dependent on the selected decomposition method)
Parameters:
name - The currently selected decomposition method

getDecompMethod

public String getDecompMethod()
Returns the currently selected decomposition method as a String

getDisplayArray

public byte[][][] getDisplayArray()
Return the byte array

getDisplayNormalization

public boolean getDisplayNormalization()
Returns the currently selected display normalization

getFilter

public Filter getFilter()
Returns the current transformation filter

getImageMaker

public ImageMaker getImageMaker()
Returns the current ImageMaker object (that handels the image creation from single pixel values and finally the image display)
Returns:
Current ImageMaker object (for analysis)

getOrgNumBands

public int getOrgNumBands()
Returns the number of color bands of the source image

getOrgNumCols

public int getOrgNumCols()
Returns the number of columns of the source image

getOrgNumRows

public int getOrgNumRows()
Returns the number of rows of the source image

getSeperatorColor

public int getSeperatorColor()
Returns the currently selected seperator line color for display

getTransLen

public TransformLength getTransLen()
Returns an object with the lengths of convoluted samples by level

nonStandardDecomposition

private void nonStandardDecomposition(Data data,
                                      int level,
                                      int dispLevel)
Apply the Non-Standard-Decomposition to the image
Parameters:
data - The Data array to transform
level - Current processing level
dispLevel - Current display level (needed for LP display normalization)

run

public void run()
Start the forward wavelet transformation (Analysis) thread.

setDecompMethod

private void setDecompMethod(String method)
Sets the selected decomposition method and creates corresponding image layout objects (ImageMaker)
Parameters:
method - The currently selected decomposition method (as a String)

setFilter

private void setFilter(Filter filter)
Initialize filter specific parameters
Parameters:
filter - The currently selected filter

showImage

private void showImage(int numBands,
                       int numRows,
                       int numCols)
Set the image byte data and display the image
Parameters:
numBands - Number of bands to display
numRows - Number of rows to display
numCols - Number of columns to display

standardDecompositionCol

private void standardDecompositionCol(Data data,
                                      StdData storage,
                                      int level)
Apply the Standard-Decomposition (in direction of columns) to the image
Parameters:
data - The Data array to transform
storage - The storage array for the wavelet coeffs
level - Current processing level

standardDecompositionRow

private void standardDecompositionRow(Data data,
                                      StdData storage,
                                      int level)
Apply the Standard-Decomposition (in direction of rows) to the image
Parameters:
data - The Data array to transform
storage - The storage array for the wavelet coeffs
level - Current processing level

waitSomeTime

private void waitSomeTime(boolean wait)
Stop the current thread processing (if requested) and wait until time is over, or user selection.
Parameters:
wait - Flag: Should thread wait?