Skip to main content

Test Status Windows Status Codecov Status ReadTheDocs Status PyPI PyPI - Python Version Compiler Version license code quality code style

This project explores how C++17 and OpenMP can be combined to write a surprisingly compact implementation of n-dimensional parallel affine transformations which are linked into Python via the affine_transform module.

While this project is still under development, the following features are supported:

  • Linear and cubic (without prefiltering) interpolation

  • Constant boundaries

  • Compiling code for arbitrarily dimensional data

  • Parallelism via OpenMP

  • Arbitrary shaped output arrays, allowing e.g. to only extract a transformed slice

Short example usage

import numpy as np

from affine_transform import transform
from mgen import rotation_from_angle


# Create a simple white square in an image
original = np.zeros((601, 401))
original[100:300, 100:300] = 1

# Rotate by 22.5° (around the centre of the square (200,200))
# and shift +200 in x and +100 in y
transformed = transform(
    original, rotation_from_angle(np.pi / 8), np.array([200, 100]), origin=(200, 200)
)

Download files

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

Source Distribution

affine_transform-0.3.3.tar.gz (50.7 kB view details)

Uploaded Source

File details

Details for the file affine_transform-0.3.3.tar.gz.

File metadata

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

File hashes

Hashes for affine_transform-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4b2ac2e40d8f83f72859548ee64ab91cbfc658ea96a0f3690960d31d21f7d5b5
MD5 a14421a780b75cd2bf8783f93162786c
BLAKE2b-256 ba6e9dad6ceba853296aa414046d51059e333085f94a573e5531700a76bf8d96

See more details on using hashes here.

Provenance

The following attestation bundles were made for affine_transform-0.3.3.tar.gz:

Publisher: deploy.yml on NOhs/affine_transform_nd

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.3.3 This release

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.0

1 file

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