Morph and Enhance/Suppress Features


Is there any difference between the Morph - Tophat Module and the Enhance Speckles module?

Good question! I thought they were exactly the same, assuming you choose a “Disk” structuring element in Morph. However I just checked the code and confirmed that there is a slight difference. The “Feature Size” in EnhanceOrSuppressFeatures calculates the radius of the structuring element as

radius = (Feature Size) - 1 / 2.0] whereas the disk structuring element’s radius in Morph is calculated from module’s “Scale” parameter

radius = Scale / 2.0
So that means that an EnhanceOrSuppressFeatures “Feature Size” = 10 should be equivalent to a Morph “Scale” = 9, and my quick test seems to bear that out.

It looks like we were trying to emulate Matlab’s structuring element calculation within EnhanceOrSuppressFeatures and that was the genesis of the “subtract 1” addition. I will make a note in the Help to this effect – likely we’ll not change the functionality to something more harmonious as we don’t like to change how measurements are calculated, for historical continuity.

Hope that makes sense and helps!

Makes total sense, David. I didn’t have any intention of saying that anything should be modified, I just crossed by the coincidence.
Another question then.
When I make the Morph - tophat, I have the option of repeating it in the image until it doesn’t change anymore (from what I understand). Is the enhance Features = to Morph - tophat one single time, or does it repeat any number of times?

It’s the former; the EnhanceOrSupress tophat operation is only performed once.

And also, note that some morphological operators do not change the resulting image with multiple iterations. I believe tophat and bottomhat fall into that category, but I can’t recall for sure.

I see. That’s good to know. Thanks a lot!