Name | imodmodel JSON |
Version |
0.0.15
JSON |
| download |
home_page | None |
Summary | IMOD model files as pandas DataFrames in Python. |
upload_time | 2025-01-30 18:09:18 |
maintainer | None |
docs_url | None |
author | Alister Burt |
requires_python | >=3.8 |
license | BSD 3-Clause License |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# imodmodel
[](https://github.com/alisterburt/imodmodel/raw/main/LICENSE)
[](https://pypi.org/project/imodmodel)
[](https://python.org)
[](https://github.com/alisterburt/imodmodel/actions/workflows/test_and_deploy.yml)
Read [IMOD model files](https://bio3d.colorado.edu/imod/doc/binspec.html)
as [pandas dataframes](https://pandas.pydata.org/)
in Python.
## Usage
### As pandas DataFrame
```python
import imodmodel
df = imodmodel.read('my_model_file.mod')
```
```ipython
In [3]: df.head()
Out[3]:
object_id contour_id x y z
0 0 0 64.333336 64.666664 80.0
1 0 0 47.000000 77.333336 80.0
2 0 0 51.333332 45.666668 80.0
3 0 0 87.333336 49.666668 80.0
4 0 0 76.000000 82.000000 80.0
```
### As ImodModel object
```python
from imodmodel import ImodModel
model = ImodModel.from_file("my_model_file.mod")
```
```ipython
In [3]: model.objects[0].contours[0].points
Out[3]:
array([[ 6.875, 62.875, 124. ], ...])
In [4]: model.objects[0].meshes[0].vertices
Out[4]:
array([[ 6.87500000e+00, 6.28750000e+01, 1.24000000e+02], ...])
In [5]: model.objects[0].meshes[0].indices
Out[5]:
array([[156, 18, 152], ...])
In [6]: model.objects[0].meshes[0].face_values
Out[6]:
array([0., 0., 35.22094345, ...])
```
That's it!
## Installation
`imodmodel` can be installed from the [Python Package Index](https://pypi.org/) (PyPI)
```shell
pip install imodmodel
```
We recommend installing into a clean virtual environment.
Raw data
{
"_id": null,
"home_page": null,
"name": "imodmodel",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Alister Burt",
"author_email": "alisterburt@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1b/90/b149b82b7b313743719bb0cc46d37802acf8aedfaf461931fedad0ae54a5/imodmodel-0.0.15.tar.gz",
"platform": null,
"description": "# imodmodel\n\n[](https://github.com/alisterburt/imodmodel/raw/main/LICENSE)\n[](https://pypi.org/project/imodmodel)\n[](https://python.org)\n[](https://github.com/alisterburt/imodmodel/actions/workflows/test_and_deploy.yml)\n\nRead [IMOD model files](https://bio3d.colorado.edu/imod/doc/binspec.html) \nas [pandas dataframes](https://pandas.pydata.org/) \nin Python.\n\n\n## Usage\n\n### As pandas DataFrame\n\n```python\nimport imodmodel\n\ndf = imodmodel.read('my_model_file.mod')\n```\n\n```ipython\nIn [3]: df.head()\nOut[3]: \n object_id contour_id x y z\n0 0 0 64.333336 64.666664 80.0\n1 0 0 47.000000 77.333336 80.0\n2 0 0 51.333332 45.666668 80.0\n3 0 0 87.333336 49.666668 80.0\n4 0 0 76.000000 82.000000 80.0\n\n\n```\n\n### As ImodModel object\n\n```python\nfrom imodmodel import ImodModel\nmodel = ImodModel.from_file(\"my_model_file.mod\")\n```\n\n```ipython\nIn [3]: model.objects[0].contours[0].points\nOut[3]: \narray([[ 6.875, 62.875, 124. ], ...])\n\nIn [4]: model.objects[0].meshes[0].vertices\nOut[4]: \narray([[ 6.87500000e+00, 6.28750000e+01, 1.24000000e+02], ...])\n\nIn [5]: model.objects[0].meshes[0].indices\nOut[5]: \narray([[156, 18, 152], ...])\n\nIn [6]: model.objects[0].meshes[0].face_values\nOut[6]: \narray([0., 0., 35.22094345, ...])\n```\n\nThat's it!\n\n## Installation\n`imodmodel` can be installed from the [Python Package Index](https://pypi.org/) (PyPI)\n\n```shell\npip install imodmodel\n```\n\nWe recommend installing into a clean virtual environment.\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "IMOD model files as pandas DataFrames in Python.",
"version": "0.0.15",
"project_urls": {
"homepage": "https://github.com/teamtomo/imodmodel",
"repository": "https://github.com/teamtomo/imodmodel"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "02bc8f4e1658828fc7eb5a6c070eacb2aec1da3b21bc685e11fabe201e14fa09",
"md5": "45f370ba7b23b6706415a2195f1422b7",
"sha256": "5c0b25ec87a78661db75309f99f8cdc3a4ac129dd07c07e106bb1330539137dc"
},
"downloads": -1,
"filename": "imodmodel-0.0.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "45f370ba7b23b6706415a2195f1422b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 10971,
"upload_time": "2025-01-30T18:09:15",
"upload_time_iso_8601": "2025-01-30T18:09:15.434054Z",
"url": "https://files.pythonhosted.org/packages/02/bc/8f4e1658828fc7eb5a6c070eacb2aec1da3b21bc685e11fabe201e14fa09/imodmodel-0.0.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b90b149b82b7b313743719bb0cc46d37802acf8aedfaf461931fedad0ae54a5",
"md5": "469eba6982bac28c78d5c2f164355770",
"sha256": "399ee7b31e6ae5fb0f1847facf5d211023bd7dbaf6b604e44ba8ebf8c4f5dd06"
},
"downloads": -1,
"filename": "imodmodel-0.0.15.tar.gz",
"has_sig": false,
"md5_digest": "469eba6982bac28c78d5c2f164355770",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 239131,
"upload_time": "2025-01-30T18:09:18",
"upload_time_iso_8601": "2025-01-30T18:09:18.070874Z",
"url": "https://files.pythonhosted.org/packages/1b/90/b149b82b7b313743719bb0cc46d37802acf8aedfaf461931fedad0ae54a5/imodmodel-0.0.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-30 18:09:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "teamtomo",
"github_project": "imodmodel",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "imodmodel"
}