11. astec_astec

The name astec comes from the Phd work of L. Guignard [Gui15, GFL+20] where ASTEC is the acronym of adaptive segmentation and tracking of embryonic cells.

This method aims at producing a segmentation of each membrane cell image (e.g. a fused image) temporal sequence, as well as a property file containing the cell volumes, and the cell lineages (see section Image sequence properties). This is a method of segmentation by propagation: it used the segmentation of the previous timepoint (say \(t-1\)) to constraint the segmentation at the aimed timepoint (say \(t\)).

11.1. Astec method overview

Astec principle is to guide the segmentation of the \(t\) timepoint image \(I_{t}\) with the segmentation \(S^\star_{t-1}\) of the \(t-1\) timepoint image \(I_{t-1}\).

  1. A first segmentation of \(I_{t}\), \(\tilde{S}_{t}\), is computed by a seeded watershed, where the seeds are the eroded cells of \(S^\star_{t-1}\), projected onto \(I_{t}\). By construction, no cell division can occur.

  2. \(h\)-minima are computed over a range of \(h\) values. Studying the numbers of \(h\)-minima located in each cell of \(\tilde{S}_{t}\) gives an indication whether there might be a cell division or not. From this study a seed image \(Seeds_{t}\) is computed, and then a new segmentation image \(\hat{S}_{t}\).

  3. Some potential errors are detected by checking whether there is a significant volume decrease from a cell of \(S^\star_{t-1}\) and its corresponding cells in \(\hat{S}_{t}\). For such cells, seeds may be recomputed, as well as the \(\hat{S}_{t}\) segmentation.

  4. It may occur, in previous step, that some cell from \(S^\star_{t-1}\) correspond to 3 cells in \(\hat{S}_{t}\). This step aims at correcting this.

  5. Some other potential errors are detected by checking whether there is a significant volume decrease from a cell of \(S^\star_t\) and its corresponding cells in \(\hat{S}_{t}\) due to a background invasion. For such cells, morphosnakes [MarquezNBA14] are computed to try to recover cell loss.

  6. The morphosnake correction operated in previous step may invade the background too much. This step aims at correcting this.

Note that the first step above consists at solely propagate the segmentation without trying to identify potential cell divisions. By setting

propagation_strategy ='seeds_from_previous_segmentation'

in the parameter file, it is possible to disable the cell division identification, by simply using previous segmentation (eroded) cells as seeds. This also allows to propagate a segmentation backward.

See also

Section astec_astec parameters for a detailed presentation of the all fusion parameters.

Section Image registration gives some insights into image registration.

Running astec_astec with --print-param allows to print out the fusion parameters onto the terminal window.

astec_astec --print-param

11.2. Astec / output data

The results are stored in sub-directories SEG/SEG_<EXP_SEG> under the /path/to/experiment/ directory where where <EXP_SEG> is the value of the variable EXP_SEG (its default value is ‘RELEASE’).

Auxiliary results (see section Image preprocessing), ie images used to compute seeds, or images used as membranes for the watershed segmentation, are respectively stored in (or retrieved from) the REC-SEED/REC_<EXP_RECONSTRUCTION> and the REC-MEMBRANE/REC_<EXP_RECONSTRUCTION> directories. If <EXP_RECONSTRUCTION> is not present in the parameter file, <EXP_SEG> is used instead. They are not kept if the variable save_reconstruction is set to False. However, it is advised to keep them, especially in case of heavy computation (ie use of GACE or GLACE), since they may be re-used for eventual correction.

/path/to/experiment/
├── ...
├── SEG/
│  └── SEG_<EXP_SEG>
│     ├── <EN>_mars_t<begin>.<image_suffix>
│     ├── <EN>_seg_lineage.xml
│     ├── <EN>_seg_t<begin>.<image_suffix>
│     ├── <EN>_seg_t<...>.<image_suffix>
│     ├── <EN>_seg_t<end>.<image_suffix>
│     └── LOGS/
├── REC-MEMBRANE/
│   └── REC_<EXP_RECONSTRUCTION>/
│     ├── ...
│     ...
├── REC-SEED/
│   └── REC_<EXP_RECONSTRUCTION>/
│     ├── ...
│     ...
...

11.3. Input image pre-processing

The input image (typically the fused image representing the cell membranes/walls) can be pre-processed before use in the astec stage (as for astec_mars, see section Steps 1 and 4: input image pre-processing). More details can be found in section Image preprocessing. The pre-processing can be different for the

  • the seed input image (the one that will be used to compute the \(h\)-minima),

  • the membrane input image (the one that will be used as the height image for the seeded watersheds), and

  • the morphosnake input image (the one that will be used to define the morphosnake energy).

Pre-processing parameters, described in section Preprocessing parameters, and prefixed respectively by seed_, membrane_ and morphosnake_ allow to tune these pre-processings. Hence, the lines

seed_intensity_transformation = 'Identity'
membrane_intensity_transformation = 'normalization_to_u8'
morphosnake_intensity_transformation = 'Identity'
intensity_enhancement = None

come to choose the original image for both the seed extraction and the morphosnake stage, but its normalization on 8 bits for the seeded watershed (this corresponds to the choice of the historical version of astec).

If required (if the variables save_reconstruction is set to True, see Preprocessing parameters), the pre-processed images are kept and stored in the REC-XXX/REC_<EXP_SEG>/ or REC-XXX/REC_<EXP_RECONSTRUCTION>/ directories. with XXX being either MEMBRANE, SEED, or MORPHOSNAKE. (see Image preprocessing).

11.4. Step 1: \(\tilde{S}_{t}\)

A first segmentation of \(I_{t}\), \(\tilde{S}_{t}\), is computed by a seeded watershed, where the seeds are built from the eroded cells of \(S^\star_{t-1}\).

  • previous_seg_method = 'erode_then_deform'

    The cells of \(S^\star_{t-1}\) are first eroded, yielding the image \(S^e_{t-1}\), then this image is mapped onto \(I_{t}\) frame thanks to the transformation \(\mathcal{T}_{t-1 \leftarrow t}\), resulting in the eroded seed image \(S^e_{t-1 \leftarrow t} = S^e_{t-1} \circ \mathcal{T}_{t-1 \leftarrow t}\). This is the historical astec behavior.

  • previous_seg_method = 'deform_then_erode'

    \(S^\star_{t-1}\) is first mapped onto \(I_{t}\) frame thanks to the transformation \(\mathcal{T}_{t-1 \leftarrow t}\), resulting in the image \(S^\star_{t-1 \leftarrow t} = S^\star_{t-1} \circ \mathcal{T}_{t-1 \leftarrow t}\). Cells of \(S^\star_{t-1 \leftarrow t}\) are then eroded to get \(S^e_{t-1 \leftarrow t}\)

This seed image, \(S^e_{t-1 \leftarrow t}\), plus the membrane input image are used as input for a seeded watershed, and yield \(\tilde{S}_{t}\). By construction, no cell division can occur in \(\tilde{S}_{t}\) with respect to \(S^\star_{t-1}\).

If the variable propagation_strategy is set to 'seeds_from_previous_segmentation', the segmentation propagation stops and \(\tilde{S}_{t}\) is the final result.

11.5. Step 2: \(\hat{S}_{t}\)

The \(h\)-minima are computed in the seed input image for a range of \(h \in [h_{min}, h_{max}]\), with a step of \(\delta h\).

\(h_{min}\), \(h_{max}\) and \(\delta h\) are set respectively by the variables watershed_seed_hmin_min_value, watershed_seed_hmin_max_value, and watershed_seed_hmin_delta_value.

For a given cell of \(\tilde{S}_{t}\), if there is no cell division, and if the \(h\)-minima are well detected, ther should be only one \(h\)-minima included in the cell for all values of \(h\). However, if a cell division occurs, there should be mostly two \(h\)-minima included in the cell. Then, the study of the number of \(h\)-minima strictly included allows to decide whether a cell division has occur (see [Gui15], [GFL+20] for details).

This resulting seed image plus the membrane input image are used as input for a seeded watershed, and yield the image \(\hat{S}_{t}\).

If the variable propagation_strategy is set to 'seeds_selection_without_correction', the segmentation propagation stops and \(\hat{S}_{t}\) is the final result.

11.6. Steps 3 and 4: volume checking

Some potential errors are detected by checking whether there is a large volume decrease from a cell of \(S^\star_{t-1}\) and its corresponding cells in \(\hat{S}_{t}\). For such cells, seeds are recomputed, as well as the \(\hat{S}_{t}\) segmentation.

It may occur, in this step, that some cell from \(S^\star_{t-1}\) correspond, after correction, to 3 cells in \(\hat{S}_{t}\). A second step aims at correcting this.

11.7. Steps 5 and 6: morphosnake correction

This step is performed if morphosnake_correction is set to True.

Some other potential errors are detected by checking whether there is a significant volume decrease from a cell of \(S^\star_t\) and its corresponding cells in \(\hat{S}_{t}\) due to a background invasion. For such cells, morphosnakes [MarquezNBA14] are computed to try to recover cell loss.

11.8. Astec troubleshooting

11.8.1. Tuning parameters to avoid over-segmentations

Over-segmentation (or too much cell division) may be caused by too many detected seeds (Section 11.5), or too many h-minima in the seed input image (Section 11.3). These images can be found (for visual inspection) in the REC-SEED subdirectories (or in the REC-MEMBRANE if the reconstruction parameters are identical for both the seed and membrane input images). Section 16 presents the principles of input image computation, while Section 18.5 presents a comprehensive list of the parameters.

The seed input intensity image is smoothed by a Gaussian of standard deviation seed_intensity_sigma (Section 16.2) to homogenize the cell interior, and thus reducing the numer of regional minima. Increasing the value of seed_intensity_sigma, thus the smoothing strength, allows to decrease the number of minima.

Recall that the intensity_sigma’s values are in real units, to get their values in voxel unit (that is more interpretable), one has to divide them by the voxel size. Eg, for an image that has a voxel size of 0.144992, intensity_sigma = 0.6 means that the image will smoothed by a Gaussian of standard deviation \(0.6 / 0.144992 = 4.138\) voxels.

A cell division (Section 11.5) depends on the number of seeds (ie \(h\)-minima) found within the cell for various velues of \(h\). The \(h\) interval should be chosen such as the larger value (watershed_seed_hmin_max_value) does not exceed the height of the membrane separating two cells, while the smaller one (watershed_seed_hmin_min_value) remains larger than the signal variation (due to noise) within the cell (so, there will not be spurious minima due to noise).

11.9. Astec parameter file examples

11.9.1. Segmentation backward propagation

By setting delta_time_point to -1, the segmentation propagation is done backward. It is then mandatory to have propagation_strategy ='seeds_from_previous_segmentation'. Note that there will be no cell fusion (corrections have to be done subsequently). It is useful when a segmentation is easier at some late timepoint (because of some better contrast to noise ratio) than at the first timepoint.

EN = "250307-Lucie"
begin = 19
end = 0
delta_time_point = -1

EXP_FUSE = '06_00_01'
EXP_CONTOUR = '06_00_01'
EXP_SEG = '06_MARS_19'

propagation_strategy ='seeds_from_previous_segmentation'

apply_normalisation = True
intensity_transformation = 'normalization_to_u16'
normalization_max_value = 1000

reconstruction_images_combination = 'maximum'

use_membranes = True
outer_contour_enhancement = 'from_contour_image'