tet_threshold.py 480 B

123456789101112131415
  1. """Threshold a TetMesh with a scalar array"""
  2. from vedo import *
  3. tetm = TetMesh(dataurl + "limb.vtu")
  4. # Threshold the tetrahedral mesh for values in the range:
  5. tetm.threshold(above=0.9, below=1)
  6. tetm.celldata.select("chem_0").cmap("Accent")
  7. tetm.add_scalarbar3d("chem_0 expression levels", c="k", italic=1)
  8. # Make a 2D clone of the 3D scalarbar and place it to the right:
  9. tetm.scalarbar = tetm.scalarbar.clone2d("center-right", size=0.2)
  10. show(tetm, __doc__, axes=1).close()