Script Usage

droppy.droppy.analyze_frame(im, time, bounds, circ_thresh, lin_thresh, σ, low, high, ε, lim, fit_type)

Report the main findings for a single contact angle image

Takes the provided image and fits it with the specified method [‘linear’, ‘circular’, ‘bashforth-adams’] to calculate the droplet contact angle, baseline width, and volume.

Its main use lies within the DropPy main script, but it can also be used externally for debugging individual frames of a video file.

Parameters
  • im – 2D numpy array of a grayscale image

  • time – float value of the movie time after burn-in

  • bounds – edges of the box which crop the image

  • circ_thresh – height above which the baseline does not exist

  • lin_thresh – distance that preserves a set of linear points on the droplet

  • σ – value of the Gaussian filter used in the Canny algorithm

  • low – value of the weak pixels used in dual-thresholding

  • high – value of the strong pixels used in dual-thresholding

  • ε – size of finite difference step to take in approximating baseline slope

  • lim – maximum number of iterations to take during circle fitting

  • fit_type – specified method for fitting the droplet profile

Returns

5-tuple of (L, R) contact angles, contact area diameter, calculated droplet volume, fitted (x, y) points on droplet, and fitted (x,y) points on baseline

droppy.droppy.main(argv=None)

Main analysis method for DropPy package

This is the main entry point to the DropPy package for most users, and will serve as the most useful call signature. In addition to providing a functional form for accessing the DropPy software, the same features are provided by the droppy script at any command line interface where DropPy is installed. To access via the command line interface, simply use:

$ droppy "filename" --fitType bashforth-adams

The above call will analyze the video/image/directory using the Bashforth- Adams fitting method, and will output the results in a csv of the same name for further visualization/processing. The different options for this script can be found by running:

$ droppy --help

Options:

-h, --help

show this help message and exit

-c, --circleThreshold

Number of pixels above the baseline at which points are considered on the droplet

-l, --linearThreshold

The number of pixels inside the circle which can be considered to be linear and should be fit to obtain angles

-f, --frequency

Frequency at which to analyze images from a video

--sigma

Initial image filter used for edge detection

--checkFilter

Set flag to check the provided filter value or procede without any confirmation

-s, --startSeconds

Amount of time in which video should be burned in before beginning analysis

--fitType

{linear,circular,bashforth-adams} Type of fit to perform to identify the contact angles

--tolerance

Finite difference tolerance

--maxIters

Maximum number of circle fitting iterations

--blockAtEnd

Flag to keep plots at the end of the script open for user review

--crop

Flag to prevent automatic cropping of the image using Hough transforms

-k, --keyword

Keyword argument to match certain files in the directory, will be ignored if the path is a single file

-r, --redo

Flag to recalculate results for path, whether it has already been performed or not

--nproc

Number of processes to use for the parallel computation. If nproc == 1, the frames are analyzed in serial.

To use this function within an interactive Python session, the function can be called explicitly.

>>> main(['filename','--fitType', 'bashforth-adams'])

This will result in exactly the same behavior as the script, but provides an interactive interface.

Parameters

argv – String command line arguments passed to the parser

Returns

Outputs a text-based table of contact angles and baseline widths to the command line from which the program is run. Additionally, several simple plots are generated including a comparison between the original image files and the calculated fits and the contact angle and baseline width over time. Finally, these data are exported to a csv with the following naming structure “results_{filename}.csv”

droppy.droppy.parse_cmdline(argv=None)

Extract command line arguments to change program execution

Parameters

argv – List of strings that were passed at the command line

Returns

Namespace of arguments and their values