Skip to main content

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 finds the tilt-axis angle of a translationally aligned tilt series from its common line: the line through the origin of Fourier space that all tilt images share, oriented perpendicular to the tilt axis. Each image's Fourier transform is coherently summed across the stack, and a two-stage angular grid search (coarse, then a finer search around the coarse optimum) locates the orientation of highest power in the summed power spectrum. The whole search is evaluated as batched tensor operations, so every candidate angle is scored in parallel rather than in a Python loop.

Rectangular images are handled natively, without cropping to square, so no image data is discarded.

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 90.0,
# which searches the full [0, 180] range). 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,
)

License

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

Release files for torch-refine-tilt-axis-angle 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-refine-tilt-axis-angle 0.6.0
File Size Uploaded
torch_refine_tilt_axis_angle-0.6.0.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-refine-tilt-axis-angle 0.6.0
File Interpreter ABI Platform
torch_refine_tilt_axis_angle-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / torch_refine_tilt_axis_angle-0.6.0.tar.gz

Download URL torch_refine_tilt_axis_angle-0.6.0.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f272e3a3fac60164f1b5b2ba11fc657a1bba71449ce3128689e213cc591da741
BLAKE2b-256 checksum
How to use checksums
b4aa0eda7c94856b25784dedca20870e805b6240ba8ca85aba1e8081cb8cacf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / torch_refine_tilt_axis_angle-0.6.0-py3-none-any.whl

Download URL torch_refine_tilt_axis_angle-0.6.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0b4818fbf20869f3fd77df5d11dc362e17c6ae095cedcbbe6d003b5b0635cc4
BLAKE2b-256 checksum
How to use checksums
f8f3194985586aca28be2dbcc470a8d85a65abe96923fae2e2790869828b1236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log
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