numpy2volume0.py 256 B

1234567891011
  1. """Modify a Volume in-place from a numpy array"""
  2. from vedo import Volume, dataurl, show
  3. vol = Volume(dataurl+"embryo.tif")
  4. arr = vol.tonumpy()
  5. arr[:] = arr/5 + 15 # modify the array in-place with [:]
  6. vol.modified()
  7. show(vol, __doc__, axes=1).close()