ITK/Examples/Morphology/ForegroundHasAccurateArea

From KitwarePublic
< ITK‎ | Examples
Revision as of 14:02, 23 October 2013 by Dirkpadfield (talk | contribs) (Created page with "The "ball" and "annulus" structuring elements have an optional flag called "foregroundHasAccurateArea". Setting this flag to true will generate structuring elements with more ac...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The "ball" and "annulus" structuring elements have an optional flag called "foregroundHasAccurateArea". Setting this flag to true will generate structuring elements with more accurate areas, which can be especially important when morphological operations are intended to remove or retain objects of particular sizes.

This mode was introduced because the original ball and annulus structuring elements have a systematic bias in the radius of +0.5 voxels in each dimension relative to the analytic definition of the radius. For example, a 3D ball of radius 5 should have an area of 523. With this mode turned on, the number of "on" pixels is 515 (error 1.6%), but with it turned off, the area is 739 (error 41%). For a 3D annulus of radius 5 and thickness 2, the area should be 410. With this mode turned on, the area is 392 (error 4.5%), but when turned off it is 560 (error 36%). This same trend holds for balls and annuli of any radius or dimension.

For more detailed experiments with this mode, please refer to the results of the test itkFlatStructuringElementTest.cxx.

We recommend using this mode for more accurate structuring elements. However, this mode is turned off by default for backward compatibility.