Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

torch-refine-tilt-axis-angle

License PyPI Python Version CI codecov

Tilt-axis angle optimization for tilt series using common lines.

Overview

torch-refine-tilt-axis-angle provides an implementation for finding the in plane rotation for a tilt-series that aligns the tilt axis with the y-axis. This is done by extracting lines from the 2D Fourier transform of the tilt-series images and minimizing the mean squared error between them, i.e. the common lines. It makes use of the pytorch LBFGS optimizer to find the minimum.

Installation

pip install torch-refine-tilt-axis-angle

Usage

import torch
from torch_refine_tilt_axis_angle import refine_tilt_axis_angle

# Load or create your tilt series
# tilt_series shape: (batch, height, width) - batch is number of tilt images
# Example: tilt_series with shape (61, 512, 512) - 61 tilt images of 512x512 pixels
tilt_series = torch.randn(61, 512, 512)

# Specify an initial guess for the tilt axis angle (the default is 0.0)
# This can be the value from an MDOC file.
initial_tilt_axis_angle = 50.0

# Run tilt axis angle refinement.
new_tilt_axis_angle = refine_tilt_axis_angle(
    tilt_series=tilt_series,
    tilt_axis_angle=initial_tilt_axis_angle,
    # grid_points=1,  # optionally increase the spline grid points (default 1)
    # return_single_angle=False,  # optionally write out an angle for each image 
)

Use uv to run an example with simulated data and visualize the results.

uv run examples/simulate_tilt_axis_refinement.py

License

This package is distributed under the BSD 3-Clause License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_refine_tilt_axis_angle-0.6.3rc3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file torch_refine_tilt_axis_angle-0.6.3rc3.tar.gz.

File metadata

File hashes

Hashes for torch_refine_tilt_axis_angle-0.6.3rc3.tar.gz
Algorithm Hash digest
SHA256 f3b38196553f94454ff8f11c2f52a9181df838222d1cfbabf0b55d42f7ac11fa
MD5 dd32fdf049ebc3fe01a868e8c54d8c40
BLAKE2b-256 eaa91c2ed16908d679dd6c5167f5c0aecf5dc5e189c77557e9c2d61e0b402c4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_refine_tilt_axis_angle-0.6.3rc3.tar.gz:

Publisher: deploy.yml on teamtomo/teamtomo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_refine_tilt_axis_angle-0.6.3rc3-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_refine_tilt_axis_angle-0.6.3rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 70ef214c666bd5ec7303907d09c88f648a96284edaf66b4d7922fa89125a0048
MD5 7328b732f77b506c0bde342caf92cab5
BLAKE2b-256 f303d62c32b797e3133b805d78eba55645bc8702fe81e2dc79e9d7c8779b1976

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_refine_tilt_axis_angle-0.6.3rc3-py3-none-any.whl:

Publisher: deploy.yml on teamtomo/teamtomo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.6.3rc3 This release

2 files

0.5.2

2 files

0.5.0

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page