Skip to content

copick process separate-components

utils

Separate connected components in segmentations.

Plugin command — copick-utils

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

pip install copick-utils

See the plugin system guide for details.

copick process separate-components input
Input
copick process separate-components output
Output

Separate connected components in segmentations.

Usage

copick process separate-components [OPTIONS]

Description

Connected-component analysis splits a segmentation into individual segmentations, one per connected region. Connectivity can be face (6-connected), face-edge (18-connected), or all (26-connected), and components smaller than --min-size (in cubic angstroms) are dropped.

For multilabel segmentations the analysis is performed on each label separately. Output segmentations use the {instance_id} placeholder for auto-numbering (e.g. inst-0, inst-1).

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
--run-names text · multiple Specific run names to process (default: all runs).
--input, -i COPICK_URI required Input segmentation URI (format: name:user_id/session_id@voxel_spacing). Supports glob patterns.

Tool Options

Option Type Default Description
--connectivity, -cn choice (face | face-edge | all) all Connectivity for connected components (face=6-connected, face-edge=18-connected, all=26-connected).
--min-size float Minimum component volume in cubic angstroms (ų) to keep (optional).
--multilabel / --binary boolean flag True Process as multilabel segmentation (analyze each label separately).
--workers, -w integer 8 Number of worker processes.

Output Options

Option Type Default Description
--output, -o COPICK_URI required Output segmentation URI. Supports smart defaults (e.g., "membrane", "membrane/my-session", or "/my-session"). Full format: object_name:user_id/session_id@voxel_spacing.

Examples

# Separate components with smart defaults (auto user_id and session template)
copick process separate-components -i "membrane:user1/manual-001@10.0" -o "{instance_id}"

# Custom session prefix
copick process separate-components -i "membrane:user1/manual-001@10.0" \
    -o "membrane:components/inst-{instance_id}"

# Full URI specification
copick process separate-components -i "membrane:user1/manual-001@10.0" \
    -o "membrane:components/comp-{instance_id}@10.0"

See also