Class BM3D
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.BM3D
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class BM3D extends AlgorithmBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
BM3D.indexValueComparator
private class
BM3D.indexValueItem
-
Field Summary
Fields Modifier and Type Field Description private ModelImage[]
destImage
private boolean
estimateNoiseStandardDeviation
private int
k_H
private int
k_W
private double
lambda3D_H
private int
n_H
private int
N_H
private int
n_W
private int
N_W
private int
p_H
private int
p_W
private double
sigma
private java.lang.String
tau_2D_H
private java.lang.String
tau_2D_W
private double
tauMatch_H
private double
tauMatch_W
private boolean
useSD_H
private boolean
useSD_W
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description BM3D(ModelImage[] destImage, ModelImage srcImg, boolean estimateNoiseStandardDeviation, double sigma, int n_H, int N_H, int p_H, boolean useSD_H, java.lang.String tau_2D_H, double lambda3D_H, int n_W, int N_W, int p_W, boolean useSD_W, java.lang.String tau_2D_W)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double[][]
bm3d_1st_step(double sigma, ModelImage img_noisy, int nHard, int kHard, int NHard, int pHard, double lambdaHard3D, double tauMatch, boolean useSD, java.lang.String tau_2D)
private double[][]
bm3d_2nd_step(double sigma, ModelImage img_noisy, ModelImage img_basic, int nWien, int kWien, int NWien, int pWien, double tauMatch, boolean useSD, java.lang.String tau_2D)
private double[][][]
build_3D_group(java.util.Vector<java.util.Vector<double[][]>> fre_all_patches, int[][] N__ni_nj, int nSx_r)
private int[]
closest_power_of_2(int[] M, int max_)
private void
get_add_patch_matrix(int h, int w, int nHW, int kHW, double[][] row_add_mat, double[][] column_add_mat)
private double[][]
get_kaiserWindow(int kHW)
private double[][][]
ht_filtering_hadamard(double[][][] group_3D, double sigma, double lambdaHard3D, boolean doWeight, double[] weight)
private java.util.Vector<java.util.Vector<double[][]>>
image2patches(ModelImage im, int patch_h, int patch_w)
private int[]
ind_initialize(int max_size, int N, int step)
private double[]
kaiser(int M, double beta)
private double
log2(double x)
private int[][][][]
precompute_BM(ModelImage img, int kHW, int NHW, int nHW, double tauMatch, int[][] threshold_count)
void
runAlgorithm()
Actually runs the algorithm.private double
sd_weighting(double[][][] group_3D)
private ModelImage
symetrize(ModelImage img, int pad)
private double[][]
translation_2d_mat(double[][] mat, int right, int down)
private double[][][]
wiener_filtering_hadamard(double[][][] group_3D_img, double[][][] group_3D_est, double sigma, boolean doWeight, double[] weight)
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
destImage
private ModelImage[] destImage
-
estimateNoiseStandardDeviation
private boolean estimateNoiseStandardDeviation
-
sigma
private double sigma
-
n_H
private int n_H
-
k_H
private int k_H
-
N_H
private int N_H
-
p_H
private int p_H
-
tauMatch_H
private double tauMatch_H
-
useSD_H
private boolean useSD_H
-
tau_2D_H
private java.lang.String tau_2D_H
-
lambda3D_H
private double lambda3D_H
-
n_W
private int n_W
-
k_W
private int k_W
-
N_W
private int N_W
-
p_W
private int p_W
-
tauMatch_W
private double tauMatch_W
-
useSD_W
private boolean useSD_W
-
tau_2D_W
private java.lang.String tau_2D_W
-
-
Constructor Detail
-
BM3D
public BM3D(ModelImage[] destImage, ModelImage srcImg, boolean estimateNoiseStandardDeviation, double sigma, int n_H, int N_H, int p_H, boolean useSD_H, java.lang.String tau_2D_H, double lambda3D_H, int n_W, int N_W, int p_W, boolean useSD_W, java.lang.String tau_2D_W)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
bm3d_2nd_step
private double[][] bm3d_2nd_step(double sigma, ModelImage img_noisy, ModelImage img_basic, int nWien, int kWien, int NWien, int pWien, double tauMatch, boolean useSD, java.lang.String tau_2D)
-
wiener_filtering_hadamard
private double[][][] wiener_filtering_hadamard(double[][][] group_3D_img, double[][][] group_3D_est, double sigma, boolean doWeight, double[] weight)
-
symetrize
private ModelImage symetrize(ModelImage img, int pad)
-
bm3d_1st_step
private double[][] bm3d_1st_step(double sigma, ModelImage img_noisy, int nHard, int kHard, int NHard, int pHard, double lambdaHard3D, double tauMatch, boolean useSD, java.lang.String tau_2D)
-
sd_weighting
private double sd_weighting(double[][][] group_3D)
-
ht_filtering_hadamard
private double[][][] ht_filtering_hadamard(double[][][] group_3D, double sigma, double lambdaHard3D, boolean doWeight, double[] weight)
-
build_3D_group
private double[][][] build_3D_group(java.util.Vector<java.util.Vector<double[][]>> fre_all_patches, int[][] N__ni_nj, int nSx_r)
-
log2
private double log2(double x)
-
image2patches
private java.util.Vector<java.util.Vector<double[][]>> image2patches(ModelImage im, int patch_h, int patch_w)
-
precompute_BM
private int[][][][] precompute_BM(ModelImage img, int kHW, int NHW, int nHW, double tauMatch, int[][] threshold_count)
-
closest_power_of_2
private int[] closest_power_of_2(int[] M, int max_)
-
get_add_patch_matrix
private void get_add_patch_matrix(int h, int w, int nHW, int kHW, double[][] row_add_mat, double[][] column_add_mat)
-
translation_2d_mat
private double[][] translation_2d_mat(double[][] mat, int right, int down)
-
get_kaiserWindow
private double[][] get_kaiserWindow(int kHW)
-
kaiser
private double[] kaiser(int M, double beta)
-
ind_initialize
private int[] ind_initialize(int max_size, int N, int step)
-
-