5.0

5.0 | 2 ratings Rate this file 657 downloads (last 30 days) File Size: 1.35 MB File ID: #25449

Image Edge Enhancing Coherence Filter Toolbox

by Dirk-Jan Kroon

 

30 Sep 2009 (Updated 17 Nov 2009)

Code covered by BSD License  

Advanced 2D/3D noise removal and edge enhancing with anisotropic diffusion filtering ( Weickert )

Download Now | Watch this File

File Information
Description

Introduction:
This toolbox will perform Anisotropic Non-Linear Diffusion filtering on a 2D gray/color or 3D image. This filtering will reduce the image noise while preserving the region edges, and also enhancing the edges by smoothing along them.

This is one of the more advanced image enhancement methods available, and also contains HDCS from october 2009. The result looks like an artist painted the image, with clear brush strokes along the image edges and ridges, see screen-shot.

My paper about the code is included, "Coherence Filtering to Enhance the Mandibular Canal in Cone-Beam CT Data", IEEE-EMBS Benelux Chapter Symposium, 2009.

Method:
The basis of the method used is the one introduced by Weickert.
1, Calculate Hessian from every pixel of the Gaussian smoothed input image
2, Gaussian Smooth the Hessian, and calculate its eigenvectors and values (Image edges give large eigenvalues, and the eigenvectors corresponding to those eigenvalues describe the direction of the edge)
3, The eigenvectors are used as diffusion tensor directions. The amplitude of the diffusion in those 3 directions is based on the eigen values and determined by Weickerts equation.
4, An Finite Difference scheme is used to do the diffusion
5, Back to step 1, till a certain diffusion time is reached.

Diffusion schemes:
There are several diffusion schemes available: standard, implicit, nonegative discretization, and also a special rotation invariant scheme.

Mex Files:
All 3D files are not only available as Matlab but also as C-code /MEX files, to increase speed and reduce the amount of memory used. Compile the c-code by executing compile_c_files.m.

Literature (Full list in the included paper):
- Weickert : "A Scheme for Coherence-Enhancing Diffusion Filtering with Optimized Rotation Invariance"
- Mendrik et al, "Noise Reduction in Computed Tomography Scans Using 3-D Anisotropic Hybrid Diffusion With Continuous Switch", October 2009
- Weickert : "Anisotropic Diffusion in Image Processing", Thesis 1996
- Laura Fritz : "Diffusion-Based Applications for Interactive Medical Image Segmentation"
- Siham Tabik, et al. : "Multiprocessing of Anisotropic Nonlinear Diffusion for filtering 3D image"

Usage:
Read the help of CoherenceFilter, compile the c-code and try the examples in the help.

Please report bugs, successes and questions.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.9 (2009b)
Zip File Content  
Other Files
CoherenceFilter.m,
compile_c_files.m,
functions/derivatives.c,
functions/derivatives.m,
functions/imgaussian.c,
functions/imgaussian.m,
functions/showcs3.fig,
functions/showcs3.m,
functions2D/CoherenceFilterStep2D.c,
functions2D/CoherenceFilterStep2D.m,
functions2D/CoherenceFilterStep2D_functions.c,
functions2D/ConstructDiffusionTensor2D.m,
functions2D/diffusion_scheme_2D_implicit.m,
functions2D/diffusion_scheme_2D_non_negativity.m,
functions2D/diffusion_scheme_2D_rotation_invariant.m,
functions2D/diffusion_scheme_2D_standard.m,
functions2D/EigenVectors2D.m,
functions2D/StructureTensor2D.m,
functions3D/CoherenceFilterStep3D.c,
functions3D/CoherenceFilterStep3D.m,
functions3D/CoherenceFilterStep3D_functions.c,
functions3D/diffusion_scheme_3D_implicit.m,
functions3D/diffusion_scheme_3D_non_negativity.c,
functions3D/diffusion_scheme_3D_non_negativity.m,
functions3D/diffusion_scheme_3D_rotation_invariant.c,
functions3D/diffusion_scheme_3D_rotation_invariant.m,
functions3D/diffusion_scheme_3D_standard.c,
functions3D/diffusion_scheme_3D_standard.m,
functions3D/EigenDecomposition3.c,
functions3D/EigenDecomposition3.h,
functions3D/EigenVectors3D.c,
functions3D/EigenVectors3D.m,
functions3D/StructureTensor2DiffusionTensor3D.c,
functions3D/StructureTensor2DiffusionTensor3D.m,
functions3D/StructureTensor3D.m,
images/sphere.mat,
images/sync.png,
images/sync_noise.png,
license.txt,
Literature/Kroon_CoherenceFiltering.pdf
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
01 Oct 2009 Elmar

Thanks for sharing this tool! works very well and fast, but i'm experiencing some problems:
I'm trying to filter a 3D MRI volume of size 227x227x147. Depending on the value of 'rho' I use I get a variable number of slices in the third dimension that are all 'NaN'. The bigger rho, the more NaN slices are in the output image volume. For every value of T used the number of NaN-slices accumulates, so that after several timesteps the whole image volume consists of NaNs.
What could be the reason for the NaNs in the output?

My original image is single and normalized to a range of 0 to 1 and does not contain any NaNs.
thx, Elmar

01 Oct 2009 Dirk-Jan Kroon

* Elmar,

Thank you for your report, I never experienced NaN's my self.
Maybe you can add a small value to rule out division by zero.

If you still have problems, maybe you can share a part of the volume data with me?

Thanx, Dirk-Jan

01 Oct 2009 Elmar

I permuted the directions of the volume so that it is 147x227x227, now it works perfectly

02 Oct 2009 Dirk-Jan Kroon

*Elmar
Thank you for sharing the solution for your NaN problem.
Now, I know it's probably caused by a boundary check problem.

Dirk-Jan

02 Oct 2009 Dirk-Jan Kroon

I uploaded a new version with derivative boundary check bug fixed, probably tomorrow online. thnx Elmar.

22 Nov 2009 bin yao

A great code for studying diffusion filtering implementation. Thanks a lot for sharing.

I have two questions about the scheme
1) implicit scheme : does it means using semi-implicit AOS scheme to implementation?
 
2) diffusion_scheme_3D_implicit.m , you said "!! Scheme is unstable, and not ready to use yet." what is the problem?

Please login to add a comment or rating.
Updates
01 Oct 2009

Tested Linux Ubuntu

02 Oct 2009

Fixed boundary check bug in backward derivatives.

19 Oct 2009

Literature

17 Nov 2009

Added Adriƫnne M. Mendrik et al. "Hybrid Diffusion with Continuous Switch (HDCS)", october 2009 IEEE transactions on medical imaging.

17 Nov 2009

LCC compiler fix

Tag Activity for this File
Tag Applied By Date/Time
scheme Dirk-Jan Kroon 30 Sep 2009 10:20:51
diffusion scheme Dirk-Jan Kroon 30 Sep 2009 10:20:51
diffusion Dirk-Jan Kroon 30 Sep 2009 10:20:51
edge Dirk-Jan Kroon 30 Sep 2009 10:20:51
ridge Dirk-Jan Kroon 30 Sep 2009 10:20:51
image Dirk-Jan Kroon 30 Sep 2009 10:20:51
2d Dirk-Jan Kroon 30 Sep 2009 10:20:51
3d Dirk-Jan Kroon 30 Sep 2009 10:20:51
color Dirk-Jan Kroon 30 Sep 2009 10:20:51
enhancement Dirk-Jan Kroon 30 Sep 2009 10:20:51
enhancing Dirk-Jan Kroon 30 Sep 2009 10:20:51
coherenceenhancing Dirk-Jan Kroon 30 Sep 2009 10:20:51
diffusion filtering Dirk-Jan Kroon 30 Sep 2009 10:20:51
filtering Dirk-Jan Kroon 30 Sep 2009 10:20:51
anisot Dirk-Jan Kroon 30 Sep 2009 10:20:51
weickert Dirk-Jan Kroon 30 Sep 2009 10:20:51
image enhancement Dirk-Jan Kroon 30 Sep 2009 10:20:51
eigen values Dirk-Jan Kroon 30 Sep 2009 10:20:51
eigen vectors Dirk-Jan Kroon 30 Sep 2009 10:20:51
hessian Dirk-Jan Kroon 30 Sep 2009 10:20:51
nonlinear Dirk-Jan Kroon 30 Sep 2009 10:20:51
rotation invariance Dirk-Jan Kroon 30 Sep 2009 10:20:51
denoising Dirk-Jan Kroon 03 Oct 2009 06:29:11
image processing Dirk-Jan Kroon 03 Oct 2009 06:29:11
3d Bhavik 04 Oct 2009 05:57:25
ridge Bob Muse 19 Oct 2009 22:34:02
anisotro Dirk-Jan Kroon 17 Nov 2009 12:20:22
image enhancement VINEETH E 21 Nov 2009 00:18:10
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com