A CLI tool to automatically segment the lamella slab in cryo-ET volumes
Slabify is a Python command-line tool to automatically segment the lamella slab from cellular cryo-electron tomography (cryo-ET) volumes. The program analyzes the local variance around random points inside the tomogram to find where the "interesting" density is. There are three modes of operation:
--thickness
in Z. This mode is enabled by the --simple
flag, and tends to work better in "difficult" cases.slabify
fit two planes defining the top and bottom sides of the slab. See instructions for details.The first two modes employ robust fitting through the RANSAC algorithm to prevent outliers from perturbing the boundary estimation too much.
A lamella slab mask can be useful in different scenarios when processing cellular cryo-ET data, for example:
conda create -n slabify python=3.12
conda activate slabify
pip
:
git clone https://github.com/CellArchLab/slabify-et.git
cd slabify-et
pip install .
Now, you should be able to run the slabify
command.
.mod
format directly, you should have IMOD installed and activated in your session.Using Slabify is straightforward:
slabify --input tomogram.mrc --output tomogram_slab_mask.mrc
You may want to turn a few knobs to fine tune your results of course. Type slabify --help
to see all options. See also the FAQ below.
The following tomogram sizes have been tested:
Anything in this range of tomogram dimensions and pixel sizes should work well. The --boxsize
and --n-samples
options might need to be adjusted if you have something very different.
While Slabify should work on any tomogram, high-contrast and "clean" tomos tend to give the best results. These can be obtained by applying a denoising tool such as cryoCARE, IsoNet or DeepDeWedge to your data before running Slabify. For a quicker alternative, the deconvolution filter from Warp also works well for our purposes. See here how to apply it using IMOD.
It is known that Slabify can be quite conservative in its estimation of the lamella boundaries. There are a few tips you can try to get thicker slab masks:
--offset
option to arbitrarily grow your slab mask in the Z direction. Note that a negative value can be provided to make the slab thinner!--iterations
. 3 to 5 iterations are usually good.--percentile
of highest variance points in order to capture more information, say from 95 to 94.--n-samples
and --boxsize
values can be beneficial in some cases (needs more testing).--simple
mode with an arbitrary slab --thickness
is generally a safe option.The manual boundary masking is based on code from Will Wan for STOPGAP. Thanks to Caitie McCafferty and Philippe Van der Stappen for discussions and feature suggestions.