Skip to content

copick inference membrain-seg

torch

Segment membranes in tomograms with MemBrain-seg.

Plugin command — copick-torch

This command is provided by the copick-torch plugin, not copick core. Install it to make this command available:

pip install copick-torch

See the plugin system guide for details.

Usage

copick inference membrain-seg [OPTIONS]

Description

For every run in the project, queries the tomogram of the given algorithm at the requested voxel spacing, runs the MemBrain-seg model with sliding-window inference (using test-time augmentation and input normalization), and writes the resulting membrane segmentation back into the project. Runs are processed in parallel on a GPU pool.

A threshold of 0 stores the raw membrane probability map, while a positive threshold binarizes the prediction. The model weights are downloaded automatically on first use if they are not already cached. The output is saved as a segmentation named membranes.

URI Format

Segmentations: name:user_id/session_id@voxel_spacing

Options

Option Type Default Description
-c, --config path Path to the configuration file.
--debug / --no-debug boolean flag False Enable debug logging.

Input Options

Option Type Default Description
--tomo-alg, -ta text required Tomogram algorithm/type to query and segment (e.g. 'wbp').
--voxel-size, -vs float 10.0 Voxel spacing to query, in angstroms.

Tool Options

Option Type Default Description
--threshold, -t float 0.0 Segmentation threshold for the membrane probability map (0 keeps the raw map).

Output Options

Option Type Default Description
--user-id, -u text membrain-seg User ID for the saved membrane segmentation.
--session-id, -s text 1 Session ID for the saved membrane segmentation.

Examples

# Segment membranes in wbp tomograms at 10 A
copick inference membrain-seg -c config.json --tomo-alg wbp --voxel-size 10.0

# Binarize the prediction and tag the output user/session
copick inference membrain-seg -c config.json --tomo-alg wbp --voxel-size 10.0 \
    --threshold 0.5 --user-id membrain-seg --session-id 1

See also

Please cite membrain-seg

copick inference membrain-seg only wraps the tool — the segmentation model and method are the work of the membrain-seg authors. If membrain-seg contributes to your research, please cite the original project in addition to copick: