# STLtoMask
## Table of Contents
- [Overview](#overview)
- [Features](#features)
- [Installation](#installation)
- [Example](#example)
- [Basic](#basic)
- [Advanced](#advanced)
## Overview
Create a 3D image based off of an STL file and user defined spacing. Additional, options exist for rotating the mesh, adding a 3MF file to create a "color-intensity" on the surface of the image, and flipping the image and mesh along the vertical axial plane.
The script produces 2 files: 1) Metaimage file for the image, 2) STL file just incase any rotations/flips were added (makes this file even if nothing was changed from the original STL file).
Notes:
- The spacing must be integeres, even if floats are input they will be converted.
- Adding a 3MF file will greatly increase the computation time depending on mesh size ~ 30 minutes for 1 million points.
## Features
Converts STL file to a 3D image.
Options:
- Add 3MF file to transfer mesh color to surface insensity on the image.
- Allows mesh rotation before image creation.
- Flip image/mesh before output along the vertical axis in the axial plane.
## Installation
Using [pip](https://pip.pypa.io/en/stable/):
```
pip install STLtoMask
```
## Examples
### Basic
```python
from STLtoMask.converter import stl_to_mask
input_path = r'/path/to/STL_file'
output_path = r/path/to/export/data'
spacing = [1, 1, 1]
stl_to_mask(input_path, output_path, spacing)
```
### Advanced
```python
from STLtoMask.converter import stl_to_mask
input_path = r'/path/to/STL_file'
output_path = r/path/to/export/data'
spacing = [1, 1, 1]
threemf_path = r'Z:\Morfeus\Derek\2023-06-21_OCCR.3mf'
rotation = {'zxy': [10, 5, 20]}
stl_to_mask(input_path, output_path, spacing, three_mf_path, rotation, flip=True)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/caleb-oconnor/STLtoMask",
"name": "STLtoMask",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Caleb OConnor",
"author_email": "csoconnor@mdanderson.org",
"download_url": "https://files.pythonhosted.org/packages/3c/34/3fdebc2307f6a6098b770185816f0416996692f18acef69be299351824a5/STLtoMask-0.14.tar.gz",
"platform": null,
"description": "# STLtoMask\r\n\r\n## Table of Contents\r\n\r\n- [Overview](#overview)\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Example](#example)\r\n - [Basic](#basic)\r\n - [Advanced](#advanced)\r\n \r\n## Overview\r\n\r\nCreate a 3D image based off of an STL file and user defined spacing. Additional, options exist for rotating the mesh, adding a 3MF file to create a \"color-intensity\" on the surface of the image, and flipping the image and mesh along the vertical axial plane. \r\n\r\nThe script produces 2 files: 1) Metaimage file for the image, 2) STL file just incase any rotations/flips were added (makes this file even if nothing was changed from the original STL file).\r\n\r\nNotes:\r\n - The spacing must be integeres, even if floats are input they will be converted.\r\n - Adding a 3MF file will greatly increase the computation time depending on mesh size ~ 30 minutes for 1 million points.\r\n\r\n## Features\r\n\r\nConverts STL file to a 3D image.\r\n\r\nOptions:\r\n - Add 3MF file to transfer mesh color to surface insensity on the image.\r\n - Allows mesh rotation before image creation.\r\n - Flip image/mesh before output along the vertical axis in the axial plane.\r\n\r\n\r\n## Installation\r\nUsing [pip](https://pip.pypa.io/en/stable/):\r\n```\r\npip install STLtoMask\r\n```\r\n\r\n## Examples\r\n### Basic\r\n```python\r\nfrom STLtoMask.converter import stl_to_mask\r\n\r\ninput_path = r'/path/to/STL_file'\r\noutput_path = r/path/to/export/data'\r\nspacing = [1, 1, 1]\r\n\r\nstl_to_mask(input_path, output_path, spacing)\r\n\r\n```\r\n### Advanced\r\n```python\r\nfrom STLtoMask.converter import stl_to_mask\r\n\r\ninput_path = r'/path/to/STL_file'\r\noutput_path = r/path/to/export/data'\r\nspacing = [1, 1, 1]\r\n\r\nthreemf_path = r'Z:\\Morfeus\\Derek\\2023-06-21_OCCR.3mf'\r\nrotation = {'zxy': [10, 5, 20]}\r\n\r\nstl_to_mask(input_path, output_path, spacing, three_mf_path, rotation, flip=True)\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Convert a STL file into a 3D mask.",
"version": "0.14",
"project_urls": {
"Homepage": "https://github.com/caleb-oconnor/STLtoMask"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5fd32b0dc7fcd1b46049f3e830923afbd42feec3cd4dcec789ab5c0b8fb1928d",
"md5": "3c450b724f9d0c1a3502e4726e3c3757",
"sha256": "7f130299fc19b22302bcc040e8673f403a300d7646cb98ec8fe2c9b64190624d"
},
"downloads": -1,
"filename": "STLtoMask-0.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3c450b724f9d0c1a3502e4726e3c3757",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 20085,
"upload_time": "2023-11-06T16:48:31",
"upload_time_iso_8601": "2023-11-06T16:48:31.765001Z",
"url": "https://files.pythonhosted.org/packages/5f/d3/2b0dc7fcd1b46049f3e830923afbd42feec3cd4dcec789ab5c0b8fb1928d/STLtoMask-0.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3c343fdebc2307f6a6098b770185816f0416996692f18acef69be299351824a5",
"md5": "f735ef7d0670f555daab5aa97ccc26b3",
"sha256": "295e49b5e08089c4cc62a1eb5248324c272fdd980fbe065730ad337340c7a0d9"
},
"downloads": -1,
"filename": "STLtoMask-0.14.tar.gz",
"has_sig": false,
"md5_digest": "f735ef7d0670f555daab5aa97ccc26b3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19221,
"upload_time": "2023-11-06T16:48:33",
"upload_time_iso_8601": "2023-11-06T16:48:33.193512Z",
"url": "https://files.pythonhosted.org/packages/3c/34/3fdebc2307f6a6098b770185816f0416996692f18acef69be299351824a5/STLtoMask-0.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-06 16:48:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "caleb-oconnor",
"github_project": "STLtoMask",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "stltomask"
}