delta.data.predict_compile_from_seg_track#

delta.data.predict_compile_from_seg_track(img_path, seg_path, files_list, *, target_size=(256, 32), crop_windows=False)[source]#

Compile an inputs array for tracking prediction with the tracking U-Net, directly from U-Net segmentation masks saved to disk.

Parameters
img_pathPath

Path to original single-chamber images folder. The filenames are expected in the printf format Position%02d_Chamber%02d_Frame%03d.png

seg_pathPath

Path to segmentation output masks folder. The filenames must be the same as in the img_path folder.

files_listlist[Path]

List of filenames to compile in the img_path and seg_path folders.

target_sizetuple of 2 ints, optional

Input and output image size. The default is (256,32).

crop_windowsbool, optional

TODO The default is False.

Returns
inputs_arr4D numpy array of floats

Input images and masks for the tracking U-Net training routine. Dimensions of the tensor are (cells_to_track, target_size[0], target_size[1], 4), with cells_to_track the number of segmented cells in all segmentation masks of the files_list.

seg_name_list[Path]

Filenames to save the tracking outputs as. The printf format is Position%02d_Chamber%02d_Frame%03d_Cell%02d.png, with the ā€˜_Cell%02dā€™ string appended to signal which cell is being seeded/tracked (from top to bottom)

boxeslist of CroppingBox

Cropping box to re-place output prediction masks in the original image coordinates.