imr-framework/pypulseq

Wrong flip angle calculation at testReport()

btasdelen opened this issue · 3 comments

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):

  • OS: macOS Catalina
  • OS Version: 10.15
  • pypulseq version: current dev branch.

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

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

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