-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsim_seq_validation.py
More file actions
38 lines (32 loc) · 1.63 KB
/
sim_seq_validation.py
File metadata and controls
38 lines (32 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
from pulseq_jemris_simulator import simulate_pulseq_jemris, recon_jemris
from scipy.io import savemat, loadmat
# IRSE
n = 32
phantom_info = {'fov': 0.25, 'N': n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': 0}
sps = 'sim/seq_validation/irse_32/irse32.seq'
sim_name = 'seq_validation\\irse_32'
#Simulate
simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
kk, im, images = recon_jemris(file='sim/' + sim_name + '/signals.h5', dims=[n, n])
savemat('sim/' + sim_name + '/utest_pulseq_sim_output.mat', {'images': images, 'kspace': kk, 'imspace': im})
# #
# # TSE
# n = 32
# phantom_info = {'fov': 0.25, 'N': n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': -0.08}
# sps = 'sim/seq_validation/tse_32/tse32.seq'
# sim_name = 'seq_validation\\tse_32'
# # Make sequence
# simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
# kk, im, images = recon_jemris(file='sim/' + sim_name + '/signals.h5', dims=[n, n])
# savemat('sim/' + sim_name + '/TSE-T2PLANE-utest_pulseq_sim_output.mat', {'images': images, 'kspace': kk, 'imspace': im})
#
# ## DWI
# n = 32
# phantom_info = {'fov':0.25, 'N':n, 'type': 'cylindrical', 'dim': 2, 'dir': 'z', 'loc': -0.08}
# sps = 'sim/seq_validation/dwi_32/dwi32.seq'
# sim_name = 'seq_validation\\tse_32'
#
# simulate_pulseq_jemris(seq_path=sps, phantom_info=phantom_info, sim_name=sim_name, coil_fov=0.25)
# kk, im, images = recon_jemris(file='sim/'+sim_name+'/signals.h5',dims=[n,n])
# savemat('sim/'+ sim_name + '/dwi_pulseq_sim_output.mat',{'images':images, 'kspace':kk, 'imspace':im})