sim_seq_validation.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import os
  2. from pulseq_jemris_simulator import simulate_pulseq_jemris, recon_jemris
  3. from scipy.io import savemat, loadmat
  4. # IRSE
  5. n = 32
  6. phantom_info = {'fov': 0.25, 'N': n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': 0}
  7. sps = 'sim/seq_validation/irse_32/irse32.seq'
  8. sim_name = 'seq_validation\\irse_32'
  9. #Simulate
  10. simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
  11. kk, im, images = recon_jemris(file='sim/' + sim_name + '/signals.h5', dims=[n, n])
  12. savemat('sim/' + sim_name + '/utest_pulseq_sim_output.mat', {'images': images, 'kspace': kk, 'imspace': im})
  13. # #
  14. # # TSE
  15. # n = 32
  16. # phantom_info = {'fov': 0.25, 'N': n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': -0.08}
  17. # sps = 'sim/seq_validation/tse_32/tse32.seq'
  18. # sim_name = 'seq_validation\\tse_32'
  19. # # Make sequence
  20. # simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
  21. # kk, im, images = recon_jemris(file='sim/' + sim_name + '/signals.h5', dims=[n, n])
  22. # savemat('sim/' + sim_name + '/TSE-T2PLANE-utest_pulseq_sim_output.mat', {'images': images, 'kspace': kk, 'imspace': im})
  23. #
  24. # ## DWI
  25. # n = 32
  26. # phantom_info = {'fov':0.25, 'N':n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': -0.08}
  27. # sps = 'sim/seq_validation/dwi_32/dwi32.seq'
  28. # sim_name = 'seq_validation\\tse_32'
  29. #
  30. # simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
  31. # kk, im, images = recon_jemris(file='sim/'+sim_name+'/signals.h5',dims=[n,n])
  32. # savemat('sim/'+ sim_name + '/dwi_pulseq_sim_output.mat',{'images':images, 'kspace':kk, 'imspace':im})