Class AlgorithmNonlocalMeansFilter

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmNonlocalMeansFilter
    extends AlgorithmBase
    This is a port of the 09/03/2006 NLmeansfilter.m and UNLmeansfilter2.m on 02/15/2008 by Jose Vicente Manjon Herrera & Antoni Buades. The code in NLmeansfilter.m is an implementation of the algorithm in the article "A non-local algorithm for image denoising" by Antoni Buades and Jean-Michel Morel. The code in UNLmeansfilter2.m is an implementation of the algortihm in the article "MRI denoising using non-Local Means" by Jose Manjon, Jose Carbonell-Caballero, Juan J. Lull, Gracian Garcia-Marti, Luis Marti-Bonmati, Montserratt Robles, Medical Image Analysis 12 (2008), pp. 514-523. For post processing with Bayes shrink threshold computation: B. K. Shreyamsha Kumar, "Image Denoising based on Non Local-means Filter and its Method Noise Thresholding", Signal, Image and Video Processing, Vol. 7, Issue 6, pp. 1211-1227, 2013. (doi: 10.1007/s11760-012-0389-y) unbiased nonlocal means (value) = sqrt((nonlocal means (value))**2 - 2* sigma**2) For Rician noise standard deviation = sqrt(background mean/2)
    • Field Detail

      • searchWindowSide

        private int searchWindowSide
        Side of the learning window of pixels which will be averaged. Sizes generally range from about 15 X 15 to 21 X 21.
      • similarityWindowSide

        private int similarityWindowSide
        Comparsion window. This should be smaller than the search window size. In a non-noisy image it can be set to 3 X 3. The value increases with the amount of noise. In general, for noisy images 7 X 7 or 9 X 9 is a good size.
      • estimateNoiseStandardDeviation

        private boolean estimateNoiseStandardDeviation
      • noiseStandardDeviation

        private float noiseStandardDeviation
        Noise standard deviation
      • degreeOfFiltering

        private float degreeOfFiltering
        Used only with Rician noise filter. Should theoretically be around sqrt(2).
      • doRician

        private boolean doRician
        If true, use unbiased version of NLM to deal with Rician noise in MRI
      • do25D

        private boolean do25D
        In 3D if do25D == true, process each slice separately.
      • doBayesShrinkThresholdComputation

        private boolean doBayesShrinkThresholdComputation
    • Constructor Detail

      • AlgorithmNonlocalMeansFilter

        public AlgorithmNonlocalMeansFilter​(ModelImage destImage,
                                            ModelImage srcImg,
                                            int searchWindowSide,
                                            int similarityWindowSide,
                                            boolean estimateNoiseStandardDeviation,
                                            float noiseStandardDeviation,
                                            float degreeOfFiltering,
                                            boolean doRician,
                                            boolean do25D,
                                            boolean doBayesShrinkThresholdComputation)
        Creates a new AlgorithmNonlocalMeans object.
        Parameters:
        destImage - denoised image
        srcImg - 2D or 3D source image
        searchWindowSide - Side of the learning window of pixels which will be averaged
        similarityWindowSide - Side of the comparsion window
        estimateNoiseStandardDeviation -
        noiseStandardDeviation - Noise standard deviation
        degreeOfFiltering - degree of filtering - used only for Rician noise filter
        do25D - If true, do slice by slice filtering
        doBayesShrinkThresholdComputation -
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • runAlgorithm

        public void runAlgorithm()
        Starts the nonlocal means filter algorithm.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • run2D

        private void run2D()
      • run2DRician

        private void run2DRician()
      • run3D

        private void run3D()
      • run3DRician

        private void run3DRician()