probe_line1.py 557 B

1234567891011121314151617181920
  1. """Probe a Volume (voxel dataset) with lines"""
  2. from vedo import *
  3. vol = Volume(dataurl + "embryo.slc")
  4. lines = []
  5. for i in range(60): # probe scalars on 60 parallel lines
  6. step = (i - 30) * 2
  7. p1 = vol.center() + [-100, step, step]
  8. p2 = vol.center() + [ 100, step, step]
  9. ln = Line(p1, p2, res=100)
  10. lines.append(ln)
  11. lines = merge(lines)
  12. # Probe the Volume with the lines and add the scalars as pointdata
  13. lines.probe(vol)
  14. lines.lw(3).cmap('hot', vmin=0, vmax=110).add_scalarbar()
  15. print(lines)
  16. show(vol, lines, __doc__, axes=1).close()