Module: 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.



Select the input image

The name of a binary image from a previous module. IdentifyDeadWorms will use this image to establish the foreground and background for the fitting operation. You can use ApplyThreshold to threshold a grayscale image and create the binary mask. You can also use a module such as IdentifyPrimaryObjects to label each worm and then use ConvertObjectsToImage to make the result a mask.

Name the dead worm objects to be identified

This is the name for the dead worm objects. You can refer to this name in subsequent modules such as IdentifySecondaryObjects

Worm width

This is the width (the short axis), measured in pixels, of the diamond used as a template when matching against the worm. It should be less than the width of a worm.

Worm length

This is the length (the long axis), measured in pixels, of the diamond used as a template when matching against the worm. It should be less than the length of a worm

Number of angles

This is the number of different angles at which the template will be tried. For instance, if there are 12 angles, the template will be rotated by 0°, 15°, 30°, 45° ... 165°. The shape is bilaterally symmetric; that is, you will get the same shape after rotating it by 180°.

Automatically calculate distance parameters?

This setting determines whether or not IdentifyDeadWorms automatically calculates the parameters used to determine whether two found-worm centers belong to the same worm.

Select Yes to have IdentifyDeadWorms automatically calculate the distance from the worm length and width. Select No to set the distances manually.

Spatial distance

(Used only if not automatically calculating distance parameters)
Enter the distance for calculating the worm centers, in units of pixels. The worm centers must be at least many pixels apart for the centers to be considered two separate worms.

Angular distance

(Used only if automatically calculating distance parameters)
IdentifyDeadWorms calculates the worm centers at different angles. Two worm centers are considered to represent different worms if their angular distance is larger than this number. The number is measured in degrees.