imr-framework / pypulseq

Pulseq in Python
https://pypulseq.readthedocs.io
GNU Affero General Public License v3.0
117 stars 63 forks source link

fix calculation of bandwidth of adiabatic hypsec pulse #83

Closed schuenke closed 1 year ago

schuenke commented 2 years ago

When trying to use a slice selective adiabatic hypsec pulse, I got several errors related to the calculation of the bandwidth of the hypsec pulse. I fixed the obvious ones like a wrong import of _calc_rfcenter() in _calc_rfbandwidth() and a wrong attribute name (rf.sig instead of rf.signal) and provide a new solution for the ___findflank() function:

    def __find_flank(x, f, c):
       m = np.max(np.abs(f))
       f = np.abs(f) / m
       i = np.argwhere(f > c)[0]

       return x[i]

Using calc_rf_bandwidth() with a cut_off value of 0.5 instead of 0.1 (which makes sense imo because the signal gets normalized to 1 and we are interested in the width at half maximum ?!) yields a bw of 1280 Hz, which is close to the literaure value of ~ 1250 Hz for the hypsec pulse with default settings (beta = 800, mu =4.9)

HOWEVER, simply using the analytic expression for the bw of a hypsec pulse makes far more sense imo. It is given by

*bw = mu beta / pi**

As a reference, here the passage from Bernstein - Handbook of MRI pulse sequences:

grafik

Using the analytic expression is the way I implemented it now in _make_adiabaticpulse.py

btasdelen commented 1 year ago

@sravan953 I agree with @schuenke. I tested it, and it seems to give the correct bandwidth. It is much cleaner and less hand-wavy.