How can I calculate the fractal dimension (box-counting dimension) of each ROI in imageJ?

Hi,
I have many ROIs and I want to determine their 2D shape using fractal analysis. How can I get the results in my Result table along with all other measurements (feret, area, etc.)?
I don’t have any knowledge of fractal analysis.

Thanks

Li

fractal1.zip (12.6 KB)

I copied your screenshot image into ImageJ.

Here I have a macro which does the following.

  1. It measures all particles in the image (converted to a binary) with the particle analysis.
  2. Crops all particles (from ROI’s collected in the ROI Manager)
  3. For each new image measures the ImageJ default “Fractal Box Count” (and then closes them, too).

The first 8 entries are the measurements of the particle analysis, the next 8 are from the “Fractal Box Count”

run("Make Binary");
setAutoThreshold("Default");
run("Set Measurements...", "area mean centroid perimeter bounding shape feret's display redirect=None decimal=3");
run("Analyze Particles...", "display clear add");

/*Show all selections in the image with (mouse) selectable labels!*/
roiManager("Show All with labels");
mainTitle=getTitle();
for (u = 0; u < roiManager("count"); ++u) {
    run("Duplicate...", "title=crop");
    roiManager("Select", u);
    run("Crop");
    run("Fractal Box Count...", "box=2,3,4,6,8,12,16,32,64");
    close();
    close("crop");
    //Next round!
    selectWindow(mainTitle);
}

Please note that there are also other plugin exists using a different algorithm for the fractal measurements, see, e.g.:

https://imagej.nih.gov/ij/plugins/fraclac/fraclac.html

See also:

https://forum.image.sc/search?q=fractal%20analysis