Consolidated morphology

Lehmann, Gaetan1*,Beare, Richard
1.INRA
Abstract

Abstract

Grayscale dilation and erosion are basic transformations of mathematical morphology. Used together or with other transformations, they are very useful tools for image analysis. However, they can be very time consuming, especially with 3D images, and with large structuring elements. Several algorithms have been created to decrease the computation time, some of them with some limitations of shape of structuring element. We have implemented several algorithms, studied their performance in different conditions, and shown that all of them are more efficients than the others in certain conditions. We finally introduce a new structuring element class and a some meta filter designed to select the best algorithm depending on the image and the structuring element, and to smoothely integrate the different algorithms available in the toolkit.

Keywords

mathematical mophologystructuring element
Manuscript
Source Code and Data

Source Code and Data

consolidatedMorphologyCMakeLists.txt10.7 KBIJMacros.txt3.1 KBWrappingCMakeLists.txt228 BarticleArticle.tex7.4 KBInsightArticle.cls3.9 KBInsightJournal.bib155.8 KBInsightJournal.sty35 KBMakefile1.9 KBalgorithm.sty2.2 KBalgorithmic.sty5.4 KBamssymb.sty14.9 KBfancyhdr.sty14.4 KBfloatflt.sty10.8 KBfncychap.sty10.1 KBtimes.sty857 BblackTopHat2D.cxx1.6 KBblackTopHat2D_std_kernel.cxx1.7 KBclose2D.cxx1.7 KBclose2D_std_kernel.cxx1.7 KBclosepipe.cxx2.7 KBdilate2D.cxx1.6 KBdilate2D_std_kernel.cxx1.7 KBerode2D.cxx1.5 KBerode2D_std_kernel.cxx1.6 KBgradient2D.cxx1.7 KBgradient2D_std_kernel.cxx1.8 KBimagesCellsFluorescence2.png66.1 KBStrelFromImage.png157 BblackTopHat2D-std.png32.7 KBblackTopHat2D.png31.8 KBclose2D-std.png25.7 KBclose2D.png16.4 KBcthead1.png192.6 KBdilate2D-std.png26.7 KBdilate2D.png16.6 KBerode2D-std.png797 Berode2D.png587 Bgradient2D-std.png26.9 KBgradient2D.png16.7 KBkernelShape-ball-1.png122 BkernelShape-ball-10.png177 BkernelShape-ball-20.png231 BkernelShape-ball-3.png142 BkernelShape-ball-50.png438 BkernelShape-ball-6.png157 BkernelShape-box-1.png122 BkernelShape-box-10.png127 BkernelShape-box-20.png138 BkernelShape-box-3.png127 BkernelShape-box-50.png171 BkernelShape-box-6.png124 BkernelShape-poly-1-2.png122 BkernelShape-poly-1-4.png122 BkernelShape-poly-1-6.png122 BkernelShape-poly-10-2.png134 BkernelShape-poly-10-4.png171 BkernelShape-poly-10-6.png190 BkernelShape-poly-20-2.png145 BkernelShape-poly-20-4.png210 BkernelShape-poly-20-6.png254 BkernelShape-poly-3-2.png132 BkernelShape-poly-3-4.png142 BkernelShape-poly-3-6.png127 BkernelShape-poly-50-2.png177 BkernelShape-poly-50-4.png397 BkernelShape-poly-50-6.png522 BkernelShape-poly-6-2.png131 BkernelShape-poly-6-4.png152 BkernelShape-poly-6-6.png157 Bopen2D-std.png2.1 KBopen2D.png1.2 KBwhiteTopHat2D-std.png34.5 KBwhiteTopHat2D.png34.6 KBitkAnchorCloseImageFilter.h1.4 KBitkAnchorDilateImageFilter.h1.3 KBitkAnchorErodeDilateImageFilter.h3.5 KBitkAnchorErodeDilateImageFilter.txx5.7 KBitkAnchorErodeDilateLine.h2.7 KBitkAnchorErodeDilateLine.txx10.4 KBitkAnchorErodeImageFilter.h1.3 KBitkAnchorHistogram.h5.3 KBitkAnchorOpenCloseImageFilter.h4.8 KBitkAnchorOpenCloseImageFilter.txx9.2 KBitkAnchorOpenCloseLine.h2.2 KBitkAnchorOpenCloseLine.txx8.3 KBitkAnchorOpenImageFilter.h1.4 KBitkAnchorUtilities.h1.9 KBitkAnchorUtilities.txx3.2 KBitkBasicDilateImageFilter.h3.8 KBitkBasicDilateImageFilter.txx2 KBitkBasicErodeImageFilter.h3.8 KBitkBasicErodeImageFilter.txx2 KBitkBlackTopHatImageFilter.h4.4 KBitkBlackTopHatImageFilter.txx5 KBitkBresenhamLine.h901 BitkBresenhamLine.txx2.6 KBitkFlatStructuringElement.h4.4 KBitkFlatStructuringElement.txx23.5 KBitkGrayscaleDilateImageFilter.h7 KBitkGrayscaleDilateImageFilter.txx8.6 KBitkGrayscaleErodeImageFilter.h6.9 KBitkGrayscaleErodeImageFilter.txx8.6 KBitkGrayscaleMorphologicalClosingImageFilter.h6.4 KBitkGrayscaleMorphologicalClosingImageFilter.txx14.2 KBitkGrayscaleMorphologicalOpeningImageFilter.h6.4 KBitkGrayscaleMorphologicalOpeningImageFilter.txx14.4 KBitkMorphologicalGradientImageFilter.h6.1 KBitkMorphologicalGradientImageFilter.txx9.3 KBitkMovingHistogramDilateImageFilter.h3.5 KBitkMovingHistogramErodeImageFilter.h3.4 KBitkMovingHistogramImageFilter.h6.3 KBitkMovingHistogramImageFilter.txx21 KBitkMovingHistogramMorphologicalGradientImageFilter.h7.4 KBitkMovingHistogramMorphologyImageFilter.h8.7 KBitkMovingHistogramMorphologyImageFilter.txx1.9 KBitkOffsetLexicographicCompare.h860 BitkSharedMorphUtilities.h2.1 KBitkSharedMorphUtilities.txx11.9 KBitkWhiteTopHatImageFilter.h4.4 KBitkWhiteTopHatImageFilter.txx5 KBitkvHGWDilateImageFilter.h1.4 KBitkvHGWErodeDilateImageFilter.h3.3 KBitkvHGWErodeDilateImageFilter.txx5.6 KBitkvHGWErodeImageFilter.h1.4 KBitkvHGWUtilities.h1.8 KBitkvHGWUtilities.txx11.3 KBkernelShape.cxx1.5 KBopen2D.cxx1.7 KBopen2D_std_kernel.cxx1.7 KBperf2D.cxx9.5 KBperf3D.cxx9.4 KBperf_binary.cxx3.1 KBperf_dimension.cxx2.7 KBperf_image_size.cxx3.8 KBperf_nb_of_neighbors.cxx2.6 KBperf_strel_size.cxx2.9 KBperf_threads.cxx2.9 KBtestSE.cxx576 BwhiteTopHat2D.cxx1.6 KBwhiteTopHat2D_std_kernel.cxx1.7 KB

Select a file to preview

Reviews

Reviews

Dan Mueller

Sunday 17 September 2006

Summary: This paper presents a reworking of ITK’s mathematical morphology filters. The work is motivated by a number of factors including convenience, completeness, and performance. As of revision 1, this is a stub article only - the source code contains the developmental versions of all the additional filters, however only the FlatStructuringElement is addressed in the paper. As such, this review focusses on the FlatStructuringElement issues only.

Open Science: This contribution conforms to Open Science by providing all source code, tests, and images.

Reproducibility: I compiled the entire project on WinXP SP2, using MSVC8.0, CMake 2.4.2. I encountered a number of compilation issues:

  1. Project testSE: itkFlatStructuringElement.txx: line 512: ambiguous call to pow(). Microsoft Visual Studio 8.0 on WinXP can not resolve the first argument if it is an int - it must be explicitly cast to a double. eg. ‘unsigned int facets = 8 * (int)pow(4, iterations);’ becomes ‘unsigned int facets = 8 * (int)pow(4.0, iterations);’

  2. Project kernelShape: itkFlatStructuringELement.h: line 67: error C2064: term does not evaluate to a function taking 0 arguments. This one is a little beyond my experience: I looked here for some more info, but it didn’t really help. To temporarily resolve this issue in order to continue reviewing, I removed the default argument values and changed all the references to FromImage and GetImage to specifically provide the values (not a very good long term solution - the default parameters are nice! If anyone has any suggestions for getting this to work with MSVS8.0 on WinXP I am willing to test it out).

  3. There are lots of warnings: warning C4804 : unsafe use of type bool in operation. (BTW Gaetan, I have also noticed these warnings when compiling WrapITK). This results from using comparison operations on bools (seeing that the itk::Neighborhood has TPixel=bool). These warnings may scare/confuse some users, so it might be wise to add the following pragma statement somewhere: ’ #pragma warning( disable : 4804) '. For sake of ease I have added it to ImageToImageFilter.h in my working copy, but this is probably not the best place for it... Probably better is the header file of each morphological filter .. ?

Use of Open Source Software: Uses ITK.

Code Quality: Excellent code quality. I like lots of comments, and itkFlatStructuringElement.txx has plenty!

Just a few minor issues:

  1. While the guts of the code is very well commented, the actual header (which users will look to for useage instructions/documentation) is lacking. I feel you should add/enhance the comments for: Box: eg. " An easy access method for creating a box (2D) or cube (3D) structuring element. This method supports n-D dimensions. " Ball: eg. " An easy access method for creating a circle (2D) or spherical (3D) structuring element. " Poly: eg. " An easy access method for creating a polygon structuring element. Note that for 3D structuring elements, only the following number of edges are supported: 12, 14, 20, 32. " FromImage: eg. " Creates an arbitrary structuring element from the given image. "

  2. It is probably worthwhile to comment the Decomposable property in itkFlatStructuringElement.h (just to let users know they don’t need to worry too much about it - eg. " This is an internal property to specify if the current structuring element is decomposable. Decomposable structuring elements can be implemented using more efficient/faster algorithms. "). Also to conform to ITK standards maybe use itkGetConstMacro(Decomposable, bool);

  3. (This is a bit of a personal preference but) I like to see any papers which the class implements or was influenced by in the class documentation in the header (ie. include the reference to “Radial Decomposition of Discs and Spheres” - CVGIP: Graphical Models and Image Processing in the header).

Applicability to other problems: Mathematical morphology has wide application and the enhancements proposed in this article make using morphological filters in ITK more convenient and computationally more efficient.

Requests for additional information from authors: Is there a reason that you defined M_PI in itkFlatStructuringElement.txx and didn’t use the Utilities/vxl/core/vnl/vnl_math.h version (vnl_math::pi) ?

Additional Comments: BTW: I like the images/StrelFromImage.png picture!