How can i find the diameter of a region?
Show older comments
Hi, I have a region of interest detected by a segmentation method. I want to find the diameter of this region in millimeter. How can i do this with matlab? This is the mask of the region

Thanks
4 Comments
diksha lade
on 23 Apr 2017
i want code for find asymetry of an image and diameter of an image..
Image Analyst
on 23 Apr 2017
I discuss the diameter in my answer below. What is your definition of asymmetry? For example the Dice Sorensen coefficient, or the standard deviation of the radii as you march around the perimeter? You should probably start your own question rather than get into a lengthy discussion here in the comment section of Carole's post.
diksha lade
on 23 Apr 2017
simple code for feature extraction last stage of our project
Image Analyst
on 23 Apr 2017
Wow - surprised that could be his master's. I wouldn't have even let it get past the journal review process. For one thing it was published in 2014 and does nothing new - it merely applies the standard ABCD skin cancer method that's been around at least 20 years, without inventing anything new. And it didn't even show results. And it does dumb and potentially harmful stuff like histogram equalization - a useless thing that novices usually incorrectly think needs to be done (probably second only to edge detection in their desire to do something even if it's unnecessary). And it doesn't even do color calibration. The asymmetry measure he's using is the Sorensen-Dice coefficient as I mentioned and discussed in Wikipedia: https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient#cite_note-11 That said, feel free to replicate his work and implement the ABCD method.
Answers (1)
Image Analyst
on 5 Nov 2012
0 votes
regionprops() has an 'EquivDiameter' measurement that you can ask for. See my Image Segmentation Tutorial "BlobsDemo" in my File Exchange if you want a demo.
5 Comments
Carole
on 5 Nov 2012
Carole
on 5 Nov 2012
Image Analyst
on 6 Nov 2012
They should be the same value, assuming you have just one region. If you have multiple regions, do it this way:
measurements = regionprops(labeledImage, 'Area', 'EquivDiameter');
equivDiameters1 = [measurements.EquivDiameter];
equivDiameters2 = sqrt(4 * [measurements.Area] / pi);
Again, they should be the same because we see in the help: " 'EquivDiameter' — Scalar that specifies the diameter of a circle with the same area as the region. Computed as sqrt(4*Area/pi). This property is supported only for 2-D input label matrices." Was there some reason why you thought there might be a difference?
Carole
on 6 Nov 2012
Image Analyst
on 6 Nov 2012
Yes it works for any shape. To spatially calibrate you need to know how many pixels correspond to a millimeter. Try imaging an object of known size and measuring it.
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!