A simple and functional toolkit for working with data in VTK.
Project description
Ngawari
Ngawari is a Python-based toolkit for simplifying operations in data analysis and processing, particularly focused on medical imaging and computational geometry. It is built heavily on top of the VTK library.
Features
- Advanced geometric calculations and transformations
- Medical imaging data processing
- Statistical analysis tools
- 3D visualization capabilities
Installation
To install Ngawari, run the following command:
pip install ngawari
Usage
Here's a quick example of how to use Ngawari:
from ngawari import ftk, fIO, vtkfilters
import numpy as np
# Create a simple sphere
sphere = vtkfilters.buildSphereSource([0, 0, 0], radius=1.0)
# Get points as numpy array
points = vtkfilters.getPtsAsNumpy(sphere)
# Add a scalar array
vtkfilters.setArrayFromNumpy(sphere, points[:, 0], "x_coords", SET_SCALAR=True)
# Apply a filter
smoothed = vtkfilters.smoothTris(sphere, iterations=10)
# Write to file
fIO.writeVTKFile(smoothed, "smoothed_sphere.vtp")
# Build image over sphere:
image = vtkfilters.buildRawImageDataFromPolyData(smoothed, res=[0.1,0.1,0.1])
# Add a scalar array to the image
vtkfilters.setArrayFromNumpy(image, np.random.rand(image.GetNumberOfPoints()), "random_scalar", SET_SCALAR=True)
# Null scalars outside sphere
image_nulled = vtkfilters.filterNullOutsideSurface(image, smoothed)
# Write to file
fIO.writeVTKFile(image_nulled, "image_over_sphere.vti")
For more detailed usage instructions, please refer to the documentation.
Documentation
Full documentation is available at https://fraser29.github.io/ngawari/
Contributing
We welcome contributions! Please see our Contributing Guide for more details.
License
Ngawari is released under the MIT License. See the LICENSE file for more details.
Contact
For any questions or support, please open an issue on our GitHub repository or contact us at support@ngawari.com.
Dependencies
This project uses the following major dependencies:
- VTK (BSD 3-Clause License) - https://vtk.org/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ngawari-0.1.15.tar.gz.
File metadata
- Download URL: ngawari-0.1.15.tar.gz
- Upload date:
- Size: 76.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6c2178c2019053304b4b5d30ae52fa6531d90bdf5c051e97a92ab7dce9defa6
|
|
| MD5 |
e13ab680ec96633d01edad4bfe8af197
|
|
| BLAKE2b-256 |
b7af17b622bfb0e70c175ffcef7cc13d729826720c875bb067a624f7f9dd2b4e
|
File details
Details for the file ngawari-0.1.15-py3-none-any.whl.
File metadata
- Download URL: ngawari-0.1.15-py3-none-any.whl
- Upload date:
- Size: 64.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67786f244eaef914ea70c12e8935000f31aa45fc4d82b64c7966a1e1d7f3a4c9
|
|
| MD5 |
1a79cd76da1f1140acda9f1e809a92f6
|
|
| BLAKE2b-256 |
31e5e5f2ae8164189579c27d5806d325dbf1c32a9f8678c6b89d16409f20deef
|