Skip to main content

torch-phase-shift

License PyPI Python Version CI codecov

torch-fourier-shift is a package for shifting 1D, 2D and 3D images with subpixel precision by applying phase shifts to Fourier transforms in PyTorch.

A 2D image and the shifted result

import torch
from torch_fourier_shift import fourier_shift_image_2d

# create a dummy image
my_image = torch.tensor(
    [[0, 0, 0, 0, 0, 0],
     [0, 1, 0, 0, 0, 0],
     [0, 0, 0, 0, 0, 0],
     [0, 0, 0, 0, 0, 0],
     [0, 0, 0, 0, 0, 0],
     [0, 0, 0, 0, 0, 0]]
)

# shift the image by 1 pixel in dim 0, 2 pixels in dim 1
shifted_image = fourier_shift_image_2d(image=my_image, shifts=torch.tensor([1, 2]))

API's are equivalent for 1D and 3D images.

Installation

torch-fourier-shift is available on PyPI.

pip install torch-fourier-shift

Usage

Please check the the docs at teamtomo.org/torch-fourier-shift

Release files for torch-fourier-shift 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-fourier-shift 0.6.0
File Size Uploaded
torch_fourier_shift-0.6.0.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-fourier-shift 0.6.0
File Interpreter ABI Platform
torch_fourier_shift-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / torch_fourier_shift-0.6.0.tar.gz

Download URL torch_fourier_shift-0.6.0.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c666e5c9c73d9d8acaaec93192f49aa6db8e7eff22d85fb9f50f52bdda4325b
BLAKE2b-256 checksum
How to use checksums
b610dffa4a75c9e6eacbe333ca964f17bde0bc569f09d5235c4dd01f28597d6f
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_fourier_shift-0.6.0-py3-none-any.whl

Download URL torch_fourier_shift-0.6.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00aa63ebd57cff04eb3b8ad7e75fb8a3eb9e160d553ce6fc3319b5c242e0534d
BLAKE2b-256 checksum
How to use checksums
90694e0f5466437f66b35788248cf24a95437abd371211895fd8cb12344848f5
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