How to count average width

imagej

#1

Hi!
I would like to ask about solution how to count average width of object. I have a broken file on photo and after binary I’m using segmented line to get length value. It’s hard to do this same with width, because this broken file has many other widths so I want to get this average width.

Here is a sample and I would like to get a width of this white element in root.


#2

Good day,

the problem is that with one sample image (of obscure origin and quality) it is difficult to suggest a solution that will work in general.

Here is an ImageJ-macro that works for the provided sample image and it assumes that there is a single object only of the described type in the image:

// imagej-macro "maximum" (Herbie G., 09. Jan. 2019)
requires( "1.52j" );
setOption("BlackBackground", true);
setBackgroundColor(0,0,0);
run("Set Measurements...", "feret's redirect=None decimal=2");
makeRectangle(0,0,getWidth(),getHeight()-45);
run("Crop");
setAutoThreshold("Shanbhag dark");
run("Convert to Mask");
run("Analyze Particles...", "  circularity=0.00-0.20 display exclude clear add");
roiManager("Select", 0);
run("Clear Outside");
exit();
// imagej-macro "maximum" (Herbie G., 09. Jan. 2019)

Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it with the image open in ImageJ.

In the Results table two measures are important:
Feret: Estimate of the object length (in pixels)
MinFeret: Estimate of the maximum object width (in pixels)

To get the mean width requires a more complicated approach.
The mean width of the object of your sample image is about 13pixels.

For details please study the ImageJ User Guide and especially Section 30.7.

Regards

Herbie


#3

Hello paatryk01,
This is a P.S. to Herbie reply. The mean width will be = (1/2*(Feret*MinFeret)/Feret)

Bob