delta.utilities

Click on the signatures below to get a complete description.

Module for utility functions and class definitions that are used in pipeline.py

A few functions are redundant from data.py, but we keep the files separate to minimize the risk of unforeseen bugs.

@author: jblugagne

Classes

Cell

CroppingBox

Lineage()

Class for cell lineages contained in each ROI

files_watcher(reader)

Daemon to watch experiment files and signal new ones (not functional yet)

xpreader([filename, channelnames, ...])

Class to read experiment files from bioformats-compatible files or from file sequences in folders

Functions

cell_area(contour)

Area of a single cell

cell_fluo(fluo_frames, mask[, roi_box])

Extract mean fluorescence level from mask

cell_perimeter(contour)

Get single cell perimeter

cell_width_length(contour)

Mesure width and length of single cell

create_windows(img[, target_size, min_overlap])

Crop input image into windows of set size.

cropbox(img, box)

Crop image

deskew(image)

Compute the rotation angle to apply to the image to remove its rotation.

division_poles(poles_cell1, poles_cell2, ...)

Identify which poles belong to the mother and which to the daughter

driftcorr(img[, template, box, drift])

Compute drift between current frame and the reference, and return corrected image

eucl(p1, p2)

Euclidean point to point distance

extract_poles(end_img, labels)

Extract poles per cell from ends image

extrema_poles(cellmask[, scaling])

A slower and more rudimentary version of poles finding but that is guaranteed to find exactly 2 poles

find_contours(mask)

wrapper for CV2's findContours() because it keeps changing signatures

findfirst(mylist)

Find first non-zero element of list

getAttributions(scores)

Get attribution matrix from tracking scores

getDriftTemplate(chamberboxes, img[, ...])

This function retrieves a region above the chambers to use as drift template

getROIBoxes(chambersmask)

Extract the bounding boxes of the chambers in the binary mask produced by the chambers identification unet

getTrackingScores(labels, outputs[, boxes])

Get overlap scores between input/target cells and tracking outputs

getcellsinframe(labels[, return_contours, ...])

Get numbers of cells present in frame, sorted along Y axis

getcentroid(contour)

Get centroid of cv2 contour

getpoles(seg[, labels, scaling])

Get cell poles

getrandomcolors(num_colors[, seed])

Pseudo-randomly generate list of random hsv colors.

getshiftvalues(shift, img_shape, cb)

Parameters

gettrackingboxes(cell[, frame_shape, ...])

Get a crop box and a fill box around a cell that fits the tracking target size

getxppathdialog([ask_folder])

Pop up window to select experiment file or folder.

image_edges(contour, image)

Identify if cell touches image borders

imrotate(frame, rotate)

Rotate image

label_seg(seg[, cellnumbers, ...])

Label cells in segmentation mask

loadmodels([toload])

Load models (as specified in config.py)

opencv_areafilt(I[, min_area, max_area])

Area filtering using openCV instead of skimage

rangescale(frame, rescale)

Rescale image values to be within range

roi_features(labels_frame[, features, ...])

Extract single-cell morphological and fluorescence features

singlecell_features(contour, mask[, ...])

Extract features for a single cell

skeleton_poles(skel)

This function was adapted from stackoverflow #https://stackoverflow.com/questions/26537313/how-can-i-find-endpoints-of-binary-skeleton-image-in-opencv

stitch_pic(results, loc_y, loc_x)

Stitch segmentation back together from the windows of create_windows()

track_poles(poles, prev_old, prev_new)

Track poles of a cell to the previous old and new poles

two_poles(poles)

Sometimes the skeleton produces more than 2 poles.

vidwrite(images, filename[, crf, verbose])

Write images stack to video file with h264 compression.