Skip to main content

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:

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

ngawari-0.1.20.tar.gz (79.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ngawari-0.1.20-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file ngawari-0.1.20.tar.gz.

File metadata

  • Download URL: ngawari-0.1.20.tar.gz
  • Upload date:
  • Size: 79.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ngawari-0.1.20.tar.gz
Algorithm Hash digest
SHA256 4f25133f116727a169788424ad922c9a4b0e2ff76dd82a5ad76b91b46ee8f710
MD5 a5b9a94661bf547f58574477a9298d80
BLAKE2b-256 c538568afd00a8e71abac535d20186da34cf102f014a8427381042bb5a5783cc

See more details on using hashes here.

File details

Details for the file ngawari-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: ngawari-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 66.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for ngawari-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 85e0a5d57dd8dec6a321d61f1acfe5d8c6ecf7aae974d009f5c4ba70693fa735
MD5 55bcf474b8deb8e8ad15718cdf8c6431
BLAKE2b-256 33a521482789ee7d7716bd7a8d0bc7fcfe51ba029443e714b316a7ffc68cafbd

See more details on using hashes here.

Supported by

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