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
Hi all,
thanks for this work and for this amazing tool! I developed a Python version of this conversion toolbox.
In the process, I developed a rudimentary automatic segment detection algorithm, which I would like to discuss here.
If TRID is not provided, we can attempt to identify repeating groups of blocks based on the following assumptions:
Most sequences will consist of a preparation block (e.g., TG calibration, dummy scans for steady state, coil sensitivity) and a longer main loop sequence.
Preparation block will be played at the beginning of the sequence.
For this reason, we proceed as follows:
Extract the block_id array and use hasrot array to change the sign of rotated modules.
Starting from the beginning of the sequence, we attempt to identify periodic sequences following this reference. If no periodic sequences are detected, repeat the search starting from the second element (i.e., assume we had a preparation block at the beginning). Iterate until a periodic sequence is found or the end of the sequence is reached. Function will then return (dummy_block, main_loop) tuple.
If the sequence does not have preparation blocks, dummy_block will be empty. Otherwise, perform another level of recursion on dummy_block to split TG calibration and dummy blocks for steady-state preparation.
Flatten the dummy_block (e.g., [[TGcal], [SteadyStatePrep]] -> [*TGcal, *SteadyStatePrep]) and then append at the beginning of main loop, returning a single list whose elements are lists of the block_ids composing each segment, e.g., segments = [[0, 1], [2, 3, 4]] corresponds to two segments, one containing parent blocks 0,1 and the other containing 2, 3, 4.
While amplitude, phase and frequency of the blocks composing a segment can be independently modulated during the sequence, the segment can be rotated only as a whole. For this reason, we split rotated segments in separated segments, e.g., segments = [[0, 1], [2, -3, 4]]->[[0, 1], [2], [-3], [4]]. Finally, we take the magnitude of each segment definition to get rid of the sign. Here, we make the (somewhat?) reasonable assumption that waveforms with different rotation matrices (e.g., different spiral readouts) are separated by non rotated blocks (i.e., RF pulses or spoiler gradients). This would work for multi-echo GRE acquisitions, as long as each echo share the same readout, but not if multiple echoes undergo different rotations (e.g., https://archive.ismrm.org/2020/0616.html). In this case, user would have to either design the base consecutive readouts explicitly, or manually specify the segments using TRID label.
Finally, we loop over segments definition and search all the occurrences of the sequence in block_id array to build the core column of scanloop.
Notice that all these steps could be easily ported in the MATLAB implementation.
Of course it would be very hard to catch all the possible sequence designs, but I think these principle should cover most of the common cases. One possible extension that I would like to discuss before investing more time on it is the possibility to add recursion to the initial calibration portion of the sequence, to identify other steps I did not cover in this proof-of-concept implementation (e.g., PI calibration, noise scans, etc...). Looking forward to hearing from the community!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
thanks for this work and for this amazing tool! I developed a Python version of this conversion toolbox.
In the process, I developed a rudimentary automatic segment detection algorithm, which I would like to discuss here.
If TRID is not provided, we can attempt to identify repeating groups of blocks based on the following assumptions:
For this reason, we proceed as follows:
Notice that all these steps could be easily ported in the MATLAB implementation.
Of course it would be very hard to catch all the possible sequence designs, but I think these principle should cover most of the common cases. One possible extension that I would like to discuss before investing more time on it is the possibility to add recursion to the initial calibration portion of the sequence, to identify other steps I did not cover in this proof-of-concept implementation (e.g., PI calibration, noise scans, etc...). Looking forward to hearing from the community!
Matteo
Beta Was this translation helpful? Give feedback.
All reactions