Skip to main content

Convert a STL file into a 3D mask.

Project description

STLtoMask

Table of Contents

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:

pip install StlMaskConverter

Usage

To run the module, use the following command:

usage: converter.py [-h] -i INPUT -o OUTPUT -s SPACING [SPACING ...] [-m THREE_MF] [-r ROTATION [ROTATION ...]] [-f]


optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        STL file
  -o OUTPUT, --output OUTPUT
                        Directory to output mask and STL if edited
  -s SPACING [SPACING ...], --spacing SPACING [SPACING ...]
                        Output mask spacing in mm example [1, 1, 1]
  -m THREE_MF, --three_mf THREE_MF
                        3mf file needed for adding intensity to mask
  -r ROTATION [ROTATION ...], --rotation ROTATION [ROTATION ...]
                        Rotation in dictionary form indicating order ex: {yxz: [10, 30, 0}, meaning rotate y=10 degrees then x=30 degrees
  -f, --flip            Flips axial plane along the vertical line

Example

python converter.py -i '\stl_filepath' -o 'output_dir' -s 1 1 1 -m '\3mf_filepath' -r xyz 10 20 30.1 -f False

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

STLtoMask-0.11.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

STLtoMask-0.11-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file STLtoMask-0.11.tar.gz.

File metadata

  • Download URL: STLtoMask-0.11.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for STLtoMask-0.11.tar.gz
Algorithm Hash digest
SHA256 ec15d3cb7763a3280f5a2fbd58904d7ed6c4bf56e6a426e5a29e8d79aebbac38
MD5 c6807439ffcc3c98f66f7827c2d36bb4
BLAKE2b-256 03b744718b3ac00c5bcc7f7a03dfd248978ff22f5e7d98da50414e351f4df712

See more details on using hashes here.

File details

Details for the file STLtoMask-0.11-py3-none-any.whl.

File metadata

  • Download URL: STLtoMask-0.11-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for STLtoMask-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ca1a7d16567c60aa460b1b09cdca440149d34f31dce58508c396b0d1e86fe65a
MD5 cc4f736cbad37bbea0359330ad06b978
BLAKE2b-256 067cfbca1ebd05a3d0c344eeee8cb96ebf7d0c67bfbd07204c11da7d12d108db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page