# 6. `astec_astec`

¶

The name `astec`

comes from the Phd work of L. Guignard [Gui15] 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. 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\)).

## 6.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}\).

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.

\(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}\).

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.

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.

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.

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

## 6.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`

’).

```
/path/to/experiment/
├── ...
├── SEG/
│ └── SEG_<EXP_SEG>/
│ ├── <EN>_mars_t<begin>.inr
│ ├── <EN>_seg_lineage.xml
│ ├── <EN>_seg_t<begin>.inr
│ ├── <EN>_seg_t<:math:`\ldots`>.inr
│ ├── <EN>_seg_t<end>.inr
│ ├── LOGS/
│ └── RECONSTRUCTION/
...
```

## 6.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 variable `keep_reconstruction`

is set to `True`

, see Preprocessing parameters), the pre-processed
images are kept and stored in the `RECONSTRUCTION`

sub-directory.

## 6.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.

## 6.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.

## 6.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.

## 6.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.