#include <KSFoundation.h>
Data Fields | |
int | min_duration |
int | nseqinstances |
int | ssi_time |
int | duration |
int | momentstart |
int | rfscalingdone |
KS_DESCRIPTION | description |
KS_SEQ_HANDLE | handle |
KS_GRADRFCTRL | gradrf |
Each sequence module in the pulse sequence should have a dedicated KS_SEQ_CONTROL struct associated with it. For example, one may have the following KS_SEQ_CONTROL structs in a pulse sequence, where there is one main sequence and an fatsat module plugin that technically are two sequences - or sequence modules - (via the use of KS_SEQLENGTH()):
The KS_SEQ_CONTROL struct has multiple uses and could be viewed as the administrator for each sequence module. Here is a list of uses and steps neccesary to achieve the intended functionality:
cveval()
on HOST:pulsegen()
for the particular sequence module._pg()
, which contains all ks_pg_trap(), ks_pg_rf() (and other ks_pg_***()
) calls that build up the sequence module by placing out its sequence objects. The KS_SEQ_CONTROL struct for the current sequence module should be the last argument to each ks_pg_***()
call in seqmodulename_pg()
._pg()
in cveval()
the seqctrl.gradrf
field will be updated with pointers to its sequence objects, allowing seqctrl
to also know the number of occurrences of each trapezoid or RF.cveval()
, the SSI time for the sequence modules needs to be set. This is the time the sequence module needs to update its waveforms from one playout to the next during scanning. Often 1 ms is enough, but for long sequence modules it may need to be increased, especially if debugging outputs are used. It can also be set lower, sometimes down to about 0.1 ms.cveval()
, the seqmodulename_pg()
function for each sequence module should be called after the ks_eval_***()
calls setting up the sequence objects, but before the TR timing, RF scaling and SAR calculations. Inside each seqmodulename_pg()
function the .duration
and .min_duration
fields of the KS_SEQ_CONTROL struct should be set to the actual minimum duration of the sequence module (the [us] value corresponding to the absolute position of the last gradient or RF waveform). See ks_eval_seqctrl_setminduration() in the example below.pulsegen()
: The KS_SEQ_CONTROL struct is the 2nd arg to KS_SEQLENGTH(), which defines the hardware sequence duration (using the seqctrl.duration
value) for the sequence module. Using KS_SEQLENGTH() instead of GE's SEQLENGTH() macro allows sequence module playouts, and switching between modules, in scan()
using ks_scan_playsequence().scan()
, and its psd-specific subroutines: The KS_SEQ_CONTROL struct is passed to ks_scan_playsequence() to switch to and play out this sequence module in real time during scanning. ks_scan_playsequence() also returns seqctrl.duration
, allowing timing checks on HOST by dry-running scan functions in cveval()
. E.g. the scan clock is set by GE's pitscan
variable, which can be set by calling scanloop()
in the simplified example below.int min_duration |
In [us]. The minimum possible sequence duration based on the end of the last gradient/RF waveform. Lower limit of the .duration field that must be manually set
int nseqinstances |
Number of playouts in scan loop. ks_scan_playsequence() increments this on HOST for each call. Value is set to zero by ks_eval_seqcollection_resetninst()
int ssi_time |
In [us]. The SSI time (hardware update time) for the sequence module. Default is 1000 us
int duration |
In [us]. The actual duration of the sequence module. Must be >= .min_duration, and is used in KS_SEQLENGTH() and for SAR check and TR validation (GEReq_eval_checkTR_SAR())
int momentstart |
In [us]. Magnetic reference point for the excitation pulse (TE = 0) relative to the start of the sequence module. This field is set automatically by ks_pg_rf() if rf.role = KS_RF_ROLE_EXC
, under the assumption that there is only one excitation RF pulse in each sequence module. If not, .momentstart
should be set manually. Besides TE calculations in the sequence module's pg function itself, .momentstart
for a main sequence is also used in KSInversion.e for TI timing.
int rfscalingdone |
Default FALSE (until GEReq_eval_rfscaling() sets it to TRUE). For safety reasons (and to make sure correct FA is set), ks_pg_rf() (and hence ks_pg_selrf()) refuses to place the RF pulse belonging to this sequence module if .rfscalingdone
= FALSE.
KS_DESCRIPTION description |
Description of the sequence module
KS_SEQ_HANDLE handle |
Internal use. Used to keep track of the global sequence index
KS_GRADRFCTRL gradrf |
Internal use. Used to gather pointers to RF and gradient objects in the sequence module