cellects.simulation.migration
cellects.simulation.migration
Generate synthetic videos of moving cells with noisy circular patterns.
Each cell is a square region filled with a noisy circular intensity pattern; cells are
initialised at random positions and then displaced outward from the
image centre over a configurable number of frames. The resulting video
is returned as a NumPy uint8 array, optionally visualised frame‑by‑frame.
Functions:
| Name | Description |
|---|---|
moving_cells : Generate a synthetic video of moving square cells. |
|
moving_cells(im_size=1000, cell_size=50, cell_nb=25, frame_nb=20, delta=12, display=False)
Generate a synthetic video of moving square cells.
The function creates cell_nb square cells with noisy circular
intensity patterns, places them at random positions inside an
im_size×im_size field, and moves each cell away from the
image centre by delta pixels per frame for frame_nb
frames. An optional visualization of each frame can be shown
during generation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
im_size
|
int
|
Width and height of each video frame (in pixels). The video is
square, so the total size per frame is |
1000
|
cell_size
|
int
|
Side length of the square region that each cell occupies. |
50
|
cell_nb
|
int
|
Number of cells to generate. |
25
|
frame_nb
|
int
|
Number of frames in the output video. |
20
|
delta
|
int
|
Approximate displacement (in pixels) of each cell per frame, measured along the unit vector pointing away from the image centre. |
12
|
display
|
bool
|
If |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
video |
NDArray[uint8]
|
Array of shape |
Notes
- The random number generator is seeded with
42for reproducible results. - Cells are moved using a vector normalised to unit length; the displacement is rounded to the nearest integer pixel.
Examples: