7. astec_mars

7.1. Mars method overview

The name mars comes from [FDM+10] where MARS is the acronym of multiangle image acquisition, 3D reconstruction and cell segmentation. Basically, it is nothing but a watershed-based segmentation.

This method aims at producing a segmentation of a membrane cell image (e.g. a fused image) into a segmentation image. This segmentation image is a integer-valued image where each integer labeled an unique cell in the image. By convention, ‘1’ is the background label, while cells have labels greater than 2. It is made of the following steps:

  1. Pre-processing of the input image to produce the input seed and membrane images for seed extraction and watershed (see section Image preprocessing). The parameters that governed the pre-processing are described in section Preprocessing parameters and can prefixed by seed_ or membrane_ to differentiate between the two pre-processings (if required).

  2. Seed extraction through the computation of the h-minima of the input seed image.

  3. Eventually seed correction.

  4. Pre-processing of the input image to produce the input membrane image for the seeded watershed, similarly to the pre-processing (see section Image preprocessing) of the input seed image . The parameters that governed the pre-processing are prefixed by membrane_.

  5. A seeded watershed.

See also

Section astec_mars parameters for a detailed presentation of all the parameters.

Section Data organization exemplifies the data architecture.

7.2. Mars / output data

The segmentation 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.

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

When conducting different experiments (eg by changing parameters), it is advised to change the value of <EXP_SEG>. The default behavior is to not recompute (auxiliary) results (unless the ‘-f’ option is passed, but this is fragile): if the same <EXP_SEG> is used, existing final and side results are not recomputed.

7.3. Steps 1 and 4: input image pre-processing

The input image (typically the fused image representing the cell membranes/walls) can be pre-processed before use in the seeded watershed.The pre-processing can be different for the seed input image (the one that will be used to extract the seeds) and the membrane input image (the one that will be used as the height image for the seeded watershed). Details about the pre-processing can be found in section Image preprocessing.

Auxiliary input images, as outer contours, can be provided in the CONTOUR/CONTOUR_<EXP_CONTOUR>/ directory (see section Outer contour).

/path/to/experiment/
├── ...
├── SEG/
│  └── SEG_<EXP_SEG>/
│     ├── <EN>_mars_t<begin>.<image_suffix>
│     └── LOGS/
├── CONTOUR/
│  └── CONTOUR_<EXP_CONTOUR>/
│     ├── ...
│     ...
...

Default settings are

intensity_transformation = 'Identity'
intensity_enhancement = None

meaning that the original fused image is used for both inputs. Different pre-processing can be done. E.g.

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

comes to use the original image for the seed extraction, but its normalization into 8 bits (1 byte) as the height image for the seeded watershed.

If the input image is transformed before segmented, the transformed images can be saved in the directory SEG/SEG_<EXP_SEG>/RECONSTRUCTION/ if the value of the variable save_reconstruction is set to True.

7.4. Step 2: seed extraction

The seed extraction is made of the following steps:

  1. Gaussian smoothing of the input image, the gaussian standard deviation being given by the variable seed_sigma.

  2. Extraction of the h-minima of the previous image, h being given by the variable seed_hmin.

  3. Hysteresis thresholding (and labeling) of the h-minima image, with a high threshold equal to seed_high_threshold (default is h) and and a low threshold equal to 1. It then only selects the h-minima that have an actual depth of h.

7.5. Step 3: seed correction

Several rounds of correction of the computed seeds can be done. At each round, different seeds can be assigned the same label (and this will fuse the further reconstructed cells) or new seeds (each new seed is a single voxel) can be added. See the seed_edition_file variable for details (section Seed edition parameters).

When correcting seeds, it is advised to launch astec_mars with the -k option. Indeed, temporary files, as the seed image, are kept in a temporary directory located in the SEG/SEG_'EXP_SEG'/ directory and then re-used, and not recomputed at each astec_mars use.

Alternatively, segmentation correction can be performed with astec_manualcorrection (section astec_manualcorrection).

7.6. Step 5 : seeded watershed

Given the seeds, the watershed is performed on the smoothed input membrane image (gaussian standard deviation being given by the variable membrane_sigma).

7.7. A note on parameters

A comprehensive list of watershed parameters can be found in section Watershed parameters. seed_sigma and membrane_sigma allows to smooth differently the fusion image for seed extraction or for watershed computation. Generally, the seed image is smoother (to minimize the number of seeds par cell, then minimize over-segmentation). These two variables are in fact short-cuts to change the value of the intensity_sigma variables of the pre-processing parameters (see section Preprocessing parameters), prefixed by either seed_ or membrane_, used to compute respectively the seed and the membrane image.

Thus

seed_sigma = 0.6
membrane_sigma = 0.15

is strictly equivalent to

seed_intensity_sigma = 0.6
membrane_intensity_sigma = 0.15