Pendent_Drop: An ImageJ Plugin to Measure the Surface Tension from an Image of a Pendent Drop

The pendent drop method for surface tension measurement consists in analysing the shape of an axisymmetric drop hanging from a capillary tube. This software is an add-on for the public domain image processing software ImageJ which matches a theoretical profile to the contour of a pendent drop, either interactively or by automatically minimising the mismatch. It provides an estimate of the surface tension, drop volume and surface area from the best matching parameters. It can be used in a headless setup. It is hosted on http://fiji.sc/List_of_update_sites with the source code on https://github.com/adaerr/ pendent-drop


Introduction
The shape of large drops or bubbles results from a competition between gravity, which tends to lengthen hanging drops, and cohesive forces among liquid molecules which tend to produce compact, spherical drops. The equilibrium drop shape can be analysed [4] (Figs. 1 and 2) to estimate the length scale, called the capillary length, at which these forces are of comparable magnitude. If the densities of the fluid and the surrounding medium are known, the interfacial energy, or surface tension, can be immediately deduced. Although a rough estimate of the capillary length or the surface tension can be obtained by determining the aspect ratio of the pendent drop [6], a precise determination calls for a numerical solution of the ordinary differential equation describing the drop shape.
Specialised apparatus performing this drop shape analysis is readily available, generally comprising both acquisition hardware and analysing software. There are however situations in which a commercial solution is not an option. In our case the surface tension measurement bench had to be integrated into a highly space-constrained set-up. As the experiment already relies on ImageJ [1,3] for the image analysis, it was then natural to develop a drop shape analysis as a component that integrates well with the workflow. For a classroom project on surfactants on the other hand the cost of a commercial apparatus may be prohibitive, while a work-bench for roughly one hundred Euro based on a web-cam (cf. Fig. 3) in conjunction with the present software already yields a measurement precision around one percent, which is entirely satisfactory in that context.
The Pendent_Drop software is currently used in our group to study the slow adsorbtion dynamics of surfactants produced by Bacillus subtilis (see Fig. 4).

Implementation and architecture Outer layout
This software is implemented as a Command for the ImageJ/SciJava framework, which takes care of populating necessary parameters and services [9].

Internal algorithm
The differential equation for the drop shape is integrated using a fourth order Runge-Kutta scheme, except near the tip singularity where we can explicitly write a sufficiently precise approximate solution. The mean square distance between this theoretical contour and the border extracted from the drop image is then minimised by varying the contour parameters along a set of directions in parameterspace updated according to a strategy described by Powell [10] until a (local) optimum is found (see Fig. 2). More details about both the underlying physics and the algorithm can be found in the PDF article installed along with the software (Plugins->Drop Analysis->About Pendent Drop) [11].

Similar software (for ImageJ)
The Low-Bond Axisymmetric Drop Shape Analysis (LBADSA) method [5] uses an image energy approach to fit a first-order approximation of the Young-Laplace equation to the whole image data instead of first detecting the drop contour. A similar approach was taken by the previous version of Pendent_Drop (version 1.x is accessible only via the github repository). It would be interesting to study if this really provides any gain in precision over the computationally much less expensive sub-pixel boundary detection in Pendent_Drop version 2.
x. An interesting feature of the cited LBADSA implementation is that contact angles of sessile drops can be precisely estimated by simultaneously fitting both the drop and its reflection in the substrate. DROPFIT [6,7,8] computes the surface tension of pendent drops by comparison with precomputed profiles. It should be only slightly less precise because of the discretisation of its parameter space, while being the computationally least expensive approach.
No benchmarks have been performed yet to compare different softwares.

Operating system
Requirements are the same as for the ImageJ software (http://imagej.net/): as of writing any Java Virtual Machine version 6 (Java 1.6) or above. The code requires ImageJ version 1.43 or above.

Programming language
This software is written in Java 1.6.

Additional system requirements
No further requirements.

Dependencies
Pendent_Drop will usually be used as an add-on to ImageJ. In this case a working ImageJ application on the host is all that is needed [2].
If used headless or in another context, merely the ImageJ libraries are required, as indicated in the pom.xml file for Apache maven at the root of the source tree: https://github.com/adaerr/pendent-drop/blob/master/ pom.xml Currently Pendent_Drop depends on the imagej artifact net.imagej and its dependencies listed in the parent pom-imagej version 7.1.0.
The build-automation tool maven from the Apache project may be used to download all necessary artifacts to build this software. (3) Reuse potential

Direct reuse for similar problems
Instead of analysing the shape of a pendent drop, one can use this code as is on images of sessile drops or of bubbles (sessile or pendent). Images of sessile drops or pendent bubbles simply have to be flipped upside-down because the plugin assumes that the base of the drop is at the top and the tip below. The software can also be easily extended to calculate slopes at selected points, e.g. to measure contact angles on substrates.

Reuse as part of other software
The Pendent_Drop software can be integrated into other Java software by using the imagej/scijava framework to populate its input parameters and invoke it as a command, typically via instructions such as An API for more fine-grained control of the functionality is planned.

Reuse for other geometries
Pendent_Drop can also be modified to analyse other free surface geometries, such as the meniscus near a wall or around a fiber plunging into a liquid bath. In detail this requires the adaptation of the Contour and DContour classes to parameters describing the new geometry. In the main class various methods require some rewriting: the differential equation describing the meniscus goes in deriv(), and the integrations bounds in calculateProfile() must be specified. The initial parameter estimation in dropShapeEstimator() needs to be adapted to extract correct shape descriptors from the image for the new geometry. If the new geometry is not right-left symmetric, findDropBorders(), makeClosed-Path(), updateOverlay() and any other method referring to left/rightBorder must be modified. Finally calcSurface() and calcVolume() have to be either deleted or adapted to yield correct results.