cellects.image_analysis.cell_leaving_detection
cellects.image_analysis.cell_leaving_detection
Contains the function: cell_leaving_detection This function considers the pixel intensity curve of each covered pixel and assesesed whether a covered pixel retrieved -partially at least- its initial intensity.
cell_leaving_detection(new_shape, covering_intensity, previous_binary, greyscale_image, fading_coefficient, lighter_background, several_blob_per_arena, erodila_disk, protect_from_fading=None, add_to_fading=None)
Perform cell leaving detection based on shape changes and intensity variations.
Checks for fading pixels by considering the internal contour of a previous binary image, applies erosion and subtraction operations, and updates the shape based on fading detection. It handles cases where the background is lighter or darker and ensures that detected fading regions do not fragment the shape into multiple components, unless specified otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_shape
|
NDArray[uint8]
|
The current shape to be updated based on fading detection. |
required |
covering_intensity
|
NDArray
|
Intensity values used to determine if pixels are fading. Should have the same dimensions as new_shape. |
required |
previous_binary
|
NDArray[uint8]
|
Binary representation of the shape at the previous time step. Should have the same dimensions as new_shape. |
required |
greyscale_image
|
NDArray
|
Greyscale image used for intensity comparison. Should have the same dimensions as new_shape. |
required |
fading_coefficient
|
float
|
A coefficient to determine fading thresholds based on covering intensity. Should be between 0 and 1. |
required |
lighter_background
|
bool
|
Flag indicating if the background is lighter. True if background is lighter, False otherwise. |
required |
several_blob_per_arena
|
bool
|
Flag indicating if multiple blobs per arena are allowed. True to allow fragmentation, False otherwise. |
required |
erodila_disk
|
NDArray[uint8]
|
Disk used for erosion operations. Should be a valid structuring element. |
required |
protect_from_fading
|
NDArray
|
An optional array to prevent certain pixels from being marked as fading. Should have the same dimensions as new_shape. |
None
|
add_to_fading
|
NDArray
|
An optional array to mark additional pixels as fading. Should have the same dimensions as new_shape. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
new_shape |
NDArray[uint8]
|
Updated shape after applying fading detection and morphological operations. |
covering_intensity |
NDArray
|
Updated intensity values. |
Source code in src/cellects/image_analysis/cell_leaving_detection.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |