Skip to content

copick convert seg2picks

utils

Convert segmentation to picks.

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 convert seg2picks input
Input
copick convert seg2picks output
Output

Convert segmentation to picks.

Usage

copick convert seg2picks [OPTIONS]

Description

Extracts particle centroids from segmentation volumes and writes them as picks. The chosen label (--segmentation-idx) is split into connected components, each component becomes one point at its centroid, and a maximum filter (--maxima-filter-size) controls how nearby maxima are merged. Components outside the --min-particle-size/--max-particle-size voxel range are discarded.

The input pattern and output template support regex matching and {input_*} substitutions, so a single invocation can fan out across many runs and sessions in parallel.

URI Format

Segmentations: name:user_id/session_id@voxel_spacing
Picks: object_name:user_id/session_id

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, -r 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
--segmentation-idx, -si integer required Label index to extract from segmentation.
--maxima-filter-size integer 9 Size of maximum detection filter.
--min-particle-size integer 1000 Minimum particle size threshold.
--max-particle-size integer 50000 Maximum particle size threshold.
--workers, -w integer 8 Number of worker processes.

Output Options

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

Examples

# Convert a single segmentation to picks
copick convert seg2picks -i "membrane:user1/manual-001@10.0" -o "membrane:seg2picks/centroid-001"

# Convert all manual segmentations using pattern matching
copick convert seg2picks -i "membrane:user1/manual-.*@10.0" \
    -o "membrane:seg2picks/centroid-{input_session_id}"

# Pick a specific label and filter by particle size
copick convert seg2picks --segmentation-idx 1 --min-particle-size 50 --max-particle-size 5000 \
    -i "membrane:user1/manual-001@10.0" -o "membrane:seg2picks/centroid-001"

See also