Skip to main content

Diffeomorphic

A Python package for creating diffeomorphically transformed images and videos for psychological experiments.

Overview

Diffeomorphic implements diffeomorphic transformations for image and video morphing, as described in:

Stojanoski, B., & Cusack, R. (2014). Time to wave good-bye to phase scrambling: Creating controlled scrambled images using diffeomorphic transformations. Journal of Vision, 14(12), 6. doi:10.1167/14.12.6

This Python package was developed by Mohammad Ahsan Khodami, based on the original algorithms described in the paper by Stojanoski & Cusack.

Installation

pip install diffeomorphic

Usage

As a command-line tool

# Transform a single image
diffeomorphic-image --input image.jpg --output output_dir --maxdistortion 80 --nsteps 20

# Transform a video
diffeomorphic-movie --input video.mp4 --output output_dir --maxdistortion 60 --nsteps 20

# Transform with warpshift
diffeomorphic-warpshift --input image.jpg --output output_dir --maxdistortion 60 --nsteps 20 --phasedrift 0.39

As a Python library

import diffeomorphic

# Transform a single image
diffeomorphic.transform_image(
    input_path="image.jpg", 
    output_path="output_dir",
    max_distortion=80,
    n_steps=20
)

# Transform a video
diffeomorphic.transform_movie(
    input_path="video.mp4", 
    output_path="output_dir",
    max_distortion=60,    n_steps=20
)

# Transform with warpshift
diffeomorphic.transform_warpshift(
    input_path="image.jpg", 
    output_path="output_dir",
    max_distortion=60,
    n_steps=20,
    phase_drift=0.39
)

License

MIT License

Metadata

Release files for diffeomorphic 1.0.5

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

Source distribution (sdist)

Source distribution for diffeomorphic 1.0.5
File Size Uploaded Provenance Actions
diffeomorphic-1.0.5.tar.gz 18.1 kB Without provenance Details for diffeomorphic-1.0.5.tar.gz

Release files / diffeomorphic-1.0.5.tar.gz

Download URL diffeomorphic-1.0.5.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0eb370b822a2ac9d9f661eb108dc8f88dac0be4d13ebb4cb2039cfa0c11981fc
BLAKE2b-256 checksum
How to use checksums
3771e002a628b210a9fdd50a53eef4a39019f80f278a23a114d2970b4bcd3eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.12

Security for diffeomorphic 1.0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file No provenance

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