legosurface.py 451 B

123456789101112131415
  1. """Represent a volume as lego blocks (voxels).
  2. Colors correspond to the volume's scalar.
  3. Try also:
  4. > vedo --lego data/embryo.tif"""
  5. from vedo import *
  6. vol = Volume(dataurl+'embryo.tif')
  7. vol.crop(back=0.50) # crop 50% from neg. y
  8. # show lego blocks whose value is between vmin and vmax
  9. lego = vol.legosurface(vmin=20, vmax=None, boundary=False)
  10. lego.cmap('seismic', vmin=0, vmax=127).add_scalarbar()
  11. show(lego, __doc__, axes=1, viewup='z').close()