Worm Toolbox

The Worm Toolbox contains modules for identifying and untangling worms and other curvilinear objects that touch and cross.

IdentifyDeadWorms

IdentifyDeadWorms identifies dead worms by their shape.

Dead C. elegans worms most often have a straight shape in an image whereas live worms assume a sinusoidal shape. This module identifies dead worms by fitting a straight shape to a binary image at many different angles to identify the regions where the shape could fit. Each placement point has a x and y location and an angle associated with the fitted shape’s placement. Conceptually, these can be visualized in three dimensions with the z direction being the angle (and with the angle, 0, being adjacent to the largest angle as well as the smallest angle greater than zero). The module labels the resulting 3-D volume. It records the X, Y and angle of the centers of each of the found objects and creates objects by collapsing the 3-D volume to 2-D. These objects can then be used as seeds for IdentifySecondaryObjects.

IdentifyDeadWorms fits a diamond shape to the image. The shape is defined by its width and length. The length is the distance in pixels along the long axis of the diamond and should be less than the length of the shortest dead worm to be detected. The width is the distance in pixels along the short axis of the diamond and should be less than the width of the worm.


Supports 2D?

Supports 3D?

Respects masks?

YES

NO

YES

References

  • Peng H, Long F, Liu X, Kim SK, Myers EW (2008) “Straightening Caenorhabditis elegans images.” Bioinformatics, 24(2):234-42. (link)

  • Wählby C, Kamentsky L, Liu ZH, Riklin-Raviv T, Conery AL, O’Rourke EJ, Sokolnicki KL, Visvikis O, Ljosa V, Irazoqui JE, Golland P, Ruvkun G, Ausubel FM, Carpenter AE (2012). “An image analysis toolbox for high-throughput C. elegans assays.” Nature Methods 9(7): 714-716. (link)

See also

See also: Our Worm Toolbox page for sample images and pipelines, as well as video tutorials.

(Jump to top)

StraightenWorms

StraightenWorms straightens untangled worms.

StraightenWorms uses the objects produced by UntangleWorms to create images and objects of straight worms from the angles and control points as computed by UntangleWorms. The resulting images can then be uniformly analyzed to find features that correlate with position in an ideal representation of the worm, such as the head or gut. StraightenWorms works by calculating a transform on the image that translates points in the image to points on the ideal worm. UntangleWorms idealizes a worm as a series of control points that define the worm’s shape and length. The training set contains measurements of the width of an ideal worm at each control point. Together, these can be used to reconstruct the worm’s shape and correlate between the worm’s location and points on the body of an ideal worm. StraightenWorms produces objects representing the straight worms and images representing the intensity values of a source image mapped onto the straight worms. The objects and images can then be used to compute measurements using any of the object measurement modules, for instance, MeasureTexture. The module can be configured to make intensity measurements on parts of the worm, dividing the worm up into pieces of equal width and/or height. Measurements are made longitudinally in stripes from head to tail and transversely in segments across the width of the worm. Longitudinal stripes are numbered from left to right and transverse segments are numbered from top to bottom. The module will divide the worm into a checkerboard of sections if configured to measure more than one longitudinal stripe and transverse segment. These are numbered by longitudinal stripe number, then transverse segment number. For instance, “Worm_MeanIntensity_GFP_L2of3_T1of4”, is a measurement of the mean GFP intensity of the center stripe (second of 3 stripes) of the topmost band (first of four bands). Measurements of longitudinal stripes are designated as “T1of1” indicating that the whole worm is one transverse segment. Likewise measurements of transverse segments are designated as “L1of1” indicating that there is only one longitudinal stripe. Both mean intensity and standard deviation of intensity are measured per worm sub-area. While StraightenWorms can straighten a color image, the module needs a grayscale image to make its intensity measurements. For a color image, the red, green and blue channels are averaged to yield a grayscale image. The intensity measurements are then made on that grayscale image.


Supports 2D?

Supports 3D?

Respects masks?

YES

NO

YES

See also

See also our Worm Toolbox page for sample images and pipelines, as well as video tutorials.

Measurements made by this module

Object measurements:

  • Location_X, Location_Y: The pixel (X,Y) coordinates of the primary object centroids. The centroid is calculated as the center of mass of the binary representation of the object.

  • Worm_MeanIntensity: The average pixel intensity within a worm.

  • Worm_StdIntensity: The standard deviation of the pixel intensities within a worm.

References

  • Peng H, Long F, Liu X, Kim SK, Myers EW (2008) “Straightening Caenorhabditis elegans images.” Bioinformatics, 24(2):234-42. (link)

  • Wählby C, Kamentsky L, Liu ZH, Riklin-Raviv T, Conery AL, O’Rourke EJ, Sokolnicki KL, Visvikis O, Ljosa V, Irazoqui JE, Golland P, Ruvkun G, Ausubel FM, Carpenter AE (2012). “An image analysis toolbox for high-throughput C. elegans assays.” Nature Methods 9(7): 714-716. (link)

(Jump to top)

UntangleWorms

UntangleWorms untangles overlapping worms.

This module either assembles a training set of sample worms in order to create a worm model, or takes a binary image and the results of worm training and labels the worms in the image, untangling them and associating all of a worm’s pieces together. The results of untangling the input image will be an object set that can be used with downstream measurement modules. If using the overlapping style of objects, these must be used within the pipeline as they cannot be saved.


Supports 2D?

Supports 3D?

Respects masks?

YES

NO

YES

See also

See also our Worm Toolbox page for sample images and pipelines, as well as video tutorials.

Measurements made by this module

Object measurements (for “Untangle” mode only):

  • Length: The length of the worm skeleton.

  • Angle: The angle at each of the control points

  • ControlPointX_N, ControlPointY_N: The X,Y coordinate of a control point N. A control point is a sampled location along the worm shape used to construct the model.

Technical notes

Training involves extracting morphological information from the sample objects provided from the previous steps. Using the default training set weights is recommended. Proper creation of the model is dependent on providing a binary image as input consisting of single, separated objects considered to be worms. You can the Identify modules to find the tentative objects and then filter these objects to get individual worms, whether by using FilterObjects, EditObjectsManually or the size criteria in IdentifyPrimaryObjects. A binary image can be obtained from an object set by using ConvertObjectsToImage.

At the end of the training run, a final display window is shown displaying the following statistical data:

  • A boxplot of the direction angle shape costs. The direction angles (which are between -π and π) are the angles between lines joining consective control points. The angle 0 corresponds to the case when two adjacent line segments are parallel (and thus belong to the same line).

  • A cumulative boxplot of the worm lengths as determined by the model.

  • A cumulative boxplot of the worm angles as determined by the model.

  • A heatmap of the covariance matrix of the feature vectors. For N control points, the feature vector is of length N-1 and contains N-2 elements for each of the angles between them, plus an element representing the worm length.

Untangling involves untangles the worms using a provided worm model, built from a large number of samples of single worms. If the result of the untangling is not satisfactory (e.g., it is unable to detect long worms or is too stringent about shape variation) and you do not wish to re-train, you can adjust the provided worm model manually by opening the .xml file in a text editor and changing the values for the fields defining worm length, area etc. You may also want to adjust the “Maximum Complexity” module setting which controls how complex clusters the untangling will handle. Large clusters (> 6 worms) may be slow to process.

References

  • Wählby C, Kamentsky L, Liu ZH, Riklin-Raviv T, Conery AL, O’Rourke EJ, Sokolnicki KL, Visvikis O, Ljosa V, Irazoqui JE, Golland P, Ruvkun G, Ausubel FM, Carpenter AE (2012). “An image analysis toolbox for high-throughput C. elegans assays.” Nature Methods 9(7): 714-716. (link)

(Jump to top)