Skip to content

Comments

feat: Add import/export commands and API#170

Merged
uermel merged 37 commits intomainfrom
uermel/import_export
Feb 13, 2026
Merged

feat: Add import/export commands and API#170
uermel merged 37 commits intomainfrom
uermel/import_export

Conversation

@uermel
Copy link
Member

@uermel uermel commented Jan 27, 2026

Summary

This PR adds comprehensive import/export functionality for picks, tomograms, and segmentations, enabling interoperability with common cryo-ET software packages including RELION, Dynamo, and TOM/Artiatomi toolbox.

New Features

CLI Commands

Import Commands (copick add)

  • copick add picks: Import particle picks from external formats

    • Supports EM (TOM toolbox motivelist), STAR (RELION), Dynamo (.tbl), and CSV formats
    • Automatic format detection from file extension
    • Batch import with --tomolist or --index-map for mapping tomogram indices to run names
    • Coordinate and orientation conversion to copick's native format
  • copick add tomogram: Import tomograms from external formats

    • Supports MRC, Zarr, TIFF, and EM formats
    • Optional multiscale pyramid generation
    • Batch import via --tomolist for Dynamo-style tomogram lists
  • copick add segmentation: Import segmentations from external formats

    • Supports MRC, Zarr, TIFF, and EM formats
    • Support for both binary and multilabel segmentations

Export Commands (copick export)

  • copick export picks: Export particle picks to external formats

    • Supports EM, STAR, Dynamo, and CSV formats
    • URI-based filtering (e.g., "ribosome:user1/*")
    • STAR export with optional optics group
    • Flat directory structure for multi-run exports
  • copick export tomogram: Export tomograms to external formats

    • Supports MRC, TIFF, and Zarr formats
    • Configurable pyramid level selection
  • copick export segmentation: Export segmentations to external formats

    • Supports MRC, TIFF, Zarr, and EM formats
    • Configurable pyramid level selection and compression

Functional API

New modules provide programmatic access to all import/export functionality:

  • copick.ops.add: Functions for importing picks, tomograms, and segmentations
  • copick.ops.export: Functions for exporting picks, tomograms, and segmentations
  • copick.util.formats: Format-specific I/O utilities and coordinate transformations
  • copick.util.handlers: Format handlers with capability detection for extensible format support

Supported Format Conventions

Format Euler Convention Coordinate System
EM/TOM (Artiatomi) ZXZ intrinsic 1-indexed, corner-origin
Dynamo ZXZ intrinsic with inversion 1-indexed, corner-origin
STAR/RELION ZYZ with inversion Pixels (Angstrom via voxel size)
CSV (copick native) Full 4x4 matrix Angstrom, corner-origin

Batch Import Features

  • Tomolist support: Import particles grouped by tomogram index using Dynamo-style tomolist files
  • Index map support: Custom CSV/TSV mapping from tomogram indices to run names
  • Run name extraction: Automatic run name derivation from filenames with regex support

@uermel uermel marked this pull request as ready for review January 30, 2026 01:41
@uermel uermel merged commit eaa2ec6 into main Feb 13, 2026
14 checks passed
uermel pushed a commit that referenced this pull request Feb 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.20.0](copick-v1.19.0...copick-v1.20.0)
(2026-02-13)


### ✨ Features

* Add import/export commands and API
([#170](#170))
([eaa2ec6](eaa2ec6))


### 🐞 Bug Fixes

* bump cryptography from 45.0.4 to 46.0.5
([#195](#195))
([5311cc3](5311cc3))
* bump pillow from 11.3.0 to 12.1.1
([#196](#196))
([0ca3441](0ca3441))
* Fix tests badge in readme.
([#198](#198))
([4f12036](4f12036))

---
Merging this PR will release copick on PyPI.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants