# Distance Ridge from Euclidean Distance Map

Hey Everyone,
I ran in some problems while trying to analyse different microstructures using Fiji. Maybe someone has an idea and can help me solve them.
So the whole story is like this:
I want to analyse different microstrutures for different alloys in a more representative way (not using line intersection methods or something like this) utilising our SEM images. So my idea after researching online was to use the SEM image which has (multiple different phases) and first segment into a binary image. One phase being the e.g. lamellar matrix phase that I am interested in and the second one being a grain boundary phase or defects and so on (so everything that seperates the matrix phase grains/lamella from another). The result looks something like this (using the Trainable Weka Segmentation works quite well for me):

Classified image.tif (769.7 KB)

Then by creating a Euclidean Distance Map (EDM) I somewhat already get some information about the type of the microstructure as the Histogram of the resulting EDM would shift to higher values if by structure gets coarser.

EDM.tif (3.0 MB)

Now if I want the Histogram to reflect parameters e.g. the lamella thicknes more accurately, I somehow have to delete â€śaccessâ€ť non background points from the distance map so that I only get the point with the highest distance from the background in an area. As this point with the highes value basically corresponds to a circle with the radius of half the thickness of the lamella. (I am not sure if I explaind my problem in an understandable way )
I found a plugin which in principle should do this (Distance_Ridge). The result looks like this:

EDM_DR.tif (3.0 MB)

Ideally for a perfect lamella I should get a single pixle bread line in its center. However as you can see I still have a lot of â€śaccessâ€ť points so I am looking for a way to either remove them or improve the selection process which is used in the (Distance_Ridge) plugin.

So maybe anyone has an idea how I could fix this problem?

Best regards
Tobias

What about computing the skeleton of the binary image and then using it to get the value of the EDM via the AND logical operation?

Thanks for the tip . While it is not perfect it definitely helped.

Class-Skeleton.tif (769.7 KB)

There are still some lines that go off the center line of the lamella.
If anyone has another idea how to refine the result further he/she is very welcome.

Medial axis transform anybody? I do not remember seeing a plugin to do this. I am not even sure if there is a single algorithm for this.