Skip to main content

torch-phase-shift

License PyPI Python Version CI codecov

torch-fourier-shift is a package for shifting 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]))

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

Download files

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

Source Distribution

torch_fourier_shift-0.0.4.tar.gz (48.0 kB view details)

Uploaded Source

Built Distribution

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

torch_fourier_shift-0.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file torch_fourier_shift-0.0.4.tar.gz.

File metadata

  • Download URL: torch_fourier_shift-0.0.4.tar.gz
  • Upload date:
  • Size: 48.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for torch_fourier_shift-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b9a1ba617aaab253754a279c2056859b6be26df15f6e92418ca32f982fa5dc7b
MD5 e9501d4737dad3609d494e85499ae28f
BLAKE2b-256 3eeeeec0cb51b08f88e365f9740070b25bcada48db05eca6668a9d4b95bd6296

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_fourier_shift-0.0.4.tar.gz:

Publisher: ci.yml on teamtomo/torch-fourier-shift

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_fourier_shift-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_fourier_shift-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f2dcba7c4fb1cb5fbcbed73ff1055d2aefa61b448a11069af711241bd46d1f81
MD5 4998cf16e6f6fd1cce089b5bcf404939
BLAKE2b-256 04f7387bd07e9d98a761a78626101d1b8ade8d74a28101c6366175c3dfa48e9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_fourier_shift-0.0.4-py3-none-any.whl:

Publisher: ci.yml on teamtomo/torch-fourier-shift

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

Release history Release notifications | RSS feed

0.6.0

2 files

0.5.2

2 files

0.5.0

2 files

0.1.0

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

This release

0.0.4 This release

2 files

0.0.3

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