Shift 2D/3D images by phase shifting Fourier transforms in PyTorch
Project description
torch-phase-shift
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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torch_fourier_shift-0.6.3rc1.tar.gz.
File metadata
- Download URL: torch_fourier_shift-0.6.3rc1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
743a055dba965adcdeacaa8081d1dc3d3e86c6fca78d53daeb8d7651c7a94908
|
|
| MD5 |
3e1ccf3265c2ab7bc4854789bf5930cb
|
|
| BLAKE2b-256 |
0010e13348783bd61efd4a0db50d793819de88eb461f36077f10e213789ebac4
|
Provenance
The following attestation bundles were made for torch_fourier_shift-0.6.3rc1.tar.gz:
Publisher:
deploy.yml on teamtomo/teamtomo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torch_fourier_shift-0.6.3rc1.tar.gz -
Subject digest:
743a055dba965adcdeacaa8081d1dc3d3e86c6fca78d53daeb8d7651c7a94908 - Sigstore transparency entry: 1136729023
- Sigstore integration time:
-
Permalink:
teamtomo/teamtomo@a8b788c75214a397edc488a86a82321205eb882e -
Branch / Tag:
refs/tags/torch-fourier-shift@v0.6.3rc1 - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@a8b788c75214a397edc488a86a82321205eb882e -
Trigger Event:
release
-
Statement type:
File details
Details for the file torch_fourier_shift-0.6.3rc1-py3-none-any.whl.
File metadata
- Download URL: torch_fourier_shift-0.6.3rc1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0903e25c58fb102436eaab672fd66fc18dadc623067cf7fd6eda38bf747560b7
|
|
| MD5 |
c103a3bae81c90d66b438f573db57972
|
|
| BLAKE2b-256 |
d01670def1e77677d3fd58344748597bf95b31e8c818dfcec7b91b740d2ed08e
|
Provenance
The following attestation bundles were made for torch_fourier_shift-0.6.3rc1-py3-none-any.whl:
Publisher:
deploy.yml on teamtomo/teamtomo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
torch_fourier_shift-0.6.3rc1-py3-none-any.whl -
Subject digest:
0903e25c58fb102436eaab672fd66fc18dadc623067cf7fd6eda38bf747560b7 - Sigstore transparency entry: 1136729093
- Sigstore integration time:
-
Permalink:
teamtomo/teamtomo@a8b788c75214a397edc488a86a82321205eb882e -
Branch / Tag:
refs/tags/torch-fourier-shift@v0.6.3rc1 - Owner: https://github.com/teamtomo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@a8b788c75214a397edc488a86a82321205eb882e -
Trigger Event:
release
-
Statement type: