Running PIE single-image analysis

To analyze a single image using PIE, you can use the analyze_single_image function.

Inputs

  • input_im_path: {path}

    the path to the image to be analyzed.

  • output_path: {path}

    the directory in which image analysis folders should be created

  • image_type: {‘bright’ or ‘dark’}

    The brightness of the cell bodies relative to the image background.

  • hole_fill_area: {integer or ‘inf’}, optional, default ‘inf’

    the area (in pixels) of the largest size hole to fill in colony masks after image analysis. For low-resolution yeast imaging, we recommend setting this value to ‘inf’ (i.e. all the holes in the colonies get filled)

  • cleanup: {True or False} optional, default False

    whether or not to perform ‘cleanup’ of spurious pieces of background attached to colonies. (We recommend trying PIE both with and without cleanup on a set of sample images; you can see the Li, Plavskin et al. paper for details)

  • max_proportion_exposed_edge: {0-1} optional, default 1

    maximum proportion of the perimeter of a PIE-detected gradient object (‘PIE piece’) that may be non-adjacent to another PIE piece to avoid being removed during ‘cleanup’ steps; only used if cleanup is True. 0.75 works well for 10x yeast images, and many other images tried

  • cell_intensity_num: {1 or 2} optional, default 1

    number of distinct intensity categories belonging to cells in the image; determines whether 2 or 3 Gaussians are used to fit intensity log histogram for threshold determination. Can be set to 1 (default) or (in rare cases) 2.

  • save_extra_info: {True or False} optional, default True

    whether to write additional files described above

pie analyze_single_image INPUT_IM_PATH OUTPUT_PATH IMAGE_TYPE

or, with options

pie analyze_single_image INPUT_IM_PATH OUTPUT_PATH IMAGE_TYPE -h HOLE_FILL_AREA -c CLEANUP -m MAX_PROPORTION_EXPOSED_EDGE -s SAVE_EXTRA_INFO

Note

Inputs besides INPUT_IM_PATH, OUTPUT_PATH, and IMAGE_TYPE are optional.

Outputs

This function runs PIE, creates output folders within output_path, and writes files to:

  • colony_masks:

    the colony mask, with each colony labeled in a different number, as a tif file

  • jpegGRimages:

    a jpeg of the original image

  • single_image_colony_centers:

    a csv file containing the properties (e.g. area) of all the colonies in the image.

If save_extra_info is True (default), then additional files are saved in the following folders:

  • boundary_ims:

    a jpeg of the original image, overlaid with the contours of the colony mask

  • threshold_plots:

    plots demonstrating the detection of the threshold based on the log histogram of a background-corrected image, and files with information on curve fits and threshold values for thresholding

  • colony_center_overlays:

    a jpeg of the original image, overlaid with the contours of the colony mask and a transparent mask of the cell centers detected after thresholding