You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the example sequence write_epi.py for the SAR calculation with the pypulseq.SAR.SAR_calc.cal_SAR(seq) function results in an error.
"SAR_calc.py", line 107, in _SAR_from_seq signal = rf.signal AttributeError: 'NoneType' object has no attribute 'signal'
To Reproduce
from write_epi import main as write_epi
import pypulseq as pp
write_epi(plot = False, write_seq = True, seq_filename = 'epi_pypulseq.seq')
pp.SAR.SAR_calc.calc_SAR('epi_pypulseq.seq')
I would propose to check in addition to line 105 of SAR_calc.py if the signal of the rf event is not none.
Instead of
if hasattr(block, "rf"): # has rf
rf = block.rf
signal = rf.signal
use
if hasattr(block, "rf"): # has rf
rf = block.rf
if rf is not None: # rf signal is not None
signal = rf.signal
However, I have the feeling that the rf block is always present in the current version of pypulseq, in that case the first if statement is obsolete, if that is not the case please correct me.
Kind regards
Helge
The text was updated successfully, but these errors were encountered:
Describe the bug
Using the example sequence
write_epi.py
for the SAR calculation with thepypulseq.SAR.SAR_calc.cal_SAR(seq)
function results in an error."SAR_calc.py", line 107, in _SAR_from_seq
signal = rf.signal
AttributeError: 'NoneType' object has no attribute 'signal'
To Reproduce
I would propose to check in addition to line 105 of
SAR_calc.py
if the signal of the rf event is not none.Instead of
use
However, I have the feeling that the rf block is always present in the current version of pypulseq, in that case the first
if statement
is obsolete, if that is not the case please correct me.Kind regards
Helge
The text was updated successfully, but these errors were encountered: