lowpassfilter.py 626 B

12345678910111213141516
  1. from vedo import *
  2. # mode = 1 is maximum projection (default is 0=composite)
  3. t1 = Text2D('Original volume', c='lg')
  4. v1 = Volume(dataurl+'embryo.tif').mode(1)
  5. v1.add_scalarbar3d(c='w')
  6. v1.scalarbar = v1.scalarbar.clone2d("top-right", 0.08)
  7. # cutoff range is roughly in the range of 1 / size of object
  8. t2 = Text2D('High freqs in the FFT are cut off', c='lb')
  9. v2 = v1.clone().frequency_pass_filter(high_cutoff=.001, order=1).mode(1)
  10. v2.add_scalarbar3d(c='w')
  11. v2.scalarbar = v2.scalarbar.clone2d("top-right", 0.08)
  12. show([(v1,t1), (v2,t2)], N=2, bg='bb', zoom=1.5, axes=dict(digits=2)).close()
  13. #write(v2, 'embryo_filtered.vti')