xtracedrop program for characterizing drop shape and quantifying detergent concentrations


Program Installation

xtracedrop is a python program ( It is known to run under python 2.4 (Centos 5) or 2.6 (Windows). It relies on the following packages

Program Dependencies

  • numpy (python package)
  • scipy (python package)
    • requires blas and lapack
  • python imaging library (PIL) (python package)
  • gnuplot is used, both for fitting and for plotting results

download and unzip
It is already marked as executable, so run as ./

  • you can also type: python

download sample drop images to test installation:

  • extract with tar xvzf drop_demo.tgz

principles and practice for measuring detergent concentrations from drop shape are described here

Running the xtracedrop

  • place drop images to be analyzed into a common directory
  • run xtracedrop
  • change the filename template to match the files you want to analyze
    • a list of relevant files should appear in the main window
    • xtracedrop0.jpg
  • if desired, enter the detergent concentrations next to each filename
    • this is useful if you are analyzing a standard curve of known detergent concentrations
    • this information will allow xtracedrop to produce a plot of your results
  • change the name of the output file if desired
  • adjust the center coordinates of the drops if necessary
    • this value needs only be approximately correct
    • a single center is assumed to apply to all drops
  • Hit the "Run" button
  • Output will appear in the stdout window only after analysis of all the drops is complete
    • xtracedrop4.jpg

View results of xtracedrop

  • a summary of the results is shown in the main window
    • namely the ratio of major/minor axes of the fitted ellipse
    • the error of the fit is shown (in pixels) and should typically be ~1
    • xtracedrop1.jpg
  • the "Plot Results" button will create a plot of concentration (entered by user) vs. a/b ratio (determined by program)
    • this information is also stored in the "results file" and can be imported into another program (e.g. excel)
    • a right-click will bring up the plot and offer to save the image - make sure to specify the directory
    • xtracedrop5.jpg
  • for information on individual drops, select the number of the relevant file (shown in main window)
    • "Show Img" will bring up a window with the original image
      • xtracedrop3.jpg
    • "Show Fit" will bring up a window showing the data fitted to an ellipse
      • this fit is displayed using gnuplot. The gnuplot command file (e.g. DSC_0014-fit.gnuplot) can be used later to recreate the plot
      • xtracedrop2.jpg

Files produced by xtracedrop

    • a number of intermediate files are created that could be useful for troubleshooting
    • img-boundary.txt lists the coordinates of all the points found at the boundary of the drop/substrate
    • img-trimmed.txt lists the "trimmed" coordinates though to actually represent the surface of the drop
    • img-edge.txt lists coordinates at the lateral edges of the drop (excluded from the fit)
    • img-fit.gnuplot is a gnuplot command file used to create the plot
      • type gnuplot img-fit.gnuplot to recreate this plot
    • img-plotgnu.gnuplot is a command file for fitting the edge data to an ellipse (alternative fit to the python code)
    • results.dat (or equivalent) has a listing of the final results

-- DavidStokes - 17 Jan 2011