Skip to content

copick process fit-spline

utils

Fit 3D splines to skeletons and generate oriented 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 process fit-spline input
Input
copick process fit-spline output
Output

Fit 3D splines to skeletons and generate oriented picks.

Usage

copick process fit-spline [OPTIONS]

Description

Fits regularized 3D parametric splines to skeletonized segmentation volumes and samples points along each spline at a regular interval, producing picks. Orientations are computed from the local spline direction when --compute-transforms is enabled.

Curvature-based outlier removal is applied iteratively to discard skeleton points that produce unrealistically sharp bends, while the connectivity radius controls how skeleton voxels are joined into a connected curve before fitting.

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 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.
--voxel-spacing, -vs float required Voxel spacing for coordinate scaling.

Tool Options

Option Type Default Description
--spacing-distance float required Distance between consecutive sampled points along the spline.
--smoothing-factor float Smoothing parameter for spline fitting (auto if not provided).
--degree integer 3 Degree of the spline (1-5).
--connectivity-radius float 2.0 Maximum distance to consider skeleton points as connected.
--compute-transforms / --no-compute-transforms boolean flag True Whether to compute orientations for picks.
--curvature-threshold float 0.2 Maximum allowed curvature before outlier removal.
--max-iterations integer 5 Maximum number of outlier removal iterations.
--workers 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

# Fit splines to skeletonized components
copick process fit_spline -i "skeleton:skel/inst-.*@10.0" \
    -o "skeleton:spline/spline-{input_session_id}" --spacing-distance 4.4 --voxel-spacing 10.0

# Process a single skeleton component
copick process fit_spline -i "skeleton:skel/skel-0@10.0" \
    -o "skeleton:spline/spline-0" --spacing-distance 2.0 --voxel-spacing 10.0

See also

  • copick process skeletonize — produce the skeleton segmentations fed to this command
  • copick process separate_components — split a segmentation into per-instance skeletons first