Skip to content

CopickAlignment

copick.models.CopickAlignment

An alignment of a tilt series (see CopickAlignmentFile). Its content is loaded on first access.

Attributes:

file

file: CopickAlignmentFile

The alignment, loaded from storage if needed.

is_valid

is_valid: bool

Whether the alignment comes from its author and has per-section parameters.

is_default

is_default: bool

Whether the alignment is a CryoET Data Portal placeholder.

tilt_series

tilt_series: Optional[CopickTiltSeries]

The tilt series this alignment aligns, or None if it is not in the run.

Raises:

  • ValueError –

    If several tilt series of the run match.

tomograms

tomograms: List[CopickTomogram]

The tomograms of the run reconstructed with this alignment.

__init__

__init__(run: CopickRun, file: CopickAlignmentFile)

Parameters:

  • run (CopickRun) –

    Reference to the run this alignment belongs to.

  • file (CopickAlignmentFile) –

    The alignment, or a stub holding only its name, to be loaded on first access.

load

load() -> CopickAlignmentFile

Load the alignment from storage.

store

store() -> None

Store the alignment.

refresh

refresh() -> None

Reload the alignment from storage.

delete

delete(unlink: bool = True) -> None

Delete the alignment.

Parameters:

  • unlink (bool, default: True ) –

    Whether to remove the link from writable tomograms that record this alignment.

section

section(section: int) -> Optional[CopickSectionAlignment]

The parameters of one section, or None if it is not aligned.

to_cets

to_cets() -> Dict[str, Any]

The CETS Alignment of this alignment.

project

project(points: ndarray, tomogram: Optional[CopickTomogram] = None, sections: Optional[Iterable[int]] = None) -> Dict[int, np.ndarray]

Project points onto the images of the tilt series.

Parameters:

  • points (ndarray) –

    Points (n, 3) in Angstrom from the corner of voxel 0 of tomogram (copick's pick coordinates), or of the reference volume if no tomogram is given.

  • tomogram (Optional[CopickTomogram], default: None ) –

    A tomogram reconstructed with this alignment.

  • sections (Optional[Iterable[int]], default: None ) –

    Sections to project onto. Default: all aligned sections.

Returns:

  • Dict[int, ndarray] –

    Per section, the projected points (n, 2) in pixels of the full-size image (x, y), from the corner of

  • Dict[int, ndarray] –

    pixel 0.

Raises:

  • ValueError –

    If the tilt series or the reference volume are unknown.