Skip to main content
Build Status Python version PyPi version Documentation Status https://codecov.io/gh/addisonElliott/polarTransform/branch/master/graph/badge.svg

Introduction

polarTransform is a Python package for converting images between the polar and Cartesian domain. It contains many features such as specifying the start/stop radius and angle, interpolation order (bicubic, linear, nearest, etc), and much more.

Installing

Prerequisites

  • Python 3

  • Dependencies:
    • numpy

    • scipy

    • scikit-image

Installing polarTransform

polarTransform is currently available on PyPi. The simplest way to install alone is using pip at a command line:

pip install polarTransform

which installs the latest release. To install the latest code from the repository (usually stable, but may have undocumented changes or bugs):

pip install git+https://github.com/addisonElliott/polarTransform.git

For developers, you can clone the polarTransform repository and run the setup.py file. Use the following commands to get a copy from GitHub and install all dependencies:

git clone pip install git+https://github.com/addisonElliott/polarTransform.git
cd polarTransform
pip install .

or, for the last line, instead use:

pip install -e .

to install in ‘develop’ or ‘editable’ mode, where changes can be made to the local working code and Python will use the updated polarTransform code.

Test and coverage

Run the following command in the base directory to run the tests:

python -m unittest discover -v polarTransform/tests

Example

Input image:

Cartesian image
import polarTransform
import matplotlib.pyplot as plt
import imageio

verticalLinesImage = imageio.imread('IMAGE_PATH_HERE')

polarImage, ptSettings = polarTransform.convertToPolarImage(verticalLinesImage, initialRadius=30,
                                                            finalRadius=100, initialAngle=2 / 4 * np.pi,
                                                            finalAngle=5 / 4 * np.pi)

cartesianImage = ptSettings.convertToCartesianImage(polarImage)

plt.figure()
plt.imshow(polarImage, origin='lower')

plt.figure()
plt.imshow(cartesianImage, origin='lower')

The result is a polar domain image with a specified initial and final radius and angle:

Polar image

Converting back to the cartesian image results in only a slice of the original image to be shown because the initial and final radius and angle were specified:

Cartesian image

Next Steps

To learn more about polarTransform, see the documentation.

License

polarTransform has an MIT-based license.

Release files for polarTransform 2.0.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 polarTransform 2.0.0
File Size Uploaded
polarTransform-2.0.0.tar.gz 11.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for polarTransform 2.0.0
File Interpreter ABI Platform
polarTransform-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 MB

Release files / polarTransform-2.0.0.tar.gz

Download URL polarTransform-2.0.0.tar.gz
Size 11.0 MB
Tags Source
SHA-256 checksum
How to use checksums
ffd55a1aeacfd233ca21636f0543bffe8a22f8c859e590474b2155e6c3a0e475
BLAKE2b-256 checksum
How to use checksums
d47513565bfce898d91a5e9e55df4033dee7f05cc3f7d5d4cc1d2255078a8d97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.3

Release files / polarTransform-2.0.0-py3-none-any.whl

Download URL polarTransform-2.0.0-py3-none-any.whl
Size 11.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8e766191573f80e7761e7203f0bd997e9c95bdd329386b3af4ae922096da2932
BLAKE2b-256 checksum
How to use checksums
e49ecc129925bb1abf1764a96cb947f85297212bd22801270230540e55e8356a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.3

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.2

2 release files

1.0.1

2 release 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