Code covered by the BSD License

### Highlights from Geometric measures in 2D/3D images

5.0
5.0 | 3 ratings Rate this file 68 Downloads (last 30 days) File Size: 101 KB File ID: #33690 Version: 1.4

# Geometric measures in 2D/3D images

### David Legland (view profile)

09 Nov 2011 (Updated )

Measure of geometric parameters in 2D or 3D images (surface area, perimeter, Euler Number...)

File Information
Description

Contains various functions for measuring or estimating geometric quantities from 2D or 3D images.
Parameters available for 2D images are:
* the area (number of pixels)
* the perimeter (based on Crofton formula)
* the(2D) Euler Number
Parameters available for 3D images are:
* the volume,
* the surface area (measured using the Crofton formula),
* the surface area of the interface between two labels
* the mean breadth (also known as integral of mean curvature),
* the (3D) Euler Number

Most functions work both for binary and label images. It is possible to specify options (connectivity for Euler Number, number of directions for perimeter or surface area), as well as image resolution in each direction. For some parameters, it is also possible to estimate the density with respect to image area or volume.

Example 1: measure perimeter in 2D label image
p = imPerimeter(lbl)
p =
184.8668 154.9495 185.1921 267.1690 187.3183 179.5038 182.7406 180.8445 155.5049 155.5049

Example 2: measure surface area in 3D binary image
bin = imclose(img>0, ones([5 5 3]));
S = imSurface(bin, [1 1 2.5]) % specify resolution
ans =
2.7291e+004

These functions were developped when writing the following article:
Legland, D.; Kiêu, K. & Devaux, M.-F. Computation of Minkowski measures on 2D and 3D binary images. Image Anal. Stereol., 2007, 26, 83-92, http://www.ias-iss.org/ojs/IAS/article/view/811.

Acknowledgements

This file inspired Areal, Volumetric And Textural Parameters From 2 D And 3 D Images.

MATLAB release MATLAB 7.9 (R2009b)
MATLAB Search Path
```/
/imMinkowski```
Other requirements Image processing toolbox should not be necessary, but can be useful.
04 Jun 2015 David Legland

### David Legland (view profile)

Hi Leonard,
yes, there are four Minkwoski functionals for 3D structures. They are implemented in this submission as imVolume, imSurface, imMeanBreadth (related to the integral of mean curvature), and imEuler3d (related to integral of gaussian curvature, and to Euler number in 3D...).
Regards!

Comment only
02 Jun 2015 Leonard

### Leonard (view profile)

Hello David,

I am attempting to calculate the Minkowski Functionals for a set of clustered 3D volumes and in my research for definitions of the Minkowski Functionals I came upon this MFEX submission.

To preface my question, it is well known that in 2D systems there are three total Minkowski Functionals: the cluster SA, the cluster perimeter, and the Euler Number (number of clusters - number of holes). Based on the general definition of the Minkowski Functionals that I currently have, there should therefore be 4 functionals for 3D clusters: cluster volume, cluster SA, and two more. One of these is certainly related to the Euler number in 3D.

Does the program which you have developed calculate these 3rd and 4th quantities? If so, could you fill me in on how they are defined (in layman's terms)?

Thanks!
Lenny

Comment only
27 Apr 2015 David Legland

### David Legland (view profile)

Hi Amir,
I suppose you have acquired 3D images. Functions of this package work with binary images, so you need to binarize (segment) them. Then the volume of each cylinder is the number of voxels. If you want the volume in metric unit, you need to multiply by the product of resolutions in each direction (to have the volume of an individual voxel). But if you just want to compare the volumes, I suppose you can consider the ratio of the volumes in pixels after and before the deformation?

Comment only
25 Apr 2015 amir meh

### amir meh (view profile)

Hi David
Assume we have two images from a cylindrical specimen before and after deformation (during this deformation the volume of the sample has been changed). we know the initial volume of the sample and the deformation occurs symmetrically. so we can assume that the 2D image of this sample shows a central section of specimen. the overall sample volume is obtained by representing the sample as a series of stacked circular disks. for each disk, it is assumed that the thickness of the disk is equal to a vertical pixel, while the diameter is equal to the number of horizontal pixels of each disk. so the volume of each disk can be calculated by (pi*((number of horizontal pixel)^2)/4*one pixel (the height of a disk)). the volume of the sample is calculated as the sum of the volume of the disks. by knowing the initial volume of sample we can calibrate the calculated volume of sample in first image (before deformation). now we want to convert the calculated volume of sample in image 2 (after deformation) from pixel to engineering unit and compare it to initial volume. the question is how we can do that in MATLAB. do you have any idea?

Comment only
22 Apr 2015 David Legland

### David Legland (view profile)

@Amir:
There are examples on the FEx page, as well as on the main help page when you type "help imMinkowski". There are also working examples on (quasi) each function in the library, you can get them by "help imSurface", for example.

Comment only
22 Apr 2015 amir meh

### amir meh (view profile)

that would be a good idea if you could provide some examples and procedure for your code.

Comment only
10 Sep 2014 David Legland

### David Legland (view profile)

@Hamed:
It will be difficult for me to answer your question... I think you should ask your question in more appropriate location, such as Matlab Answers, StackOverflow.com, or similar forums.

Comment only
10 Sep 2014 David Legland

### David Legland (view profile)

Hi Mike,
you can have a look at the paper for which I wrote this contribution:
Legland, D.; Kiêu, K. & Devaux, M.-F. Computation of Minkowski measures on 2D and 3D binary images Image Anal. Stereol., 2007, 26, 83-92, http://www.ias-iss.org/ojs/IAS/article/view/811

You can also find resources in the book "Statistical Analysis of microstructures in Material Sciences", by J Ohser and F. Muecklich (they provide some C code too).
regards,
David

Comment only
09 Sep 2014 hamed

### hamed (view profile)

I have a problem.Any body can help me please?!
I have a series of images of a blood clot in the coronary artery angiography .(These photos are from different angles and different thicknesses of clot) .I want process these two-dimensional images to estimate the VOLUME of the clot anymore. please help me!
thank you so much....

Any idea?
hamed_eisaie@yahoo.com

05 Sep 2014 Mike

### Mike (view profile)

Hello, I am using your method "imMeanBreadth" for a school project, but I need to know the formula. Can you please also provide your reference?
Thank you!

Comment only
05 Mar 2014 David Legland

### David Legland (view profile)

Hi Sara,
For 3D objects you can compute surface area or volume using following code:
surf = imSurface(BIN); vol = imVolume(BIN);
(assuming BIN is a logical array containing the binarisation of the structure).

You can specify resolution as a 1-by-3 row vector containing size of voxel in x, y and z directions. Ex:
surf = imSurface(BIN, [2.5 2.5 5.2]);

Comment only
04 Mar 2014 sara

### sara (view profile)

hi , may you give the complite code for measuring 3D size of the object located in calibrated space please ? any one

12 Mar 2012 Ashok Kumar Pant

### Ashok Kumar Pant (view profile)

It helps me for feature Extraction from Handwritten Characters. Thank you Devid.

25 Nov 2011 David Legland

### David Legland (view profile)

Hi Sven,
I have a code for computing inertia ellipsoid of a set of points. I can adapt it easily to compute inertia ellipsoid of a binary image. I try to package it and submit it soon !

Comment only
23 Nov 2011 Sven

### Sven (view profile)

Hi David, the ability to specify image resolution is a big plus. Nice work. One thing that I find is that I wish the regular IP "Orientation" and "Majory/MinorAxis" statistics could be implemented for 3D. For instance, from a 3D mask I generally want to know "is this a long thin blob or a more rounded blob". Basically, the moments of inertia of the blob would be hugely helpful. Any plans to implement this?

Comment only
11 Sep 2014 1.1

fix some bugs in imPerimeterDensity and imSurface, add imJointSurface

17 Sep 2014 1.3

improve management of label images: add psb to compute functionals only on specific labels, and enhance automatic detection of labels in image

20 Apr 2015 1.4

Added support for computation of mean breadth density, and of look-up tables for several parameters. Default number of directions for computing surface area is 13, resulting in more accurate results.