-
I want to replace original sinc pulse by SLR pulse, but I don't know how to. I made 2 attempts on write_gre.py, but neither was successful. So how can I get SLR pulse with 3mm slice thickness by code? It would be even better if apodization=0.42 could be set |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @qizixinge. If you want to use time_bw_product = 4
slice_thickness = 3e-3 # Slice thickness
flip_angle = np.pi / 2
# Set system limits
system = Opts(
max_grad=32,
grad_unit='mT/m',
max_slew=130,
slew_unit='T/m/s',
rf_ringdown_time=30e-6,
rf_dead_time=100e-6,
)
pulse_cfg = SigpyPulseOpts(
pulse_type='slr',
ptype='st',
ftype='ls',
d1=0.01,
d2=0.01,
cancel_alpha_phs=False,
n_bands=3,
band_sep=20,
phs_0_pt='None',
)
rfp, gz, gzr = sigpy_n_seq(
flip_angle=flip_angle,
system=system,
duration=3e-3,
slice_thickness=slice_thickness,
time_bw_product=4,
return_gz=True,
pulse_cfg=pulse_cfg,
plot=True,
)
seq = pp.Sequence()
seq.add_block(rfp) There is no apodization input to this function. The documentation for this function is incorrect, I will update it soon. If this function is not sufficient for your use case (e.g. you really need apodization), you can design your pulse externally as a waveform, and use Trfmin = 2e-3 # duration of one pulse segment [sec]
slice_thickness = 4e-3 # [m]
Nz = 20
n = ceil((Trfmin/dt)/4)*4
Trf = n*dt
tb = 8
bw = tb/Trf
signal = slr.dzrf(n=n, tb=tb, ptype='st', ftype='ls', d1=0.01, d2=0.01, cancel_alpha_phs=False)
# Create an RF event
rf_res, gz = make_arbitrary_rf(
signal=signal, slice_thickness=slice_thickness*Nz,
bandwidth=bw, flip_angle=pi/3,
system=system, return_gz=True, use="excitation"
) |
Beta Was this translation helpful? Give feedback.
Okay, I found the issue, but this is not an issue with
pypulseq
, but probably an issue withsigpy
. Settingtime_bw_product=1.5
causes a negative value in a call tofirls
function, which, as stated in the error, only supports values between 0 and 1. In fact, you can only set thetime_bw_product
to 2 or higher.I don't know enough RF pulse design to say not having TBW less than 2 for SLR pulses is reasonable or not. I think you would have a better luck discussing this over sigpy. Overall, your code works if you set
time_bw_product=2
.