phenotypic.data.make_synthetic_plate#
- phenotypic.data.make_synthetic_plate(nrows: int = 8, ncols: int = 12, plate_h: int = 2048, plate_w: int = 3072, bit_depth: int = 8, colony_rgb: Tuple[float, float, float] = (0.96, 0.88, 0.82), agar_rgb: Tuple[float, float, float] = (0.55, 0.56, 0.54), seed: int = 1, spacing_factor: float = 0.85, colony_size_variation: float = 0.15) numpy.ndarray[source]#
Generate a synthetic array plate with multiple colonies arranged in a grid.
- Parameters:
nrows (int) – Number of rows in the plate array (e.g., 8 for 96-well plate).
ncols (int) – Number of columns in the plate array (e.g., 12 for 96-well plate).
plate_h (int) – Total plate image height (pixels).
plate_w (int) – Total plate image width (pixels).
bit_depth (int) – 8 or 16.
colony_rgb (Tuple[float, float, float]) – Linear RGB in [0,1] for colony tint. Will be forced lighter than agar.
agar_rgb (Tuple[float, float, float]) – Linear RGB in [0,1] for agar background.
seed (int) – RNG seed for reproducibility.
spacing_factor (float) – Factor controlling spacing between colonies (0-1). Lower = more spacing.
colony_size_variation (float) – Random variation in colony sizes (0-1). 0 = uniform size.
- Returns:
plate_h x plate_w x 3 RGB array, dtype uint8 or uint16.
- Return type:
np.ndarray
Example
# Create a standard 96-well plate (8x12) plate = make_synthetic_plate(rows=8, cols=12, plate_h=2048, plate_w=3072)
# Create a 384-well plate (16x24) plate = make_synthetic_plate(rows=16, cols=24, plate_h=2048, plate_w=3072)