voxcov-py
Python bindings for voxcov.
Quick start
Clone voxcov
first.
Run maturin develop --release
to build and install the plugin. Use the --release
flag to get an optimized build.
Coverage example
Import the library
import voxcov as vc
Create a map.
apix = [1.0, 1.0, 1.0]
origin = [0.0, 0.0, 0.0]
size = 256
vox_map = vc.Map(apix, origin, size)
Add and delete spheres.
vox_map.add_sphere([10.0, 10.0, 10.0], 3.5, lambda vox: print("Adding A Covered: ", vox))
vox_map.add_sphere([11.0, 10.0, 10.0], 3.5, lambda vox: print("Adding B Covered: ", vox))
vox_map.del_sphere([11.0, 10.0, 10.0], 3.5, lambda vox: print("Deleting B uncovered: ", vox))
Blur example
Import the library
import voxcov as vc
Create a blurrer. Note, the API is a bit clunky. Named parameters would be nice.
blurred_map = vc.BlurMap(
[1.084,1.084,1.084],
[0,0,0],
[256,256,256],
5.1,
4.0
)
Stick atoms in.
blurred_map.add_gaussian([3,4,5], 10)
blurred_map.add_gaussian([4,5,3], 12)
Get a numpy array out.
blurred_map.to_numpy()