Segmenting and counting SCC cracks

Hello all!

I recently started a PhD which involves a lot of electron microscopy.
Therefore a proper knowledge of SEM image analysis is necessary.

Currently I’m involved in a project that focusses on crack initiation of stress corrosion cracks (SCC) in stainless steels.
Getting to the point, I wish to analyse SEM images, at 500x M and 10 WD, that have a lot of cracks on the surface of the material.
Interesting things that I wish to gain from these pictures are e.g. crack density (#cracks vs. distance) and crack lengths.
Obviously counting these cracks manually is ill-favored since this is a too biased method which takes up too much time.

My current understanding of Fiji is still limited.
In order to handle this problem I feel that I need to segmentate these cracks from the material itself.
However, this material has a duplex structure, it contains two allotropes of iron namely austenite (which is much more favourable to cracking) and ferrite (less favourable).
The austenite has the tendency to form small oxides which increases the crack susceptibility.
If it is possible to segmentate this cracks, it should be possible to create a mask (binary image) with ROIs that are measurable.
Before the actual segmentating phase, the pictures should need some preprocessing as well but I’m not sure which could prove useful.

If counting the cracks in this manner proves to be too difficult, It could be helpful to approach the problem in a different manner as well.
One should be able to segmentate the austenite from the ferrite and determine, in percentages, howmuch of each is present in the picture.
In this way it’s nice to prove that certain areas which contain more austenite show more cracks as well.

You can find some raw image files in the annex of this topic.
Hopefully one can point me in the right direction with a to-do list in fiji.
Thanks in advance.


Good day,

it appears as if you didn’t polish the surfaces.




Hi @anon96376101 , thanks for your reply.
These were tensile strained samples tested in a corrosive environment that I received in this condition.
These samples are indeed not polished, they were gritted with 1200 grit grains as a surface treatment.
This is because the cracks were already big enough that one didn’t need anymore surface treatment to properly distinguish them, however not polishing them does pose difficulties in segmentation.

Hopefully this answers your question.



I see little chance for reasonable automatic analyses in the sense described in your original post.

What appears obvious for the (specifically trained) eye need not be obvious for a machine and I must admit that I’ve difficulties to do what you wish by using my untrained eye …

I’m sure that others will chime in with suggestions and some methods may work for some of your images to a certain extent but this is not what I’d call a reasonable approach.

Perhaps you rethink the process of sample preparation and image acquistion. I’m no expert in electron microscopy though.

Good luck



While working I decided to analyze the percentage of austenite vs. ferrite since this looks the easiest problem to solve.
However, if one is able to analyze the cracks in the austenite then I’d really like to know how.
Perhaps in this unpolished dataset it is too difficult to do?
For this I still have a too limited knowledge, in Fiji particularly.

Anyways, back to the segmenting of the duplex structure.
After reading along I decided the most useful feature for me is the Trainable Weka Segmentation machine learning tool.
This is my working procedure for the “JSM6610_56394.tif” picture I included above.
(1) I trained the machine to determine the probability maps of both austenite and ferrite.
(2) Hence I duplicated both channels corresponding to each phase (see pic1 for austenite).
(3) Using “Threshold…” I was able to make a mask of each phase (see pic2 for austenite).
For some reason Fiji decides to invert this image (inverting LUT), I have no clue why, because now it seems to display ferrite which is quite confusing. Therefore I decided to invert LUT once again to visualize austenite in white.
(4) Using “Process > Binary > Fill Holes” I’m able to remove the holes from the ferrite phase (see pic3 for austenite).
(5) “Edit > Selection > Create Selection” to create a selection around the austenite layer.
(6) “Analyze > Measure” results in the particular area of austenite. This area is 60.88% of the total area of the picture.
(7) Verifying the area of the ferrite layer using the same 1-6 steps yields 39.54% which is complementary to the above result.




I can’t find where to download “JSM6610_56394.tif”.

Furthermore, you seem to have relaxed the demands. In nfact WEKA may separate the “duplex structure”. My concern however, were the cracks …

Please bear with those of us who like to help!


Excuse me.
I uploaded 56391 which is similar to 56394.

As I stated in the original post and again in my reply, the main problem that we wish to solve is to analyze the cracks.
A side problem may include the segmentation of austenite vs. ferrite, which I now have done.
The previous post summarized my results and understandings on this topic.
I am still looking into the main problem and I have not relaxed my demands.

I appreciate this community, the explanations that I have read and especially those (like you) that are active and interested to help.


Good Day Aaron,
Please excuse the interruption, but may I ask how these were strained and what type of corrosive environment? I just ask because appear somewhat familiar.

Hi @AaronP,

Check if Ridge detection might be the right tool once you get your imaging sorted out.


Update x2!

First of all, thanks @anon96376101 @smithrobertj and @yempski for responding.

Bob, these are specimens that were strained in slow strain rate tests (SSRTs) in an autoclave that simulates a corrosive environment.
The cracks are typical examples of stress corrosion cracking.

Yempski, thank you for pointing me into the direction of Ridge Detection.
This plugin looks promessing as it is capable of detection the cracks in some of my figures.
Currently I’m still limited to the small RAM of my laptop, but once I get this solved I’ll look further into this.
I should still play around with the parameters, since some cracks are left undetected (see example screenshot with the resulted selection).
One thing that might be difficult to solve is the fact that an oxide crystal may lie on top of a crack, therefore dividing it into two, yielding two cracks that have a smaller length than the original crack should have.
However, the next step for me is to actually polish these samples further and this should hopefully yield better results.

Im capable of detecting all the parameters that I want at this very moment.
Further suggestions may always be useful.
Thank you all.


The Ridge Detection plug-in can account for the crystal interference with adjustments so I agree with you trying to use that. Also trying to equalize the illumination gradient may help some. I know that has to be done on the image as an SEM can’t quite be adjusted very accurately at this scale.
I am very interested in your research, please keep me posted as to anything else arrises due to the allotrope effects.



I can’t measure any “illumination gradient” in the above image:


Results are from an 50 x 64 pixel area at crack-free top-left, center, and bottom-right positions.



The overall image Herb, the cracks are all over not just in the corner.

You use an interesting definition of illumination gradient.


Look at the attached and determine if this is what you are seeking. It is from Image #3 of your samples but the technique works on all of them. Also I do not think the RAM is the problem with Ridge Detector plug-in.
To%20Send%20Aaron|nullxnull Results.csv (11.1 MB)

Hi there Aaron,

Did you ever have any luck with this? I am trying to do pretty much the same thing. The problem I have is that not all cracks are being identified and sometimes it picks up oxide as a crack when it is not, these mislabeled features are often circular so perhaps there is a radius cut off that I could use to stop them being detected. I also think it is sometimes detecting one crack as several which makes the output data misleading.

Does anyone know if there are other plugins/tools in Fiji that might be able to do this? There is the local thickness function and analyze particles but I haven’t got very far with making these work so far!

Thanks is advance :slight_smile: