Metadata-Version: 2.4
Name: vessel-stl-voxelizer
Version: 1.0.0
Summary: Convert STL surface meshes to volumetric NIfTI masks with coordinate alignment and vessel connectivity repair
Author: Vessel STL Voxelizer Contributors
License-Expression: PolyForm-Noncommercial-1.0.0
Project-URL: Homepage, https://github.com/77even/Vessel-STL-Voxelizer
Project-URL: Repository, https://github.com/77even/Vessel-STL-Voxelizer
Project-URL: Issues, https://github.com/77even/Vessel-STL-Voxelizer/issues
Keywords: stl,nifti,voxelization,medical-imaging,vtk,vessel
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.21
Requires-Dist: SimpleITK>=2.1
Requires-Dist: vtk>=9.0
Requires-Dist: scipy>=1.7
Provides-Extra: dicom
Requires-Dist: pydicom>=2.3; extra == "dicom"
Provides-Extra: nibabel
Requires-Dist: nibabel>=4.0; extra == "nibabel"
Provides-Extra: progress
Requires-Dist: tqdm>=4.60; extra == "progress"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pydicom>=2.3; extra == "dev"
Requires-Dist: nibabel>=4.0; extra == "dev"
Requires-Dist: tqdm>=4.60; extra == "dev"
Provides-Extra: all
Requires-Dist: pydicom>=2.3; extra == "all"
Requires-Dist: nibabel>=4.0; extra == "all"
Requires-Dist: tqdm>=4.60; extra == "all"
Dynamic: license-file

# vessel-stl-voxelizer

Convert STL surface meshes to volumetric NIfTI masks, with automatic coordinate alignment and vessel connectivity repair.

Built for medical imaging workflows where STL meshes (e.g. segmented vessels) need to be rasterized onto a reference CT/MR volume.

## Install

```bash
pip install vessel-stl-voxelizer
```

Optional extras: `[dicom]` for DICOM input, `[all]` for everything.

## Usage

```bash
vessel-stl-voxelize --stl vessel.stl --reference ct_scan/ --output vessel.nii.gz
```

Multiple STLs into one multi-label volume, with connectivity repair:

```bash
vessel-stl-voxelize \
  --stl portal_vein.stl --label 1 \
  --stl hepatic_vein.stl --label 2 \
  --reference ct_scan/ --output vessels.nii.gz \
  --bridge-26conn
```

Python API:

```python
from vessel_stl_voxelizer import load_reference_image, stl_to_mask, save_nifti

ref = load_reference_image("ct_scan/")
mask = stl_to_mask("vessel.stl", ref)
save_nifti(mask, ref, "vessel.nii.gz")
```

See [`examples/basic_usage.py`](examples/basic_usage.py) for multi-label and connectivity-repair examples.

## License

Released under the [PolyForm Noncommercial License 1.0.0](LICENSE). Free for academic, personal, research, and other noncommercial use. **Commercial use is not permitted** — please contact the authors for a commercial license.

## Contributing

Issues and pull requests are welcome. For bug reports, please include the STL file (or a minimal reproducer), reference image metadata (`size`, `spacing`, `origin`, `direction`), and the full error traceback.
