Skip to content

How to convert Assembly to Volume? #672

Answered by marcomusy
jaydeepsb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry you mean creating a Volume where inside voxels are set to 1 and outer voxels are set to zero? then you can use .binarize()

from vedo import Volume, Sphere, merge, show
a = merge(Sphere(r=12, res=100), Sphere(r=9, res=100))
a_vol = a.binarize(spacing=(0.2,0.2,0.2))
arr = a_vol.tonumpy()
print(arr.shape)
show(a_vol)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jaydeepsb
Comment options

Answer selected by jaydeepsb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants