API Reference¶
A toolset for single-cell trajectory modeling. See:
Danger
This code, currently, should be considered as an untested pre-release version
References
Jeremy Copperman, Sean M. Gross, Young Hwan Chang, Laura M. Heiser, and Daniel M. Zuckerman. Morphodynamical cell-state description via live-cell imaging trajectory embedding. Biorxiv 10.1101/2021.10.07.463498, 2021.
- syncell.imageprep.list_images(imagespecifier)[source]¶
list images in a directory matching a pattern..
- Parameters
imagepath (string filespecifier string) – directory :param filespecifier pattern to match for image files
- Returns
list of matching imagefiles
- Return type
list of strings
- syncell.imageprep.organize_filelist_fov(filelist, fov_pos=None, fov_len=2)[source]¶
Organize imagefiles in a list to field of view.
- Parameters
filelist (list of strings fov_pos: int fov_len: int) – list of image files :param fov_pos: string position of fov specifier :param fov_len: length of fov speficier
- Returns
list of imagefiles organized by fov (increasing)
- Return type
list of strings
- syncell.imageprep.organize_filelist_time(filelist, time_pos=None, time_len=2)[source]¶
Organize imagefiles in a list to timestamp ??d??h??m.
- Parameters
filelist (list of strings fov_pos: int fov_len: int) – list of image files :param time_pos: string position of time specifier :param time_len: length of time speficier
- Returns
list of imagefiles organized by fov (increasing)
- Return type
list of strings
- syncell.imageprep.znorm(img)[source]¶
Variance normalization (z-norm) of an array or image)..
- Parameters
img – array or image
- Returns
z-normed array
- Return type
real array
- syncell.imageprep.histogram_stretch(img, lp=1, hp=99)[source]¶
Histogram stretch of an array or image for normalization..
- Parameters
img – array or image
- Returns
histogram stretched array
- Return type
real array
- syncell.imageprep.get_images(filelist)[source]¶
Get images from list of files.
- Parameters
filelist (list of strings) – list of image files
- Returns
list of images
- Return type
list of arrays
- syncell.imageprep.get_tile_order(nrows, ncols, snake=False)[source]¶
Construct ordering for to put together image tiles compatible with incell microscope. :param nrows: number of rows ncols: number of columns snake: snake across whole image (left to right, right to left, left to right…) :type nrows: int ncols: int ncols: int snake: bool :return: constructed 2D array of image indices :rtype: 2D array (int)
- syncell.imageprep.get_slide_image(imgs, nrows=None, ncols=None, foverlap=0.0, histnorm=True)[source]¶
Construct slide image from a set of tiles (fields of view). Ordering from (get_tile_order). :param imgs: list of images nrows: number of rows, default assumes a square tiling (36 images = 8 rows x 8 cols) ncols: number of columns foverlap: fraction of overlap between images :type imgs: list of 2D images (2D arrays) nrows: int ncols: int foverlap: float :return: constructed slide image from image tiles :rtype: 2D array
- syncell.imageprep.load_ilastik(file_ilastik)[source]¶
Load ilastik prediction (pixel classification) from h5 file format. :param file_ilastik: filename :type file_ilastik: string :return: ndarray of ilastik output :rtype: 2Dxn array (2D image by n ilastik labels)
- syncell.imageprep.get_registrations(imgs)[source]¶
Apply pystackreg to get registrations along image stack :param imgs: images (Z,X,Y), registration along Z :type imgs: ndarray :return: set of transformations to register image stack, with the triplet (radial angle, x-translation, y-translation) for each image :rtype: ndarray (NZ,3), NZ number of images along Z
- syncell.imageprep.expand_registered_images(imgs, tSet)[source]¶
Apply transformations to a stack of images and expand images so they align :param imgs: images (Z,X,Y), registration along Z tSet: transformations for each image (angle, x-trans, y-trans) :type imgs: ndarray or list of images (each image same size) tSet: ndarray (NZ, 3) :return: expanded and registered image stack :rtype: ndarray (NZ, X, Y)