Question

I am facing a challange in my field and I would need some advices.

I have an image with tree rings.

To see a photo I want to work with, you can check it from my dropbox: https://dl.dropboxusercontent.com/u/65873264/Sample.jpg

I would like to write a macro/task... in which program will recognize each ring and mark it as ROI. I was trying to make this task using some plugins: Template Matching, Feature Finder and Visual grap. But those rings could be extremely variable.

What I need is something like that: With Analyze particles function program recognize all vessels (objects) on a thresholded image. Second step is fun: for each particle, it check if there is a particle around in a range of 0.5 mm. If it is, it creates an ROI including both particles and searches for next particle in the range of 0.5 mm...

There is a smillar method [http://imagej.1557.x6.nabble.com/combine-particles-in-ROI-manager-automatically-td3692844.html] But here macro at first calculates differences between two serial particles, but I need to include all particles in range of 0.5 mm.

Was it helpful?

Solution

The following ImageJ macro code makes use of the Maximum and Minimum filters in ImageJ to perform a morphological closing operation on the particles in your sample image, and it then uses the Particle Analyzer to create ROIs from those:

open("https://dl.dropboxusercontent.com/u/65873264/Sample.jpg");
run("Duplicate...", "title=[Temporary Copy]");
run("8-bit");
setAutoThreshold("Default");
run("Analyze Particles...", "size=100-Infinity show=Masks clear include in_situ");
run("Maximum...", "radius=70");
run("Minimum...", "radius=70");
run("Analyze Particles...", "size=100-Infinity clear add");
selectWindow("Sample.jpg");
roiManager("Show All with labels");
roiManager("Show All");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top