Object-oriented linear and nonlinear coordinate system transforms, plus coordinate system graphs.
Project description
Coorx
Coorx implements object-oriented linear and nonlinear coordinate system transforms. Optionally, coorx also keeps track of a graph of coordinate systems (such as a scene graph) that are connected by transforms, allowing automatic mapping between coordinate systems.
- A collection of different types of coordinate system transform classes with unit test coverage
- Easy methods for mapping coordinate data through these transforms
- Transform composition and simplification
- Transforms intelligently map data types including numpy arrays, lists, etc.
- Automatic generation of composite transforms from a coordinate system graph
- Coordinate arrays that know which coordinate system they live in to handle automatic mapping
- Using named coordinate systems, coorx warns you wnen you try to map data through the wrong transform
- Automatic conversion of (some) transforms between ITK, Qt, scikit-image, and vispy
Installation
To install the package from PyPI, use the following command:
pip install coorx
Usage
Scale and translate 2D coordinates:
import numpy as np
from coorx import STTransform
coords = np.array([
[ 0, 0],
[ 1, 2],
[20, 21],
])
tr = STTransform(scale=(10, 1), offset=(5, 5))
print(tr.map(coords))
Compose multiple transforms together:
import numpy as np
from coorx import STTransform, AffineTransform, CompositeTransform
coords = np.array([
[0, 0, 0],
[1, 2, 3],
[-10, -200, -3000],
])
tr1 = STTransform(scale=(1, 10, 100))
tr2 = AffineTransform(dims=3)
tr2.rotate(90, axis=(0, 0, 1))
tr3 = CompositeTransform([tr2, tr1])
print(tr3.map(coords))
Local CI
To run GitHub Actions workflows locally with act, first build the runner image once:
docker build -t coorx-act-runner -f .github/act-ubuntu.dockerfile .github/
Then run act as normal; .actrc maps ubuntu-latest to this image.
Todo
- import bilinear, SRT transforms from pyqtgraph
- import coordinate system graph handling from vispy
- make coordinate system dimensionality explicit
- unit tests against ITK output
Credit
Coorx is adapted from code originally written for VisPy (vispy.org), inspired by the nice transform classes in ITK, and maintained by the Allen Institute for Brain Science.
Project details
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 coorx-2.0.1.tar.gz.
File metadata
- Download URL: coorx-2.0.1.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e89e931bd2e970506bbdd0fffe1f6c845ddffa17244d96eacb3035db2e87df4
|
|
| MD5 |
14ffcd565ca5dcd4f616efb68048b828
|
|
| BLAKE2b-256 |
8c24b98ad87d85160449059205ed751f24ea4f06cd1ca506669aac7002c3ebb9
|
Provenance
The following attestation bundles were made for coorx-2.0.1.tar.gz:
Publisher:
deploy.yml on campagnola/coorx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coorx-2.0.1.tar.gz -
Subject digest:
7e89e931bd2e970506bbdd0fffe1f6c845ddffa17244d96eacb3035db2e87df4 - Sigstore transparency entry: 1592256175
- Sigstore integration time:
-
Permalink:
campagnola/coorx@56234226832d79e71a78b8d192f2f226daace72d -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/campagnola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@56234226832d79e71a78b8d192f2f226daace72d -
Trigger Event:
push
-
Statement type:
File details
Details for the file coorx-2.0.1-py3-none-any.whl.
File metadata
- Download URL: coorx-2.0.1-py3-none-any.whl
- Upload date:
- Size: 45.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d169a455a30d51843277e71aa8c9f368cd7c06f861c271ac6fc001ae6da9b3
|
|
| MD5 |
910adbe2f79a5212102107a13f5594c6
|
|
| BLAKE2b-256 |
7571d1f76d16d0fa3bdf1b9bf9c881ad782acc8f7c8eb8f070294fe6dbcc8541
|
Provenance
The following attestation bundles were made for coorx-2.0.1-py3-none-any.whl:
Publisher:
deploy.yml on campagnola/coorx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coorx-2.0.1-py3-none-any.whl -
Subject digest:
b2d169a455a30d51843277e71aa8c9f368cd7c06f861c271ac6fc001ae6da9b3 - Sigstore transparency entry: 1592256382
- Sigstore integration time:
-
Permalink:
campagnola/coorx@56234226832d79e71a78b8d192f2f226daace72d -
Branch / Tag:
refs/tags/v2.0.1 - Owner: https://github.com/campagnola
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@56234226832d79e71a78b8d192f2f226daace72d -
Trigger Event:
push
-
Statement type: