Name | coorx JSON |
Version |
1.0.4
JSON |
| download |
home_page | http://github.com/campagnola/coorx |
Summary | Object-oriented linear and nonlinear coordinate system transforms, plus coordinate system graphs. |
upload_time | 2025-02-06 22:28:06 |
maintainer | None |
docs_url | None |
author | Luke Campagnola |
requires_python | None |
license | BSD |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
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.
[](https://github.com/campagnola/coorx/actions/workflows/test.yml)
[](https://badge.fury.io/py/coorx)
* 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:
```python
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))
```
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.
Raw data
{
"_id": null,
"home_page": "http://github.com/campagnola/coorx",
"name": "coorx",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Luke Campagnola",
"author_email": "lukec@alleninstitute.org",
"download_url": "https://files.pythonhosted.org/packages/df/b4/861269136d71f81a0d7d5d4c72b058c71fa0009e9ed548d75ac12af09e94/coorx-1.0.4.tar.gz",
"platform": null,
"description": "Coorx\n==========\n\nCoorx implements object-oriented linear and nonlinear coordinate system transforms.\nOptionally, coorx also keeps track of a graph of coordinate systems (such as a scene graph)\nthat are connected by transforms, allowing automatic mapping between coordinate systems.\n\n[](https://github.com/campagnola/coorx/actions/workflows/test.yml)\n[](https://badge.fury.io/py/coorx)\n\n* A collection of different types of coordinate system transform classes with unit test coverage\n* Easy methods for mapping coordinate data through these transforms\n* Transform composition and simplification\n* Transforms intelligently map data types including numpy arrays, lists, etc.\n* Automatic generation of composite transforms from a coordinate system graph\n* Coordinate arrays that know which coordinate system they live in to handle automatic mapping\n* Using named coordinate systems, coorx warns you wnen you try to map data through the wrong transform\n* Automatic conversion of (some) transforms between ITK, Qt, scikit-image, and vispy\n\n\nInstallation\n============\n\nTo install the package from PyPI, use the following command:\n\n```\npip install coorx\n```\n\nUsage\n=====\n\nScale and translate 2D coordinates:\n\n```python\nimport numpy as np\nfrom coorx import STTransform\n\ncoords = np.array([\n [ 0, 0],\n [ 1, 2],\n [20, 21],\n])\n\ntr = STTransform(scale=(10, 1), offset=(5, 5))\n\nprint(tr.map(coords))\n```\n\nCompose multiple transforms together:\n\n```\nimport numpy as np\nfrom coorx import STTransform, AffineTransform, CompositeTransform\n\ncoords = np.array([\n [0, 0, 0],\n [1, 2, 3],\n [-10, -200, -3000],\n])\n\ntr1 = STTransform(scale=(1, 10, 100))\n\ntr2 = AffineTransform(dims=3)\ntr2.rotate(90, axis=(0, 0, 1))\n\ntr3 = CompositeTransform([tr2, tr1])\n\nprint(tr3.map(coords))\n```\n\nTodo\n====\n\n* import bilinear, SRT transforms from pyqtgraph\n* import coordinate system graph handling from vispy\n* make coordinate system dimensionality explicit\n* unit tests against ITK output\n\n\nCredit\n======\n\nCoorx is adapted from code originally written for VisPy (vispy.org),\ninspired by the nice transform classes in ITK, and\nmaintained by the Allen Institute for Brain Science.\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Object-oriented linear and nonlinear coordinate system transforms, plus coordinate system graphs.",
"version": "1.0.4",
"project_urls": {
"Homepage": "http://github.com/campagnola/coorx"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cfc54ad8f7da9f2b9a0e225e7d3aff2ef53a3963c872f1d146c89a572a02054d",
"md5": "ad2ecb4b25ec36eaa4fc7b84cdf7d2bc",
"sha256": "7d3dacb6c3214ef8438ad8a6ed0b0f8a690748f10887b0365558b28485ae5b6c"
},
"downloads": -1,
"filename": "coorx-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ad2ecb4b25ec36eaa4fc7b84cdf7d2bc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 29261,
"upload_time": "2025-02-06T22:28:04",
"upload_time_iso_8601": "2025-02-06T22:28:04.568311Z",
"url": "https://files.pythonhosted.org/packages/cf/c5/4ad8f7da9f2b9a0e225e7d3aff2ef53a3963c872f1d146c89a572a02054d/coorx-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "dfb4861269136d71f81a0d7d5d4c72b058c71fa0009e9ed548d75ac12af09e94",
"md5": "5913a0acf1a740df472f6667912bb09e",
"sha256": "2fc8f61529459ab44c4d9460c86e74cf62f764df3b9068ad328d4b172b15ffe5"
},
"downloads": -1,
"filename": "coorx-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "5913a0acf1a740df472f6667912bb09e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 26365,
"upload_time": "2025-02-06T22:28:06",
"upload_time_iso_8601": "2025-02-06T22:28:06.472942Z",
"url": "https://files.pythonhosted.org/packages/df/b4/861269136d71f81a0d7d5d4c72b058c71fa0009e9ed548d75ac12af09e94/coorx-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-06 22:28:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "campagnola",
"github_project": "coorx",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "coorx"
}