Analysis of Pits


Dear ImageJ Community,

currently I am trying to analyse pit marks in a material, that are made by fibers. My goal is to measure all pits and their aspect ratio, therefore I need to use the analyze particle function of ImageJ.
Unfortunately, i do not know how manipulate the image, so that ImageJ can use the particle analyzer to detect the pits properly.

I attached an example.

Hopefully anyone of you can help me out!

Best regards



Welcome to the Forum!

You can look into using the Fiji plugin Trainable Weka Segmentation to locate/segment your ‘pits’. That will give you a probability map that you can use to auto-threshold and then analyze particles

There is a helpful workshop on Segmentation in Fiji (and corresponding slides) - that goes over the basics of this plugin, but also other ways to develop segmentation workflows in ImageJ/Fiji that will help you in your analysis.

Hope this helps!

eta :slight_smile:


Hello eta,

thanks a lot for your quick, detailed and helpful reply. I will look into this tomorrow at work. As soon as i succeed or fail I will contact you again!

Best regards


Thanks for the advice. I tried the trainable weka segmentation and it works much better than expected. I would like to ask you, what setting you wuld recommend regarding my picture. For my first attempts I tried the standard-settings plus the structure check box.



I’m so glad you find it helpful! I personally love this plugin… so fun and powerful.

Unfortunately - I’m no expert in feature selection… but yes, Structure and perhaps Neighbors are good choices. @iarganda might be able to point you in the right direction. But if I were you - I would just read up on the different features and try a few combinations until you are happy with your segmentation.

Sorry I can’t help too much more in this… but you are FOR SURE on the right track!

eta :slight_smile:



Thanks again for your extraordinary kind reply eta.

I’ll check out the documentation and try some things out. I’ll update the status as soon as there are some new results.


Dear @SanguisFerrum and @etarena,

Since the image does not have clear borders between objects, I would focus on the image features related to texture: Gaussian, Mean, Maximum, Minimum, Median, Entropy, etc.

You can have a look at the recommendations we give in the supplementary material of the plugin publication about how to perform the selection of features.

I hope it helps!



Thanks for your help. With these settings i could get reasonable results:

The only problem that I run into from now on: my computer runs out of when analyzing the full picture (200 MB image size). Any ideas? (besides using a computer with more RAM, this one has 8, and yes, I am running 64-bit)

I do not know how to properly express my gratitude. Your responses were quick and helpful.


Have you tried cropping your image in different pieces and applying the classifier to the pieces?

Also, are the results without the Sobel and Hessian features much worse?


Sorry to but in but have you tried also to expand the ram used? You most likely are not using all your ram, just the amount assigned to ImageJ.
Goto edit>options>memory & threads to expand usable memory.