cellpose_omni.models#
bool(x) -> bool |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
Built-in mutable sequence. |
|
|
main model which combines SizeModel and CellposeModel |
|
|
Path subclass for non-Windows systems. |
|
Built-in mutable sequence. |
|
bool(x) -> bool |
|
bool(x) -> bool |
|
|
linear regression model for determining the size of objects in image used to rescale before input to cp_model uses styles from cp_model |
|
|
|
|
Instances of the Logger class represent a single logging channel. |
|
|
cellpose_omni.io#
|
|
|
find all images in a folder and if look_one_level_down all subfolders |
|
Get the corresponding labels and flows for the given file images. |
|
|
|
|
|
|
|
|
|
Read a txt or csv file with label links. These should look like: 1,2 1,3 4,7 6,19 . . . Returns links as a set of tuples. |
|
Loads the training and optional test data for training runs. |
|
|
|
save output of model eval to be loaded in GUI |
|
|
|
save masks + nicely plotted segmentation image to png and/or tiff |
|
Uploads a *_seg.npy file to the bucket. |
|
deprecated (runs io.save_masks with png=True) |
|
Write label link file. |
cellpose_omni.plot#
|
returns pixels of disk with radius r and center med |
|
dP is 2 x Y x X => 'optic' flow representation |
|
image is 2 x Ly x Lx or Ly x Lx x 2 - change to RGB Ly x Lx x 3 |
|
get patch of size bsize x bsize with most masks |
|
overlay masks on image (set image to grayscale) |
|
masks in random rgb colors |
|
Generates a red outline overlay onto image. |
|
plot segmentation results (like on website) |
cellpose_omni.metrics#
|
AJI = intersection of all matched masks / union of all masks |
|
average precision estimation: AP = TP / (TP + FP + FN) |
|
boundary precision / recall / Fscore |
|
error in flows from predicted masks vs flows predicted by network run on image |
|
return best-matched masks |
cellpose_omni.dynamics#
|
compute masks using dynamics from dP, cellprob, and boundary |
|
define pixels and run dynamics to recover masks in 2D |
|
create masks using pixel convergence after running dynamics |
|
convert labels (list of masks or flows) to flows for training model |
|
bilinear interpolation of image 'I' in-place with ycoordinates yc and xcoordinates xc to Y |
|
convert masks to flows using diffusion from center pixel |
|
convert masks to flows using diffusion from center pixel Center of masks where diffusion starts is defined to be the closest pixel to the median of all pixels that is inside the mask. |
|
convert masks to flows using diffusion from center pixel Center of masks where diffusion starts is defined using COM :param masks: labelled masks 0=NO masks; 1,2,...=mask labels :type masks: int, 2D or 3D array |
|
remove masks which have inconsistent flows |
|
run dynamics of pixels to recover masks in 2D |
|
|
|
run dynamics of pixels to recover masks in 3D |
cellpose_omni.transforms#
|
average results of network over tiles |
|
return image with z first, channels last and normalized intensities |
|
make tiles of image to run at test-time |
|
move axis m_axis to first or last position |
|
Move ndarray axis to new location, preserving order of other axes. |
|
move minimum dimension last as channels if < 10, or force==True |
|
normalize image so 0.0 is 0.01st percentile and 1.0 is 99.99th percentile |
|
|
|
normalize each channel of the image so that so that 0.0=1st percentile and 1.0=99th percentile of image intensities |
|
augmentation by random rotation and resizing X and Y are lists or arrays of length nimg, with dims channels x Ly x Lx (channels optional) |
|
pad image for test-time so that its dimensions are a multiple of 16 (2D or 3D) |
|
augmentation by random rotation and resizing |
|
reshape data using channels |
|
inputs converted to correct shapes for training and rescaled so that 0.0=1st percentile and 1.0=99th percentile of image intensities in each channel |
|
check sizes and reshape train and test data for training |
|
resize image for computing flows / unresize for computing dynamics |
|
reverse test-time augmentations for averaging |
|