denoise
Class Operations

java.lang.Object
  extended by denoise.Operations

public final class Operations
extends java.lang.Object


Constructor Summary
Operations()
           
 
Method Summary
protected static double[] absolute(double[] input)
           
protected static void absolute(double[] input, double[] output)
           
protected static double[] add(double[] array1, double value)
           
protected static double[] add(double[] array1, double[] array2)
           
protected static void add(double[] array1, double[] array2, double[] output)
           
protected static void add(double[] in1, double[] in2, double[] out, int size)
          Perform the addition of two arrays.
protected static void add(double[] array1, double value, double[] output)
           
protected static int[] add(int[] array1, int value)
           
protected static ImageWare averageSubStack(ImageWare image, int zs, int ze)
           
protected static void complexMultiplication(double[] Re1, double[] Im1, double[] Re2, double[] Im2)
           
protected static void computeBlkMean(double[][] input, double[] output, int K1, int K2, int wtype)
           
protected static void computeBlkVar(ImageWare input, double[] output, int K1, int K2)
           
protected static double computeMedian(ImageWare input)
           
protected static double computeMode(double[] a)
           
protected static double[] convolve3(double[] in, double[] kernel)
           
protected static ImageWare convolveFIR2(ImageWare image, double[][] kernel)
           
protected static int[] createIndex(int I)
           
protected static int[] createIndex(int Is, int Ie)
           
protected static ImageWare createParent(ImageWare image, boolean[] offset)
           
static ImageWare crop2D(ImageWare input, int nx, int ny, int[] Ext)
           
protected static ImageWare DenoiseLowpass(ImageWare lowpass, double[] sigma2, int currentFrame)
           
protected static double[] divide(double[] array1, double[] array2)
           
protected static double[] divide(double value, double[] array)
           
protected static void doInverse3D(ImageWare image, int[] iterations, int filter, double degree, double shift)
           
protected static ImageWare doMultiframePURELET(ImageWare coef, ImageWare lowpass, int[] iterations, double[] sigma, int current)
           
protected static void doTransform3D(ImageWare image, int[] iterations, int filter, double degree, double shift, int GDC, ImageWare lowpass)
          Perform the inverse wavelet transform (synthesis) using Fourier domain for filtering.
protected static double[] estimateNoiseParams(ImageWare input, int CS)
           
protected static void fill(double[] output, double value)
           
protected static int[] getAdjacentIndex(int central, int total, int adjacent)
           
protected static double[][] getBlocks(double[][] input, int K1, int K2)
           
protected static double[][] getBlocks(ImageWare input, int K1, int K2)
           
protected static int[] getIndex(double[] input, double[] values, int I)
           
protected static double getMax(double[] input)
           
protected static double getMean(double[] input)
           
protected static double getMedian(double[] input)
           
protected static double[] getPixels(ImageWare input)
           
protected static double getSum(double[] input)
           
protected static double interqDist(double[] input)
           
protected static boolean isOdd(int n)
          Test if n is odd.
protected static int maxDyadicIters(int N)
          Find the maximum number of dyadic iterations for a signal of size N.
protected static double[] multiply(double[] array1, double value)
           
protected static double[] multiply(double[] array1, double[] array2)
           
protected static void multiply(double[] array1, double[] array2, double[] output)
           
protected static void multiply(double[] array1, double value, double[] output)
           
protected static int[] multiply(int[] array1, int value)
           
protected static void multiplyAndConjugateSpecial(double[] ReIn, double[] ImIn, double[] ReF, double[] ImF, double[] ReOut, double[] ImOut, int size, int iteration)
          Perform the filtering in Fourier domain and conjugate.
protected static void multiplyAndRound(double[] array1, double value, double[] output)
           
protected static double multiplyAndSum(double[] array1, double[] array2)
           
protected static void multiplySpecial(double[] ReIn, double[] ImIn, double[] ReF, double[] ImF, double[] ReOut, double[] ImOut, int size, int iteration)
          Perform the filtering in Fourier domain.
protected static int[] numOfDyadicIters(int nx, int ny)
           
protected static ImageWare PURELETmultishrink(ImageWare band, ImageWare lowpass, boolean[] offsets, double[] sigma2, int currentFrame)
           
protected static void putIndexedValues(double[] input, double[] output, int[] index, int I)
           
protected static void quickSort(double[] array, int[] index)
           
protected static void quickSort(double[] array, int[] index, int start, int end)
           
protected static double[] restrict(double[] array, double Tol)
           
protected static double[] restrictArray(double[] array, int Is, int Ie)
           
protected static int[] restrictArray(int[] array, int Is, int Ie)
           
protected static double robustMeanEstimate(double[] x, int wtype)
           
protected static double robustVarEstimate(double[] array)
           
protected static void smooth(ImageWare image, double sigma)
           
protected static void smoothGaussian1D(double[] input, double sigma, int boundary)
          Implements a gaussian smooth filter with a parameter sigma.
protected static void smoothx(ImageWare image, double sigma)
          Gaussian smoothing along x
protected static void smoothy(ImageWare image, double sigma)
          Gaussian smoothing along y
protected static void smoothz(ImageWare image, double sigma)
          Gaussian smoothing along z
protected static double[] subtract(double[] array, double value)
           
protected static double[] subtract(double[] array1, double[] array2)
           
protected static void subtract(double[] array1, double[] array2, double[] output)
           
protected static void subtract(double[] array1, double value, double[] output)
           
protected static void swap(double[] array, int index1, int index2)
           
protected static void swap(int[] array, int index1, int index2)
           
static ImageWare symextend2D(ImageWare input, int Nx, int Ny)
           
static ImageWare symextend2D(ImageWare input, int Nx, int Ny, int[] Ext)
           
protected static void weightFun(double[] x, int wtype, double[] w)
           
protected static double[] wlsFit(double[] x, double[] y, int wtype)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operations

public Operations()
Method Detail

doTransform3D

protected static final void doTransform3D(ImageWare image,
                                          int[] iterations,
                                          int filter,
                                          double degree,
                                          double shift,
                                          int GDC,
                                          ImageWare lowpass)
Perform the inverse wavelet transform (synthesis) using Fourier domain for filtering. This algorithm can use FIR and IIR filters. The separable implementation uses one IFFT for two rows (columns) to increase the time perfomances. Algorithm: The algorithm is quite similar to this of the analysis with inversions of some operations.

Parameters:
image - real image to transform
iterations - desired number of iterations
filter - kind of filter the fractional spline filters
degree - degree of the fractional spline filters
shift - shift of the fractional spline filters

doInverse3D

protected static final void doInverse3D(ImageWare image,
                                        int[] iterations,
                                        int filter,
                                        double degree,
                                        double shift)

multiplySpecial

protected static final void multiplySpecial(double[] ReIn,
                                            double[] ImIn,
                                            double[] ReF,
                                            double[] ImF,
                                            double[] ReOut,
                                            double[] ImOut,
                                            int size,
                                            int iteration)
Perform the filtering in Fourier domain.

Parameters:
ReIn - input signal 1D (real part)
ImIn - input signal 1D (imaginary part)
ReF - filter (real part)
ImF - filter (imaginary part)
ReOut - output signal 1D (real part)
ImOut - output signal 1D (imaginary part)
size - size of the vectors
iteration - value of the iteration in the loop

multiplyAndConjugateSpecial

protected static final void multiplyAndConjugateSpecial(double[] ReIn,
                                                        double[] ImIn,
                                                        double[] ReF,
                                                        double[] ImF,
                                                        double[] ReOut,
                                                        double[] ImOut,
                                                        int size,
                                                        int iteration)
Perform the filtering in Fourier domain and conjugate.

Parameters:
ReIn - input signal 1D (real part)
ImIn - input signal 1D (imaginary part)
ReF - filter (real part)
ImF - filter (imaginary part)
ReOut - output signal 1D (real part)
ImOut - output signal 1D (imaginary part)
size - size of the vectors
iteration - value of the iteration in the loop

add

protected static final void add(double[] in1,
                                double[] in2,
                                double[] out,
                                int size)
Perform the addition of two arrays.

Parameters:
in1 - first array
in2 - second array
out - output array should be allocated before the call

complexMultiplication

protected static final void complexMultiplication(double[] Re1,
                                                  double[] Im1,
                                                  double[] Re2,
                                                  double[] Im2)

computeMedian

protected static final double computeMedian(ImageWare input)

computeMode

protected static final double computeMode(double[] a)

getPixels

protected static final double[] getPixels(ImageWare input)

getIndex

protected static final int[] getIndex(double[] input,
                                      double[] values,
                                      int I)

restrict

protected static final double[] restrict(double[] array,
                                         double Tol)

putIndexedValues

protected static final void putIndexedValues(double[] input,
                                             double[] output,
                                             int[] index,
                                             int I)

getSum

protected static final double getSum(double[] input)

getMean

protected static final double getMean(double[] input)

getMedian

protected static final double getMedian(double[] input)

getMax

protected static final double getMax(double[] input)

absolute

protected static final double[] absolute(double[] input)

absolute

protected static final void absolute(double[] input,
                                     double[] output)

fill

protected static final void fill(double[] output,
                                 double value)

subtract

protected static final double[] subtract(double[] array1,
                                         double[] array2)

subtract

protected static final double[] subtract(double[] array,
                                         double value)

subtract

protected static final void subtract(double[] array1,
                                     double[] array2,
                                     double[] output)

subtract

protected static final void subtract(double[] array1,
                                     double value,
                                     double[] output)

add

protected static final double[] add(double[] array1,
                                    double[] array2)

add

protected static final void add(double[] array1,
                                double[] array2,
                                double[] output)

add

protected static final void add(double[] array1,
                                double value,
                                double[] output)

add

protected static final int[] add(int[] array1,
                                 int value)

add

protected static final double[] add(double[] array1,
                                    double value)

multiply

protected static final double[] multiply(double[] array1,
                                         double[] array2)

multiply

protected static final void multiply(double[] array1,
                                     double[] array2,
                                     double[] output)

multiply

protected static final void multiply(double[] array1,
                                     double value,
                                     double[] output)

multiply

protected static final double[] multiply(double[] array1,
                                         double value)

multiply

protected static final int[] multiply(int[] array1,
                                      int value)

multiplyAndSum

protected static final double multiplyAndSum(double[] array1,
                                             double[] array2)

multiplyAndRound

protected static final void multiplyAndRound(double[] array1,
                                             double value,
                                             double[] output)

divide

protected static final double[] divide(double[] array1,
                                       double[] array2)

divide

protected static final double[] divide(double value,
                                       double[] array)

computeBlkVar

protected static final void computeBlkVar(ImageWare input,
                                          double[] output,
                                          int K1,
                                          int K2)

computeBlkMean

protected static final void computeBlkMean(double[][] input,
                                           double[] output,
                                           int K1,
                                           int K2,
                                           int wtype)

getBlocks

protected static final double[][] getBlocks(double[][] input,
                                            int K1,
                                            int K2)

getBlocks

protected static final double[][] getBlocks(ImageWare input,
                                            int K1,
                                            int K2)

isOdd

protected static final boolean isOdd(int n)
Test if n is odd.

Parameters:
n - the number of frames for denoising the current frame
Returns:
true if n is odd, false otherwise

maxDyadicIters

protected static final int maxDyadicIters(int N)
Find the maximum number of dyadic iterations for a signal of size N.

Parameters:
N - the signal size
Returns:
i the maximum number of dyadic iterations

numOfDyadicIters

protected static final int[] numOfDyadicIters(int nx,
                                              int ny)

quickSort

protected static void quickSort(double[] array,
                                int[] index)

quickSort

protected static void quickSort(double[] array,
                                int[] index,
                                int start,
                                int end)

swap

protected static void swap(int[] array,
                           int index1,
                           int index2)

swap

protected static void swap(double[] array,
                           int index1,
                           int index2)

createIndex

protected static final int[] createIndex(int I)

createIndex

protected static final int[] createIndex(int Is,
                                         int Ie)

restrictArray

protected static final int[] restrictArray(int[] array,
                                           int Is,
                                           int Ie)

restrictArray

protected static final double[] restrictArray(double[] array,
                                              int Is,
                                              int Ie)

getAdjacentIndex

protected static final int[] getAdjacentIndex(int central,
                                              int total,
                                              int adjacent)

convolveFIR2

protected static final ImageWare convolveFIR2(ImageWare image,
                                              double[][] kernel)

doMultiframePURELET

protected static final ImageWare doMultiframePURELET(ImageWare coef,
                                                     ImageWare lowpass,
                                                     int[] iterations,
                                                     double[] sigma,
                                                     int current)

DenoiseLowpass

protected static final ImageWare DenoiseLowpass(ImageWare lowpass,
                                                double[] sigma2,
                                                int currentFrame)

PURELETmultishrink

protected static final ImageWare PURELETmultishrink(ImageWare band,
                                                    ImageWare lowpass,
                                                    boolean[] offsets,
                                                    double[] sigma2,
                                                    int currentFrame)

smoothGaussian1D

protected static final void smoothGaussian1D(double[] input,
                                             double sigma,
                                             int boundary)
Implements a gaussian smooth filter with a parameter sigma. Uses a IIR filter. N iterations of the symmetrical exponential filter (N=3) N sqrt(N^2 + 2*N*sigma^2) alpha = 1 + ------- - ------------------------ sigma^2 sigma^2

Parameters:
input - an ImageAccess object
sigma - a value of the sigma of the gaussian

smooth

protected static final void smooth(ImageWare image,
                                   double sigma)

smoothx

protected static final void smoothx(ImageWare image,
                                    double sigma)
Gaussian smoothing along x


smoothy

protected static final void smoothy(ImageWare image,
                                    double sigma)
Gaussian smoothing along y


smoothz

protected static final void smoothz(ImageWare image,
                                    double sigma)
Gaussian smoothing along z


createParent

protected static final ImageWare createParent(ImageWare image,
                                              boolean[] offset)

convolve3

protected static final double[] convolve3(double[] in,
                                          double[] kernel)

averageSubStack

protected static final ImageWare averageSubStack(ImageWare image,
                                                 int zs,
                                                 int ze)

symextend2D

public static final ImageWare symextend2D(ImageWare input,
                                          int Nx,
                                          int Ny)

symextend2D

public static final ImageWare symextend2D(ImageWare input,
                                          int Nx,
                                          int Ny,
                                          int[] Ext)

crop2D

public static final ImageWare crop2D(ImageWare input,
                                     int nx,
                                     int ny,
                                     int[] Ext)

estimateNoiseParams

protected static final double[] estimateNoiseParams(ImageWare input,
                                                    int CS)

wlsFit

protected static final double[] wlsFit(double[] x,
                                       double[] y,
                                       int wtype)

interqDist

protected static final double interqDist(double[] input)

weightFun

protected static final void weightFun(double[] x,
                                      int wtype,
                                      double[] w)

robustVarEstimate

protected static final double robustVarEstimate(double[] array)

robustMeanEstimate

protected static final double robustMeanEstimate(double[] x,
                                                 int wtype)