Segmentation

An important part of interpretation of an image is to identify and isolate regions of interest, a process called segmentation. The notion of regions-of-interest (ROI) makes it a subjective process, with decisive user interaction determining the outcome. The granularity of segmentation ranges from a voxel by voxel assignment to regions (highly subjective), to choosing one or a few parameters (mildly subjective), such as a threshold. Highly subjective segmentation is rarely justifiable, while a parameter such as a threshold can be justified from estimated volume-inclusion or the presence of certain indicator densities in a map. The emphasis here is therefore on finding ways to segment with having to choose the least number of parameters.

Note: Most segmentation procedures assume that density is positive (i.e., density is white).

 

Thresholding

The simplest segmentation on a gray-scale density map is thresholding. When generating an isosurface representation of a map, the implicit segmentation is between foreground (density), and background (everything else). The choice of threshold is important, because the isosurface reflects the amount and location of density, but only if it exceeds the threshold. The aim of the user further determines how the threshold level will be justified.

Case 1: Included volume

The user wants to visualize the map such that the volume within the isosurface corresponds to the volume of all the constituents of the particle. The appropriate threshold can then be calculated from the estimated molecular weight:

bsegment -v 7 -mass 23.5m map.pif

The inverse can also be calculated (e.g., to calculate how much difference a change in threshold will make to the included volume):

bsegment -v 7 -threshold 1.45 map.pif

Similar information can be extracted from the histogram of the map:

bhisto -v 7 -bins 200 map.pif

Case 2: Differentiating parts of the structure

More often than not, parts of a map has lower occupancy than others due to conformational flexibility or compositional variability. A threshold can be chosen visually to include or exclude these lower-occupancy regions.

In proteins, the alpha helices have the highest density. In maps of sufficient resolution, the helices can be identified and visualized by choosing a high threshold.

Generating a binary mask

A threshold can be used to simply generate a mask that distinguished foreground from background:

bmask -v 7 -threshold 1.3 map.pif mask.tif

 

Multi-region segmentation

In a gray scale map, the density variations provide the only information for defining the location and extent of regions. The regions are typically associated with local peaks, and their extend limited to a threshold defining the distinction between foreground and background.

Watershed

The watershed algorithm starts at a threshold where regions are defined by clusters of neighboring voxels. It then proceeds through a series of steps of decreasing threshold, assigning each non-assigned voxel to a region if it is adjacent to another voxel from that region. In cases where a voxel is adjacent to two regions, it is assigned to the region with the highest density value in a neighboring voxel. The assignments stop when the lower threshold is reached. The result is a multi-level mask, where each region is encoded as a unique integer in the image.

The first decision to make is which starting threshold to use. All densities that are disconnected at this threshold will be taken as separate regions. The best way to pick the threshold is to open the map in bshow and use the min and max sliders to find a threshold where the desired regions are disconnected. The second threshold should be above any noise and depends on how far you want to extent the regions.

The output is a multi-level mask where each region has an integer number. One or more of these regions can be picked using the model tool in bshow, and the selected regions can be extracted as a mask. The mask can then be used to isolate specific parts of the original map.

The following map was segmented to separate the main shell and associated proteins:

Phi6 multi-level maskPhi6 multi-level mask colored

bflood -v 7 -thresh 1,0.05 -fill phi6.map phi6_mask.tiff

bcolour -v 7 -color 1,241 phi6_mask.tiff phi6_mask_col.tiff

Peak-associated regions:

An alternative to the watershed algorithm generates regions based on peaks above a threshold. A peak is defined where a voxel is the maximum in a kernel. The kernel is typically 3x3x3. The algorithm actually assigns a pointer to each voxel above the threshold, pointing to the highest density value in the kernel. A peak will therefore automatically point to itself. Each voxel is assigned to a peak by following the pointers until they reach a peak.

bflood -v 7 -peaks 0.05 phi6.map phi6_peakmask.tiff