Skip to content

Commit

Permalink
Fixed a bug in the flocra_pulseq interpreter tha changed the warmup t…
Browse files Browse the repository at this point in the history
…ime after the first batch
  • Loading branch information
josalggui committed Nov 28, 2024
1 parent 6aa27a8 commit e1dddb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions flocra_pulseq/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ def interpret(self, pulseq_file):
self._logger.info(f'Interpreting ' + pulseq_file)
if self.is_assembled:
self._logger.info('Re-initializing over old sequence...')
self.__init__(rf_center=self._rf_center, rf_amp_max=self._rf_amp_max,
self.__init__(
rf_center=self._rf_center, rf_amp_max=self._rf_amp_max,
gx_max=self._grad_max['gx'], gy_max=self._grad_max['gy'], gz_max=self._grad_max['gz'],
clk_t=self._clk_t, tx_t=self._tx_t, grad_t=self._grad_t)
clk_t=self._clk_t, tx_t=self._tx_t, grad_t=self._grad_t,
tx_warmup=self._tx_warmup, tx_zero_end=self._tx_zero_end, grad_zero_end=self._grad_zero_end,
log_file='ps_interpreter', log_level=20,
)
self._read_pulseq(pulseq_file)
self._compile_tx_data()
self._compile_grad_data()
Expand Down Expand Up @@ -537,6 +541,8 @@ def _stream_block_v2(self, block_id):
out_dict['tx0'] = (self._tx_times[tx_id], self._tx_data[tx_id])
# duration = max(duration, self._tx_durations[tx_id])
tx_gate_start = self._tx_times[tx_id][0] - self._tx_warmup
if tx_gate_start < 0:
print("ERROR")
self._error_if(tx_gate_start < 0,
f'Tx warmup ({self._tx_warmup}) of RF event {tx_id} is longer than delay ({self._tx_times[tx_id][0]})')
out_dict['tx_gate'] = (np.array([tx_gate_start, self._tx_durations[tx_id]]),
Expand Down
6 changes: 3 additions & 3 deletions seq/rare_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self):
self.addParameter(key='repetitionTime', string='Repetition time (ms)', val=300., units=units.ms, field='SEQ', tip="0 to ommit this pulse")
self.addParameter(key='fov', string='FOV[x,y,z] (cm)', val=[12.0, 12.0, 12.0], units=units.cm, field='IM')
self.addParameter(key='dfov', string='dFOV[x,y,z] (mm)', val=[0.0, 0.0, 0.0], units=units.mm, field='IM', tip="Position of the gradient isocenter")
self.addParameter(key='nPoints', string='nPoints[rd, ph, sl]', val=[60, 60, 20], field='IM')
self.addParameter(key='nPoints', string='nPoints[rd, ph, sl]', val=[120, 120, 10], field='IM')
self.addParameter(key='angle', string='Angle (º)', val=0.0, field='IM')
self.addParameter(key='rotationAxis', string='Rotation axis', val=[0, 0, 1], field='IM')
self.addParameter(key='etl', string='Echo train length', val=6, field='SEQ') ## nm of peaks in 1 repetition
Expand Down Expand Up @@ -1252,7 +1252,7 @@ def save_ismrmrd(self):


if __name__ == '__main__':
seq = RARE_pp()
seq = RarePyPulseq()
seq.sequenceAtributes()
seq.sequenceRun(plotSeq=False, demo=True, standalone=True)
seq.sequenceRun(plot_seq=False, demo=True, standalone=True)
seq.sequenceAnalysis(mode='Standalone')

0 comments on commit e1dddb6

Please sign in to comment.