Core sequence object making arbitrary waveforms on any board (using float data format)
KS_WAVE
The KS_WAVE sequence object contains a KS_WAVEFORM (float[KS_MAXWAVELEN]
) to hold the waveform. The physical unit of the waveform in the KS_WAVE object depends the board on which it is placed in pulsegen(). For the
- gradient boards (XGRAD, YGRAD, ZGRAD), the unit is [G/cm]
- THETA board, the unit is [degrees]
- RF and OMEGA boards, the units are arbitrary (c.f. ks_eval_rf() and ks_eval_wave())
Similar to the KS_TRAP sequence object, KS_WAVE is a core object used in other objects such as KS_RF. For RF pulse generation, direct use of KS_WAVE functions in e.g. cveval()
or in the @pg
section should be avoided as there is no mechanism to do the proper RF scaling. For RF, use instead KS_RF and KS_SELRF.
The .gradnum[]
field is modified by ks_pg_wave() on HOST to keep count of how many times the KS_WAVE has been placed in the @pg
section. This information is used in ks_eval_hwlimits() together with the sequence's common KS_SEQ_CONTROL object to calculate gradient heating limits for the sequence.
NOTE: Regardless of the order placed out in the @pg
section, and on which boards (XGRAD, YGRAD, ZGRAD) the KS_WAVE object is placed, the instance number of the KS_WAVE is automatically sorted in time. If two instances of one KS_WAVE occur at the same time (.pos
) on different boards, XGRAD comes before YGRAD, which comes before ZGRAD. These abstract, sorted, instance numbers are used by ks_scan_***() functions in scan() to refer to a specific instance of a KS_WAVE object in the sequence. However, unlike KS_TRAP, replacing e.g. a waveform in run-time for an instance of a KS_WAVE will affect all instances on the same board. This, since there is only one hardwave waveform per board for each KS_WAVE.
It is a requirement that there is a (sequence generating) function in the @pg
section (containing the ks_pg_wave() call(s)) that can be run on both HOST and TGT. This function should be called exactly once in cveval()
(after ks_eval_wave() and other ks_eval_***()
functions). ks_pg_wave() will throw an error on TGT if this has not been done. See KS_SEQ_CONTROL for an example
Example
@ipgexport (HOST)
@host
...or...
...or...
...or...
}
@pg
tmploc.pos = 10ms;
tmploc.board = XGRAD;