Identify single stones from a cluster for counting

I need to count the number of sand granules within the ROIs to accurately quantify ants’ behavioural response. I have been working in open-cv so far, but FIJI seems to be more tailored for this kind of analysis.

I have tried skeletonisation followed by waterhsed, with different rounds of erosion and dilation, but the stones that are more closely clustered (top tail of the stone cluster in the middle ROI in the image below) are still identified and counted as 1 item. What’s the most efficient method to obtain a separate count?

Anything that can be run within python and inbed in the rest of the analysis would be much appreciated.

I fully realize that this is not what you are asking for, but have you considered using sparse images to generate a distribution of sand grain sizes, and then applying that to the total sand grain area? I’m not great with the specifics on the stats end, but you should be able to generate some kind of mean±SD based on the area using your distribution. Which is similar to what you would get when counting objects like that, as there would always be some error in your segmentation.

Only works if you have consistent sand grain distributions, so likely would need a different distribution per site? Not sure what your variability would be.

If you really want to segment though, you might want to look into something that separates by a maximum size. Which would be another estimate! But I really don’t see even a separating line between many of those objects, so even edge filters won’t really help.

Thanks for your reply.

I am counting stones at different time steps, from initial deposition (starting from count 1) to the end of filming (70-80 stones). The number of stones is the variable whose effect on behaviour I am trying to quantify. I need a representation of how stone number changes over time. I can accept a SE of ±10%, but I the clustering worsens at later time steps, so I am wondering if there is a method to improve segmentation.

Alternatively, I can approximate the count based on area, but is there a way to automate area detection in ImageJ (via macro or via a python code)?

Can you expand on the idea of separating by maximum size? Is there a filter I can apply at the segmentation step that sets a maximum object size, else splitting (via watershed or other) should be attempted?

Again, I am new to ImageJ. I have been through the introductory tutorials and part of the documentation, but what I am looking for seems very specific.

Unfortunately, I won’t be too much more help, as I am not particularly good with ImageJ. I do know that with many segmentation programs you can set the expected size of objects, so that larger objects will be split according to the expected maximum size. Most recently I was using this in Imaris to get an estimate of 3D cell counts based on volumes. I don’t know what the equivalent would be in FIJI, but maybe someone else will be able to jump in.

Area detection should be fairly simple with thresholding and Analyze particles, as long as you can find a threshold that works for your images (in the sample image, “darker” areas seem to be what you are interested in… as long as that and your imaging conditions are constant it should be possible). Weka pixel classifier or Ilastik have both been mentioned in various places on the forum if you are having trouble generating a mask for areas. The binary mask feeds into Analyze Particles, and then I suspect you can sum the results of the analyze particles measurement. Probably would require some scripting to generate batch measurements, but that is also possible.

You will probably struggle finding a method to separate the different grains (with different sizes and shapes) that overlap.
I think that the already mentioned suggestion of total area is doable. You could also try to find out the average size of the grains to produce an estimate of the number of grains in the segmented regions.