imr-framework / pypulseq

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

Wrong flip angle calculation at testReport() #71

Closed btasdelen closed 2 years ago

btasdelen commented 2 years ago

Hi, thanks for this amazing framework.

testReport() function calculates half of the actual flip angle. Mistake comes from the line 20 in ext_test_report.py: flip_angles_deg.append(np.abs(np.sum(rf.signal) * rf.t[0] * 360)) rf.t[0] does not correspond to the raster time, in fact, it is half the raster time. Thus, the flip angle is calculated as half of the actual value. I believe it should be rf.t[1] - rf.t[0].

To Reproduce I am using the dev branch. Example gre_label.py sequence with

    print("\n===== Detailed Test Report =====\n")
    rep_str = seq.test_report()
    print(rep_str)

added at the end does the trick.

Expected behavior It should report the designed flip angle value as given to make_sinc_pulse() function.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

sravan953 commented 2 years ago

Hi @bilal-tasdelen ! Thank you for your kind words :), and thanks for reporting this! Will take a look.

sravan953 commented 2 years ago

@bilal-tasdelen Please let me know if it works OK now.

btasdelen commented 2 years ago

Flip angle is correctly calculated now, thanks! Closing the issue.