Skip to main content

Library for manipulating spatial arrays.

Project description


import numpy as np
import spndarray

# We have a dataset...
>>> data = np.zeros((10, 10, 10))
# It has a peculiar value at [5, 5, 5].
>>> data[5, 5, 5] = 3.14

# WE know that each voxel of this block is one meter:
>>> block = spndarray.spndarray(data, unit="m")

# Now we can access that same data in whatever unit we'd like:
>>> print(block[5000, 5000, 5000, "mm"])

# What if the voxels aren't perfect unit-cubes?
# In this example, the data are 0.5 x 0.5 x 5 meters per voxel:
>>> aniso_block = spndarray.spndarray(
    voxelsize=(0.5, 0.5, 5),
>>> print(aniso_block[2.5, 2.5, 25, 'm'])

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

spndarray-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded source

Built Distribution

spndarray-0.0.1-py2.py3-none-any.whl (2.4 kB view hashes)

Uploaded py2 py3

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