-
Hello, I am trying to create different 3D shape - sphere, cube, pyramid etc. And I wish to convert it to Volume (and also to numpy array).
AttributeError: 'NoneType' object has no attribute 'GetDimensions' |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 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) |
Beta Was this translation helpful? Give feedback.
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()