# Size distribution of nanoparticles from a transmission electron microscopic image

I have found a research article about Martian sand grain size determination from the image using Mathematica (Figure 2 in the linked article). They have not provided any detail of the methodology. It could have many applications in biology specially in the microscopy.

May be it is simple, but I have no idea how to do it. Any help would be much appreciated. I have enclosed an image of gold nanoparticles here. There's a reference size bar at the bottom right of the image.

-
Related question: mathematica.stackexchange.com/q/15921. Also see this blogpost on wolfram.com –  rm -rf Sep 22 '13 at 16:32
Related questions: 25137, 27075 –  Michael E2 Sep 22 '13 at 16:46

We can try the following script to specify that each particle strictly contained in the field-of-view should be treated as a morphological component (the scale bar an text is removed with DeleteSmallComponents, which can be manually adjusted):

particleImage = Import["http://i.stack.imgur.com/udW8X.jpg"]
m = DeleteSmallComponents[DeleteBorderComponents[MorphologicalComponents[ColorNegate[Binarize[particleImage]]]]];
m // Colorize


Notice here that I had to apply ColorNegate since Mathematica v9 apparently considers bright pixels to define regions of interest.

We can then use ComponentMeasurements to calculate something like an equivalent disk radius for each particle (there are a lot of other size measurement options):

equivDiskRadii = ComponentMeasurements[m, "EquivalentDiskRadius"][[All,2]]
(* {15.6759, 13.923, 14.5819, 13.4698, 14.9909, 12.5904, 13.8772, 15.5229, 14.8308,
15.8174, 13.5875, 14.6906, 14.6906, 14.7986, 14.2507, 12.8902, 14.1498, 13.8772,
14.8629, 14.7014, 14.161, 15.2122, 15.5332, 14.4393, 13.4106, 16.4875, 14.0822,
14.8629, 14.3619, 14.9909, 14.56, 13.159, 16.6794, 15.3372, 15.757, 14.6472, 15.0439,
14.4062, 14.1047, 14.2395, 13.1953, 14.3619, 16.0472} *)


which is measured in pixels. We can manually check that the $20$ nm scale bar is about $\approx 60$ pixels in length, and as such convert the equivalent disc radii to nanometers:

equivDiskRadiiNanometers = equivDiskRadii * 20/60
(* {5.2253, 4.641, 4.86063, 4.48993, 4.99697, 4.1968, 4.62573, 5.1743, 4.9436, 5.27247,
4.52917, 4.89687, 4.89687, 4.93287, 4.75023, 4.29673, 4.7166, 4.62573, 4.9543, 4.90047,
4.72033, 5.07073, 5.17773, 4.8131, 4.4702, 5.49583, 4.69407, 4.9543, 4.7873, 4.99697,
4.85333, 4.38633, 5.5598, 5.1124, 5.25233, 4.8824, 5.01463, 4.80207, 4.70157, 4.7465,
4.39843, 4.7873, 5.34907} *)


Is this sort of what you're looking for?

The command:

ComponentMeasurements[m, "Properties"]


yields all of the possible built-in measurements that can be made on the components:

{"AdjacentBorderCount", "AdjacentBorders", "Area", "AreaRadiusCoverage", "AuthalicRadius", "BoundingBox", "BoundingBoxArea", "BoundingDiskCenter", "BoundingDiskCoverage", "BoundingDiskRadius", "CaliperElongation", "CaliperLength", "CaliperWidth", "Centroid", "Circularity", "Complexity", "ConvexArea", "ConvexCount", "ConvexCoverage", "ConvexPerimeterLength", "ConvexVertices", "Count", "Dimensions", "Eccentricity", "Elongation", "EmbeddedComponentCount", "EmbeddedComponents", "EnclosingComponentCount", "EnclosingComponents", "EquivalentDiskRadius", "EulerNumber", "ExteriorNeighborCount", "ExteriorNeighbors", "FilledCircularity", "FilledCount", "Fragmentation", "Holes", "InteriorNeighborCount", "InteriorNeighbors", "Label", "LabelCount", "Length", "Mask", "MaxCentroidDistance", "MaxPerimeterDistance", "MeanCaliperDiameter", "MeanCentroidDistance", "Medoid", "MinCentroidDistance", "MinimalBoundingBox", "NeighborCount", "Neighbors", "Orientation", "OuterPerimeterCount", "PerimeterCount", "PerimeterLength", "PolygonalLength", "Rectangularity", "SemiAxes", "Width"}

-