Data Structures | |
struct | KSCHEMSAT_PARAMS |
struct | KSCHEMSAT_SEQUENCE |
struct | KSINV_PARAMS |
struct | KSINV_SEQUENCE |
struct | KSSPSAT_VOLBORDER |
struct | KSSPSAT_LOC |
struct | KSSPSAT_PARAMS |
struct | KSSPSAT_SEQUENCE |
Enumerations | |
enum | { KSCHEMSAT_OFF, KSCHEMSAT_FAT, KSCHEMSAT_WATER } |
enum | { KSCHEMSAT_RF_STD, KSCHEMSAT_RF_SINC } |
enum | { KSINV_OFF, KSINV_IR_SIMPLE, KSINV_IR_SLICEAHEAD, KSINV_FLAIR_BLOCK, KSINV_FLAIR_T2PREP_BLOCK } |
enum | { KSINV_RF_STD, KSINV_RF_ADIABATIC, KSINV_RF_CUSTOM } |
enum | KSINV_LOOP_MODE { KSINV_LOOP_NORMAL, KSINV_LOOP_DUMMY, KSINV_LOOP_SLICEAHEAD_FIRST, KSINV_LOOP_SLICEAHEAD_LAST } |
enum | { KSSPSAT_OFF, KSSPSAT_IMPLICIT, KSSPSAT_EXPLICIT } |
enum | { KSSPSAT_1, KSSPSAT_2, KSSPSAT_3, KSSPSAT_4, KSSPSAT_5, KSSPSAT_6, KSSPSAT_MAXNUMSAT } |
enum | { KSSPSAT_NEG =1, KSSPSAT_POS, KSSPSAT_HAD, KSSPSAT_PARA } |
enum | { KSSPSAT_RF_STD, KSSPSAT_RF_COMPLEX, KSSPSAT_RF_MAXRFTYPES } |
Functions | |
int | kschemsat_pg (KSCHEMSAT_SEQUENCE *kschemsat) |
void | kschemsat_init_params (KSCHEMSAT_PARAMS *params) |
void | kschemsat_init_sequence (KSCHEMSAT_SEQUENCE *kschemsat) |
void | kschemsat_eval_copycvs (KSCHEMSAT_PARAMS *params) |
STATUS | kschemsat_eval_setupobjects (KSCHEMSAT_SEQUENCE *kschemsat) |
STATUS | kschemsat_eval (KS_SEQ_COLLECTION *seqcollection) |
void | kschemsat_scan_seqstate (KSCHEMSAT_SEQUENCE *kschemsat) |
STATUS | ksinv_eval_checkTR_SAR (KS_SEQ_COLLECTION *seqcollection, KS_SLICE_PLAN *slice_plan, int(*play_coreslice)(const SCAN_INFO *, int, int, void **), int core_nargs, void **core_args) |
int | ksinv_pg (KSINV_SEQUENCE *ksinv) |
int | ksinv_scan_sliceloop (const KS_SLICE_PLAN *slice_plan, const SCAN_INFO *slice_positions, int passindx, KSINV_SEQUENCE *ksinv1, KSINV_SEQUENCE *ksinv2, KS_SEQ_CONTROL *ksinv_filltr, KSINV_LOOP_MODE ksinv_loop_mode, int(*play_coreslice)(const SCAN_INFO *, int, int, void **), int core_nargs, void **core_args) |
void | ksinv_init_params (KSINV_PARAMS *params) |
void | ksinv_init_sequence (KSINV_SEQUENCE *ksinv) |
void | ksinv_eval_copycvs (KSINV_PARAMS *params, int mode) |
STATUS | ksinv_eval_setuprf (KSINV_SEQUENCE *ksinv, const char *suffix, KS_SELRF *custom_selrf) |
STATUS | ksinv_eval_setupt2prep (KSINV_SEQUENCE *ksinv) |
STATUS | ksinv_eval_setupobjects (KSINV_SEQUENCE *ksinv, const char *suffix, KS_SELRF *custom_selrf) |
int | ksinv_eval_nullti (int TR, int T1value, int seqdur) |
STATUS | ksinv_eval_duration (KSINV_SEQUENCE *ksinv, int TI, int coreslice_momentstart) |
STATUS | ksinv_eval_duration_t1value (KSINV_SEQUENCE *ksinv, int *TR, int *TI, int approxti_flag, int coreslice_momentstart, int coreslice_duration, int mainseq_mindur, int T1value_toNull, int slperpass) |
STATUS | ksinv_eval_duration_flairblock (KSINV_SEQUENCE *ksinv, int TI, int coreslice_momentstart, int coreslice_duration, int slperpass) |
STATUS | ksinv_eval_setfilltr (KS_SEQ_CONTROL *filltr, const char *const desc, int duration) |
STATUS | ksinv_init_UI () |
STATUS | ksinv_eval_UI () |
STATUS | ksinv_eval (KS_SEQ_COLLECTION *seqcollection, KS_SELRF *custom_selrf) |
int | ksinv_eval_mintr (const KS_SLICE_PLAN *slice_plan, KS_SEQ_COLLECTION *seqcollection, float gheatfact, KSINV_SEQUENCE *ksinv1, KSINV_SEQUENCE *ksinv2, KS_SEQ_CONTROL *ksinv_filltr, int(*play_coreslice)(const SCAN_INFO *, int, int, void **), int core_nargs, void **core_args) |
int | ksinv_eval_maxslicespertr (int TR, KS_SLICE_PLAN temp_slice_plan, KS_SEQ_COLLECTION *seqcollection, float gheatfact, KSINV_SEQUENCE *ksinv1, KSINV_SEQUENCE *ksinv2, KS_SEQ_CONTROL *ksinv_filltr, int(*play_coreslice)(const SCAN_INFO *, int, int, void **), int core_nargs, void **core_args) |
STATUS | ksinv_eval_flairblock (KSINV_SEQUENCE *ksinv, int *filltr_time, int *repetition_time, int *inversion_time, int autotr_flag, int T1tonull, int coreslice_momentstart, int coreslice_duration, int slperpass) |
STATUS | ksinv_eval_flairblock_withmainupdate (KSINV_SEQUENCE *ksinv, KS_SEQ_CONTROL *ksinv_filltr, KS_SEQ_CONTROL *mainseqctrl, int *repetition_time, int *inversion_time, int autotr_flag, int T1tonull, int coreslice_momentstart, int coreslice_duration, int slperpass) |
STATUS | ksinv_eval_multislice (KS_SEQ_COLLECTION *seqcollection, KS_SLICE_PLAN *slice_plan, int(*play_coreslice)(const SCAN_INFO *, int, int, void **), int core_nargs, void **core_args, KS_SEQ_CONTROL *mainseqctrl) |
STATUS | ksinv_check () |
STATUS | ksinv_predownload_setrecon () |
void | ksinv_pulsegen () |
STATUS | ksinv_scan_seqstate (KSINV_SEQUENCE *ksinv, const SCAN_INFO *slice_info) |
int | ksinv_scan_irslice (KSINV_SEQUENCE *ksinv, const SCAN_INFO *slice_pos) |
int | ksinv_scan_sliceloop_nargs (int slperpass, int nargs, void **args) |
int | ksspsat_pg (KSSPSAT_SEQUENCE *ksspsat) |
void | ksspsat_scan_seqstate (KSSPSAT_SEQUENCE *ksspsat, float rfphase) |
void | ksspsat_init_params (KSSPSAT_PARAMS *params) |
void | ksspsat_init_sequence (KSSPSAT_SEQUENCE *ksspsat) |
void | ksspsat_eval_copycvs (KSSPSAT_PARAMS *params) |
int | ksspsat_eval_numsats (KSSPSAT_SEQUENCE *ksspsat) |
STATUS | ksspsat_eval_volborder (KSSPSAT_VOLBORDER *v) |
STATUS | ksspsat_eval_satplacements_from_UI (KSSPSAT_SEQUENCE *ksspsat, KSSPSAT_PARAMS *params) |
STATUS | ksspsat_eval_satplacements_dump (KSSPSAT_SEQUENCE *ksspsat, KSSPSAT_PARAMS *params) |
STATUS | ksspsat_eval_loggrd (LOG_GRAD *satloggrd, SCAN_INFO *slice_info, int satoblmethod) |
STATUS | ksspsat_eval_setupobjects () |
STATUS | ksspsat_eval (KS_SEQ_COLLECTION *seqcollection) |
STATUS | ksspsat_pulsegen () |
int | ksspsat_scan_playsequences (int perform_slicetimeplot) |
Variables | |
KSCHEMSAT_SEQUENCE | kschemsat = KSCHEMSAT_INIT_SEQUENCE |
int | kschemsat_flag = KSCHEMSAT_OFF with {KSCHEMSAT_OFF, KSCHEMSAT_WATER, KSCHEMSAT_OFF, VIS, "flag for kschemsat (0:Off 1:FatSat 2:WaterSat)",} |
float | kschemsat_flip = KSCHEMSAT_DEFAULT_FLIP with {0, 360, KSCHEMSAT_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
int | kschemsat_rftype = KSCHEMSAT_RF_STD with {KSCHEMSAT_RF_STD, KSCHEMSAT_RF_SINC, KSCHEMSAT_RF_STD, VIS, "RF type (0:Std 1:Sinc)",} |
int | kschemsat_sinc_bw = KSCHEMSAT_DEFAULT_SINCRF_BW_3T with {2, 100000, 300, VIS, "Sinc RF BW",} |
int | kschemsat_sinc_tbp = KSCHEMSAT_DEFAULT_SINCRF_TBP with {2, 20, 2, VIS, "Sinc RF Time-Bandwidth-Product",} |
int | kschemsat_rfoffset = 0 with {-1000, 1000, 0, VIS, "RF excitation freq offset [Hz]",} |
float | kschemsat_spoilerarea = KSCHEMSAT_DEFAULT_SPOILERAREA with {0, 10000, KSCHEMSAT_DEFAULT_SPOILERAREA, VIS, "Spoiler area",} |
int | kschemsat_ssi_time = KSCHEMSAT_DEFAULT_SSITIME with {10, 20000, KSCHEMSAT_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
KSINV_SEQUENCE | ksinv1 = KSINV_INIT_SEQUENCE |
KSINV_SEQUENCE | ksinv2 = KSINV_INIT_SEQUENCE |
KS_SEQ_CONTROL | ksinv_filltr = KS_INIT_SEQ_CONTROL |
int | ksinv1_ti = 0 |
int | ksinv2_ti = 0 |
int | use_ir1_mode = 0 |
int | use_ir1_t1 = 0 |
int | use_ir2_mode = 0 |
int | use_ir2_t1 = 0 |
float * | ksinv1_mode = NULL |
float * | ksinv2_mode = NULL |
float * | ksinv1_t1value = NULL |
float * | ksinv2_t1value = NULL |
_cvfloat * | _ksinv1_mode = NULL |
_cvfloat * | _ksinv2_mode = NULL |
_cvfloat * | _ksinv1_t1value = NULL |
_cvfloat * | _ksinv2_t1value = NULL |
int | ksinv_ssi_time = KSINV_DEFAULT_SSITIME with {10, 20000, KSINV_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int | ksinv_filltr_ssi_time = KSINV_FILLTR_SSITIME with {10, 20000, KSINV_FILLTR_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int | ksinv_mintr_t2flair = KSINV_MINTR_T2FLAIR with {0, 30s, KSINV_MINTR_T2FLAIR, VIS, "Min TR for T2-FLAIR",} |
int | ksinv_mintr_t1flair = KSINV_MINTR_T1FLAIR with {0, 30s, KSINV_MINTR_T1FLAIR, VIS, "Min TR for T1-FLAIR",} |
int | ksinv_maxtr_t1flair = KSINV_MAXTR_T1FLAIR with {0, 30s, KSINV_MAXTR_T1FLAIR, VIS, "Max TR for T1-FLAIR",} |
int | ksinv_slicecheck = 0 with {0, 1, 0, VIS, "move slice sel to x axis for slice thickness test",} |
int | ksinv_approxti = 1 with {0, 1, 1, VIS, "allow approx. TI for sliceahead IR mode",} |
float | ksinv_flip = KSINV_DEFAULT_FLIP with {0, 360, KSINV_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
float | ksinv_slthickfact = 1.0 with {0, KSINV_MAXTHICKFACT, 1.0, VIS, "Inversion sl.thick / opslthick factor",} |
int | ksinv_rfoffset = 0 with { -10000, 10000, 0, VIS, "RF excitation freq offset [Hz]",} |
int | ksinv_rftype = KSINV_RF_ADIABATIC with {KSINV_RF_STD, KSINV_RF_ADIABATIC, KSINV_RF_ADIABATIC, VIS, "RF type (0:Std 1:Adiabatic)",} |
float | ksinv_spoilerarea = KSINV_DEFAULT_SPOILERAREA with {0, 100000, KSINV_DEFAULT_SPOILERAREA, VIS, "Spoiler area",} |
int | ksinv_startpos = KSINV_DEFAULT_STARTPOS with {16, 10000, KSINV_DEFAULT_STARTPOS, VIS, "Start time of the first grad/RF inversion pulse in sequence module",} |
int | ksinv_t2prep = 0 with {0, 1, 0, VIS, "Use T2 preperation instead of conventional Inversion",} |
int | ksinv_t2prep_exc_flip = 90 with {0, 180, 90, VIS, "Flip angle of the excitation pulse and the flip down/up pulse for T2 prep",} |
int | ksinv_t2prep_N_Refoc = 1 with {1, 16, 1, VIS, "Number of refocusing pulses in the T2 inversion preperation",} |
int | ksinv_t2prep_TE = 100ms with {30ms, 300ms, 100ms, VIS, "TE for T2 inv preperation",} |
int | ksinv_t2prep_rftype_refoc = KSINV_RF_STD with {KSINV_RF_STD, KSINV_RF_ADIABATIC, KSINV_RF_STD, VIS, "RF type (0:Std 1:Adiabatic)",} |
float | ksinv_slthickfact_exc = 1.0 with {0, KSINV_MAXTHICKFACT, 1.0, VIS, "Inversion sl.thick / opslthick factor",} |
KS_MAT4x4 | Mphysical_inversion = KS_MAT4x4_IDENTITY |
KSSPSAT_SEQUENCE | ksspsat [KSSPSAT_MAXNUMSAT] = {KSSPSAT_INIT_SEQUENCE} |
KSSPSAT_PARAMS | ksspsat_params = KSSPSAT_INIT_PARAMS |
int | ksspsat_flag = KSSPSAT_OFF with {KSSPSAT_OFF, KSSPSAT_EXPLICIT, KSSPSAT_OFF, VIS, "flag for ksspsat (0:Off 1:Implicit 2:Explicit)",} |
float | ksspsat_flip = KSSPSAT_DEFAULT_FLIP with {0, 360, KSSPSAT_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
int | ksspsat_rftype = KSSPSAT_RF_COMPLEX with {KSSPSAT_RF_STD, KSSPSAT_RF_COMPLEX, KSSPSAT_RF_COMPLEX, VIS, "0: SLR Sat 1: Complex Sat",} |
float | ksspsat_spoilerscale = KSSPSAT_DEFAULT_SPOILERSCALE with {0.0, 20.0, KSSPSAT_DEFAULT_SPOILERSCALE, VIS, "scaling of spoiler gradient area",} |
int | ksspsat_spoilallaxes = KSSPSAT_DEFAULT_SPOILALLAXES with {0, 1, KSSPSAT_DEFAULT_SPOILALLAXES, VIS, "apply spoiler on all axes",} |
int | ksspsat_ssi_time = KSSPSAT_DEFAULT_SSITIME with {10, 20000, KSSPSAT_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int | ksspsat_debug = 0 with {0, 1, 0, VIS, "KSSpSat debug flag",} |
int | ksspsat_oblmethod = PSD_OBL_RESTRICT with {PSD_OBL_RESTRICT, PSD_OBL_OPTIMAL, PSD_OBL_RESTRICT, VIS, "obl. grad optimization for sat",} |
#define KSCHEMSAT_MODULE_LOADED /* can be used to check whether the KSChemsat module has been included in a main psd */ |
#define KSCHEMSAT_DEFAULT_FLIP 95 |
#define KSCHEMSAT_DEFAULT_SINCRF_BW_15T 150 /* for 1.5T */ |
#define KSCHEMSAT_DEFAULT_SINCRF_BW_3T 300 /* for 3T */ |
#define KSCHEMSAT_DEFAULT_SINCRF_TBP 4 |
#define KSCHEMSAT_DEFAULT_SPOILERAREA 5000 |
#define KSCHEMSAT_DEFAULT_SSITIME 1000 /* try to reduce this value */ |
#define KSCHEMSAT_INIT_PARAMS {KSCHEMSAT_OFF, KSCHEMSAT_DEFAULT_FLIP, 0, KSCHEMSAT_RF_STD, KSCHEMSAT_DEFAULT_SINCRF_BW_3T, KSCHEMSAT_DEFAULT_SINCRF_TBP, KSCHEMSAT_DEFAULT_SPOILERAREA, KSCHEMSAT_DEFAULT_SSITIME} |
#define KSCHEMSAT_INIT_SEQUENCE {{0,0,NULL,sizeof(KSCHEMSAT_SEQUENCE)}, KS_INIT_SEQ_CONTROL, KSCHEMSAT_INIT_PARAMS, KS_INIT_RF, KS_INIT_TRAP} |
#define KSINV_MODULE_LOADED /* can be used to check whether the KSInversion module has been included in a main psd */ |
#define KSINV_DEFAULT_FLIP 180 |
#define KSINV_DEFAULT_SPOILERAREA 5000 |
#define KSINV_DEFAULT_SSITIME 1000 /* try to reduce this value */ |
#define KSINV_DEFAULT_STARTPOS 100 |
#define KSINV_FILLTR_SSITIME 1000 /* try to reduce this value */ |
#define KSINV_MINTR_T2FLAIR 8000000 /* default minTR [us] for T2FLAIR, 8 [s] */ |
#define KSINV_MINTR_T1FLAIR 1300000 /* default minTR [us] for T1FLAIR, 1.3 [s] */ |
#define KSINV_MAXTR_T1FLAIR 2500000 /* default maxTR [us] for T1FLAIR, 2.5 [s] */ |
#define KSINV_MAXTHICKFACT 3.0 /* how much the inversion slice thickness may increase over opslthick */ |
#define KSINV_MAXTHICKFACT_T1FLAIR 1.5 |
#define T1_CSF_3T 4500 |
#define T1_CSF_1_5T 3600 |
#define T1_GM_3T 1400 |
#define T1_GM_1_5T 1100 |
#define T1_WM_3T 750 |
#define T1_WM_1_5T 600 |
#define T1_FAT_3T 340 |
#define T1_FAT_1_5T 260 |
#define KSINV_INIT_PARAMS {KSINV_OFF, KSINV_DEFAULT_FLIP, KS_NOTSET, 0, KSINV_RF_STD, KSINV_DEFAULT_SPOILERAREA, FALSE, KSINV_DEFAULT_STARTPOS, 0, 0, KSINV_DEFAULT_SSITIME, 90, KS_NOTSET, 1, KS_NOTSET, KSINV_RF_STD} |
#define KSINV_INIT_SEQUENCE {{0,0,NULL,sizeof(KSINV_SEQUENCE)}, KS_INIT_SEQ_CONTROL, KSINV_INIT_PARAMS, KS_INIT_SELRF, KS_INIT_TRAP, KS_INIT_SELRF, KS_INIT_SELRF, KS_INIT_SELRF} |
#define KSINV_PIUSE | ( | o1, | |
o2, | |||
o3, | |||
o4 | |||
) |
#define KSINV_OPUSER_VALS | ( | o1, | |
o2, | |||
o3, | |||
o4 | |||
) |
#define KSINV_OPUSER_STRUCTS | ( | o1, | |
o2, | |||
o3, | |||
o4 | |||
) |
#define KSINV_EVAL | ( | sptr, | |
o1, | |||
o2, | |||
o3, | |||
o4 | |||
) |
[in,out] | sptr | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in] | o1 | A number (not a variable) between 0 and 35 corresponding to the first UserCV used |
[in] | o2 | A number (not a variable) between 0 and 35 corresponding to the second UserCV used |
[in] | o3 | A number (not a variable) between 0 and 35 corresponding to the third UserCV used |
[in] | o4 | A number (not a variable) between 0 and 35 corresponding to the fourth UserCV used |
#define KSINV_EVAL_CUSTOMRF | ( | sptr, | |
rfptr, | |||
o1, | |||
o2, | |||
o3, | |||
o4 | |||
) |
#define KSSPSAT_MODULE_LOADED /* can be used to check whether the KSSpsat module has been included in a main psd */ |
#define KSSPSAT_DEFAULT_FLIP 95 |
#define KSSPSAT_DEFAULT_SPOILERSCALE 5.0 |
#define KSSPSAT_DEFAULT_SPOILALLAXES 1 |
#define KSSPSAT_DEFAULT_SSITIME 1000 /* try to reduce this value */ |
#define KSSPSAT_EXPLICITSAT_DISABLED 9990.0 /* Set by UI on MR-scanner */ |
#define KSSPSAT_IMPLICITSAT_DISABLED 9999.0 /* Set by UI on MR-scanner */ |
#define KSSPSAT_INIT_VOLBORDER {0.0, 0.0, 0.0, 0.0, 0.0, 0.0} |
#define KSSPSAT_INIT_LOC {DEFAULT_AXIAL_SCAN_INFO, 0, KS_NOTSET, KSSPSAT_OFF} |
#define KSSPSAT_INIT_PARAMS {KSSPSAT_INIT_VOLBORDER, KSSPSAT_DEFAULT_FLIP, KSSPSAT_RF_COMPLEX, KSSPSAT_DEFAULT_SPOILERSCALE, KSSPSAT_DEFAULT_SPOILALLAXES, PSD_OBL_RESTRICT, KSSPSAT_DEFAULT_SSITIME} |
#define KSSPSAT_INIT_SEQUENCE {{0,0,NULL,sizeof(KSSPSAT_SEQUENCE)}, KS_INIT_SEQ_CONTROL, KSSPSAT_INIT_LOC, KS_INIT_SELRF} |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
enum KSINV_LOOP_MODE |
Enumerator | |
---|---|
KSINV_LOOP_NORMAL | |
KSINV_LOOP_DUMMY | |
KSINV_LOOP_SLICEAHEAD_FIRST | |
KSINV_LOOP_SLICEAHEAD_LAST |
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
STATUS kschemsat_pg | ( | KSCHEMSAT_SEQUENCE * | kschemsat | ) |
This is the fatsat sequence module in kschemsat.e using the sequence objects in KSCHEMSAT_SEQUENCE with the sequence module name "kschemsat" (= kschemsat.seqctrl.description). On HOST, the minimum duration of the sequence module is set by ks_eval_seqctrl_setminduration().
[in,out] | kschemsat | Pointer to KSCHEMSAT_SEQUENCE |
STATUS | SUCCESS or FAILURE |
void kschemsat_init_params | ( | KSCHEMSAT_PARAMS * | params | ) |
[out] | params | Pointer to the kschemsat params struct used to steer the behavior of this fatsat sequence module |
void kschemsat_init_sequence | ( | KSCHEMSAT_SEQUENCE * | kschemsat | ) |
As KSCHEMSAT_INIT_SEQUENCE contains KSCHEMSAT_PARAMS, which sets the field .satmode = KSCHEMSAT_OFF
, calling kschemsat_init_sequence() will disable the kschemsat
sequence module (i.e. turn off fatsat)
[out] | kschemsat | Pointer to KSCHEMSAT_SEQUENCE |
void kschemsat_eval_copycvs | ( | KSCHEMSAT_PARAMS * | params | ) |
[out] | params | Pointer to the kschemsat params struct used to steer the behavior of this fatsat sequence module |
STATUS kschemsat_eval_setupobjects | ( | KSCHEMSAT_SEQUENCE * | kschemsat | ) |
This fatsat sequence module consists of an RF pulse (selectable via .params.rftype
and a spoiler trapezoid gradient.
[in,out] | kschemsat | Pointer to KSCHEMSAT_SEQUENCE |
STATUS | SUCCESS or FAILURE |
STATUS kschemsat_eval | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
This function calls kschemsat_eval_setupobjects() to design the RF pulse and spoiler for this fatsat sequence module. It then calls kschemsat_pg() to determine the (minimum) sequence module duration. Finally, the sequence module kschemsat
is added to the sequence collection struct passed in from the cveval() function of the main sequence.
[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
STATUS | SUCCESS or FAILURE |
void kschemsat_scan_seqstate | ( | KSCHEMSAT_SEQUENCE * | kschemsat | ) |
This function sets the current state of all kschemsat sequence objects being part of KSCHEMSAT_SEQUENCE, incl. gradient amplitude and RF phase changes.
The idea of having a 'seqstate' function is to be able to come back to a certain sequence state at any time and possibly play it out once more.
STATUS ksinv_eval_checkTR_SAR | ( | KS_SEQ_COLLECTION * | seqcollection, |
KS_SLICE_PLAN * | slice_plan, | ||
int(*)(const SCAN_INFO *, int, int, void **) | play_coreslice, | ||
int | core_nargs, | ||
void ** | core_args | ||
) |
This function first makes sure that the .nseqinstances
field for each sequence module in the sequence collection corresponds to the number of times played out in ksinv_scan_sliceloop()
In simulation (WTools), ks_print_seqcollection() will print out a table of the sequence modules in the sequence collection in the WToolsMgd window.
Finally, GEReq_eval_checkTR_SAR_calcs() is called to check that the TR is correct and within SAR/hardware limits.
N.B.: For non-inversion sequences, ks_eval_checkTR_SAR() is used to do the same thing, with the difference that the psd's sliceloop function is used instead of ksinv_scan_sliceloop().
[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in] | slice_plan | Pointer to the KS_SLICE_PLAN struct holding the slice order information |
[in] | play_coreslice | Function pointer to (the wrapper function to) the coreslice function of the sequence |
[in] | core_nargs | Number of extra input arguments to the coreslice wrapper function. |
[in] | core_args | Void pointer array pointing to the variables containing the actual values needed for the sequence's coreslice function |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_pg | ( | KSINV_SEQUENCE * | ksinv | ) |
Two KSINV_SEQUENCE structs are currently declared in KSInversion.e, ksinv1
and ksinv2
. By passing each one of them to this function, will generate the actual sequence on TGT. On HOST, the seqctrl.min_duration
field is set and used by TI/TR calculations.
STATUS | SUCCESS or FAILURE |
int ksinv_scan_sliceloop | ( | const KS_SLICE_PLAN * | slice_plan, |
const SCAN_INFO * | slice_positions, | ||
int | passindx, | ||
KSINV_SEQUENCE * | ksinv1, | ||
KSINV_SEQUENCE * | ksinv2, | ||
KS_SEQ_CONTROL * | ksinv_filltr, | ||
KSINV_LOOP_MODE | ksinv_loop_mode, | ||
int(*)(const SCAN_INFO *, int, int, void **) | play_coreslice, | ||
int | core_nargs, | ||
void ** | core_args | ||
) |
slice_plan.nslices_per_pass
slices corresponding to one TR for inversion psdsThis function should replace the sliceloop function of a 2D psd when inversion is enabled. It will take over the sequence timing for one TR by playing out the inversion sequence module(s) and other sequence modules in an order that is subject to the inversion mode (ksinvX.params.irmode
). The non-inversion sequence modules should be played out together in a 'core slice' function of the psd. This core slice function should have a wrapper function with standardized input arguments that conmplies with the function pointer (and core_nargs, core_args) passed to this function.
[in] | slice_plan | Pointer to the slice plan (KS_SLICE_PLAN) set up earlier using ks_calc_sliceplan() or similar |
[in] | slice_positions | Pointer to the SCAN_INFO array corresponding to the slice locations (typically ks_scan_info ) |
[in] | passindx | Pass index in range [0, ks_slice_plan.npasses - 1] |
[in] | ksinv1 | Pointer to KSINV_SEQUENCE corresponding to the 1st (or only) inversion. Cannot be NULL |
[in] | ksinv2 | Pointer to KSINV_SEQUENCE corresponding to an optional 2nd inversion. May be NULL |
[in] | ksinv_filltr | Pointer to KS_SEQ_CONTROL for fillTR sequence for FLAIR block modes. May be NULL |
[in] | ksinv_loop_mode | If KSINV_LOOP_DUMMY, this function will pass in KS_NOTSET (-1) as the 2nd argument to 'play_coreslice'. For this to work, the play_coreslice() function (usually the main sequence's coreslice), must check if it's 2nd arg is KS_NOTSET, and if so shut off data collection in loaddab() KSINV_LOOP_NORMAL: Slice excitation ON, Data acq. ON KSINV_LOOP_DUMMY: Slice excitation ON, Data acq. OFF KSINV_LOOP_SLICEAHEAD_FIRST: Slice excitation ON for IR, OFF for coreslice, Data acq. OFF KSINV_LOOP_SLICEAHEAD_LAST: Slice excitation OFF for IR, ON for coreslice, Data acq. ON |
[in] | play_coreslice | Function pointer to (the wrapper function to) the coreslice function of the sequence |
[in] | core_nargs | Number of extra input arguments to the coreslice wrapper function. |
[in] | core_args | Void pointer array pointing to the variables containing the actual values needed for the sequence's coreslice function |
slicelooptime | Time taken in [us] to play out slice_plan.nslices_per_pass slices |
void ksinv_init_params | ( | KSINV_PARAMS * | params | ) |
[out] | params | Pointer to the ksinv params struct used to steer the behavior of this inversion sequence module |
void ksinv_init_sequence | ( | KSINV_SEQUENCE * | ksinv | ) |
As KSINV_INIT_SEQUENCE contains KSINV_PARAMS, which sets the field .irmode = KSINV_OFF
, calling ksinv_init_sequence() will disable the ksinversion
sequence module (i.e. turn off inversion)
[out] | ksinv | Pointer to KSINV_SEQUENCE |
void ksinv_eval_copycvs | ( | KSINV_PARAMS * | params, |
int | mode | ||
) |
[out] | params | Pointer to the ksinv params struct used to steer the behavior of this inversion sequence module |
[in] | mode | Inversion mode, one of: KSINV_OFF, KSINV_IR_SIMPLE, KSINV_IR_SLICEAHEAD, KSINV_FLAIR_BLOCK |
STATUS ksinv_eval_setuprf | ( | KSINV_SEQUENCE * | ksinv, |
const char * | suffix, | ||
KS_SELRF * | custom_selrf | ||
) |
This function is called from ksinv_eval_setupobjects()
[in,out] | ksinv | Pointer to a KSINV_SEQUENCE sequence module to be set up |
[in] | suffix | Suffix string to att to "ksinv" for the description of the sequence module |
[in,out] | custom_selrf | Optional pointer to KS_SELRF for custom inversion RF pulse. Pass NULL to use default RF pulses. |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval_setupt2prep | ( | KSINV_SEQUENCE * | ksinv | ) |
STATUS ksinv_eval_setupobjects | ( | KSINV_SEQUENCE * | ksinv, |
const char * | suffix, | ||
KS_SELRF * | custom_selrf | ||
) |
KSInversion.e has two inversion sequence modules, ksinv1
and ksinv2
, the latter only active for dual-IR. These are both declared in @ipgexport
in KSInversion.e.
This function takes one of these sequence modules as first input argument (called from ksinv_eval()) and sets up the sequence objects in that KSINV_SEQUENCE, with suffix
as the unique suffix name for the sequence module (currently "1" and "2" in ksinv_eval()).
[in,out] | ksinv | Pointer to a KSINV_SEQUENCE sequence module to be set up |
[in] | suffix | Suffix string to att to "ksinv" for the description of the sequence module |
[in,out] | custom_selrf | Optional pointer to KS_SELRF for custom inversion RF pulse. Pass NULL to use default RF pulses. |
STATUS | SUCCESS or FAILURE |
int ksinv_eval_nullti | ( | int | TR, |
int | T1value, | ||
int | seqdur | ||
) |
[in] | TR | Repetition time in [us] |
[in] | T1value | The T1 value of the tissue to be nulled in [us] |
[in] | seqdur | The duration of the main sequence in [us] |
TItime | Inversion time in [us] |
STATUS ksinv_eval_duration | ( | KSINV_SEQUENCE * | ksinv, |
int | TI, | ||
int | coreslice_momentstart | ||
) |
For simple main sequences consisting of only one sequence module each time it is played out (i.e. without additional fatsat or spatial sat sequences attached before each main sequence), coreslice_momentstart
is typically a small value of a few [ms] indicating the isocenter of the excitation pulse of the main sequence measured from the start of the main sequence. When e.g. a fatsat pulse sequence module is added before each main sequence module, this needs to be taken into account to get the correct inversion time. In these cases coreslice_momentstart
should be larger (to also include any leading extra sequence module between the inversion module and the main sequence module, and consequently the duration of the inversion module becomes proportionally smaller. If TI
is short in relation to coreslice_momentstart
this function will return an error.
[in,out] | ksinv | Pointer to a KSINV_SEQUENCE sequence module |
[in] | TI | Desired inversion time in [us] |
[in] | coreslice_momentstart | The delay time from the end of the inversion module to the isocenter of the excitation pulse of the main sequence |
TItime | Inversion time in [us] |
STATUS ksinv_eval_duration_t1value | ( | KSINV_SEQUENCE * | ksinv, |
int * | TR, | ||
int * | TI, | ||
int | approxti_flag, | ||
int | coreslice_momentstart, | ||
int | coreslice_duration, | ||
int | mainseq_mindur, | ||
int | T1value_toNull, | ||
int | slperpass | ||
) |
This function enables the slice-ahead inversion mode, where the duration of the sequence module is determined while iteratively finding TI and TR, based on the duration and momentstart of the core slice playout. One 'core slice' consists of the main sequence and all other sequence modules played out every time with the main sequence directly before or after, e.g. [FatSat]-[SpatialSat]-[Mainsequence].
Optionally, one can pass in an approxti_flag
. If FALSE (= 0)
, then the inversion module duration is set to meet exactly the TI that will null a tissue with a T1-value of T1value_toNull
. As with any IR module, the minimum duration (ksinv.seqctrl.min_duration) given by the RF pulse and spoiler is very short in comparison to the actual duration (
ksinv.seqctrl.duration) since TI >> min_duration.
This function reduces the duration significantly by playing the IR module several slices ahead of the main sequence slice. This reduces the ksinv sequence module duration by one or more whole units of coreslice_duration
, while still magnetically maintaining the inversion time (TI). The number of slices that the inversion module should be played out ahead of the main sequence is stored in ksinv.params.nslicesahead. Now, if approxti_flag = TRUE
, the duration of this ksinv sequence module will be set to its minimum (ksinv.seqctrl.min_duration
), and TI will be approximated to a whole number of coreslice_duration
. This works best for long T1value_toNull
and reasonably short coreslice_duration
as the percent error in TI will be low. With approxti_flag = TRUE
the scan time will be significantly reduced in general.
As this function estimates the optimal TR and TI iteratively, AutoTR and AutoTI modes must be used when calling this function. Typically T1-FLAIR uses slice-ahead IR, but STIR should also be more efficient compared to a simple IR approach. See also ksinv_eval_multislice().
[in,out] | ksinv | Pointer to KSINV_SEQUENCE sequence module to set up |
[out] | TR | Pointer to the repetition time (TR) resulting from the interative search in [us] |
[out] | TI | Pointer to the inversion time (TI) resulting from the interative search in [us] |
[in] | approxti_flag | 0: Make TI exact 1: Make TI approximate (shorter scan time in general) |
[in] | coreslice_momentstart | Time between the end of the inversion module and the moment start of the main sequence. |
[in] | coreslice_duration | Duration of the 'core slice' (main sequence + other attached sequence modules) |
[in] | mainseq_mindur | Minimum duration of just the main sequence (used by ksinv_eval_nullti()) |
[in] | T1value_toNull | T1 value to null in [us] |
[in] | slperpass | Number of slices to play out in one pass (acquisition) |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval_duration_flairblock | ( | KSINV_SEQUENCE * | ksinv, |
int | TI, | ||
int | coreslice_momentstart, | ||
int | coreslice_duration, | ||
int | slperpass | ||
) |
This function sets the duration for an KSINV_SEQUENCE module in a FLAIR block design, where ksinv.params.nflairslices
number of inversion pulses are played first (at different slice locations) followed by equally many 'core slice' playouts (main sequence + optional other sequence modules attached to the main sequence).
The maximum number of FLAIR slices is capped by slperpass
, which is the maximum number of slices to fit in one TR. As each inversion module must be as long as the coreslice_duration
in a FLAIR block design, the integer number of flair slices (ksinv.params.nflairslices
) rarely fit exactly in the desired TI time, why the duration of the inversion modules are increased to exactly fit this available time. This means that after calling this function, one must make sure that the duration of the main sequence is also increased accordingly. This is done in ksinv_eval_multislice().
[in,out] | ksinv | Pointer to KSINV_SEQUENCE sequence module to set up |
[in] | TI | The inversion time (TI) resulting from the interative search in [us] |
[in] | coreslice_momentstart | Time between the end of closest inversion module and the moment start of the main sequence. |
[in] | coreslice_duration | Duration of the coreslice (main sequence + other attached sequence modules) |
[in] | slperpass | Number of slices to play out in one pass (acquisition) |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval_setfilltr | ( | KS_SEQ_CONTROL * | filltr, |
const char *const | desc, | ||
int | duration | ||
) |
In ksinv_eval_duration_flairblock(), ksinv.params.nflairslices
number of inversion pulses are played out before equally many main sequence playouts. This time corresponds to: 2 * ksinv.params.nflairslices * coreslice_duration
If TR is set manually (AutoTR off), this filltr wait sequence module is set to fill up the time to the desired TR. When ksinv.params.nflairslices <= number of slices per pass, two or more FLAIR-blocks will be played out in ksinv_scan_sliceloop(), where each block will end with this wait sequence. Therefore, the duration of this wait sequence will be reduced in time if used more than once in each slice loop, to keep the same total wait duration given by: filltr duration = TR - N * (2 * ksinv.params.nflairslices * coreslice_duration
, where N is an integer >= 1.
If the duration is zero, the description will be ignored and set to "fillTR_disabled".
[in,out] | filltr | Pointer to the KS_SEQ_CONTROL for the fillTR wait sequence |
[in] | desc | Description of the wait sequence |
[in] | duration | Duration of the wait sequence |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_init_UI | ( | ) |
Pre-DV26:
DV26+: UI buttons have been moved from column 2 (under FastSpinEcho/SSFSE) to column 3 (imaging options)
To be compatible with previous releases, this function sets the legacy opflair CV to the correct value, so that (for now) sequences using KSInversion.e can continue to use opflair despite the DV26 UI change.
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval_UI | ( | ) |
The inversion mode(s) is initially dependent on the UI selections: T2-FLAIR, T1-FLAIR, IR-prep. Only 2D+Fast-SpinEcho enables the T2-FLAIR and T1-FLAIR buttons, but 2D+EchoPlanar enables a FLAIR-EPI button, which is the same thing as T2-FLAIR.
If the T2-FLAIR button is selected, opflair = OPFLAIR_GROUP
, resulting in a FLAIR-block design (ksinv1.params.mode = KSINV_FLAIR_BLOCK
).
If the T1-FLAIR button is selected, opflair = OPFLAIR_INTERLEAVED
, resulting in a slice-ahead inversion mode (ksinv1.params.mode = KSINV_IR_SLICEAHEAD
).
In T2-FLAIR and T1-FLAIR modes, only the first of the four UserCVs reserved by KSINV_EVAL() is shown.
For custom IR control, using simple IR or dual IR (in simple or sliceahead modes), opflair should be 0 and opirprep should be 1. For FSE (ksfse.e), this advanced mode is set by selecting FSE-IR. For EPI (ksepi.e), this mode is set by selecting SE-EPI, GE-EPI or DW-EPI and then selecting IRprep.
This function is used to set up inversion for 2D sequences and is not suited for future 3D psd support.
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval | ( | KS_SEQ_COLLECTION * | seqcollection, |
KS_SELRF * | custom_selrf | ||
) |
[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in,out] | custom_selrf | Optional pointer to KS_SELRF for custom inversion RF pulse. Pass NULL to use default RF pulses. |
STATUS | SUCCESS or FAILURE |
int ksinv_eval_mintr | ( | const KS_SLICE_PLAN * | slice_plan, |
KS_SEQ_COLLECTION * | seqcollection, | ||
float | gheatfact, | ||
KSINV_SEQUENCE * | ksinv1, | ||
KSINV_SEQUENCE * | ksinv2, | ||
KS_SEQ_CONTROL * | ksinv_filltr, | ||
int(*)(const SCAN_INFO *, int, int, void **) | play_coreslice, | ||
int | core_nargs, | ||
void ** | core_args | ||
) |
Given the current durations of the sequence modules involved in the ksinv_scan_sliceloop(), this function calculates the minimum TR, accounting also for SAR and hardware limits.
This function expects a pointer to a scan function playing out one coreslice
. The coreslice
should play out the main sequence once (i.e. one slice), but the coreslice function may also play optional other sequence modules that should always be played together with the main sequence (e.g. fatsat).
As the number of arguments to the sequence's coreslice is psd-dependent, the function pointer play_coreslice
must be a wrapper function to the coreslice function taking standardized input arguments (int) core_nargs
and (void **) core_args
. This coreslice wrapper function must be on the form: int coreslice_nargs(SCAN_INFO *, int storeslice, int core_nargs, void **core_args);
If the coreslice function does not need any additional input arguments, core_nargs = 0
, and core_args = NULL
.
With this function pointer, ksinv_scan_sliceloop() can replace the sequence (non-inversion) sliceloop function, and play out the inversion module(s) and the sequence module(s) in the coreslice function.
After resetting the seqctrl.nseqinstances
for all sequence modules in the sequence collection, ksinv_scan_sliceloop() is called once to increment seqctrl.nseqinstances
by 1 for every time each sequence modules is played out. With this updated information, seqcollection
is passed to ks_eval_gradrflimits(), which will calculate the total duration and add additional time for SAR/hardware limits. This time is the return value of ksinv_eval_mintr().
[in] | slice_plan | Pointer to the KS_SLICE_PLAN struct holding the slice order information |
[in] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in] | gheatfact | Value in range [0,1] denoting how much the gradient heating limits should be honored (0:none, 1:full) |
[in] | ksinv1 | Pointer to KSINV_SEQUENCE corresponding to the 1st (or only) inversion. Cannot be NULL |
[in] | ksinv2 | Pointer to KSINV_SEQUENCE corresponding to an optional 2nd inversion. May be NULL |
[in] | ksinv_filltr | Pointer to KS_SEQ_CONTROL for fillTR sequence for FLAIR block modes. May be NULL |
[in] | play_coreslice | Function pointer to (the wrapper function to) the coreslice function of the sequence |
[in] | core_nargs | Number of extra input arguments to the coreslice wrapper function. |
[in] | core_args | Void pointer array pointing to the variables containing the actual values needed for the sequence's coreslice function |
minTR | Minimum TR for ksinv_scan_sliceloop() honoring SAR and hardware limits |
int ksinv_eval_maxslicespertr | ( | int | TR, |
KS_SLICE_PLAN | temp_slice_plan, | ||
KS_SEQ_COLLECTION * | seqcollection, | ||
float | gheatfact, | ||
KSINV_SEQUENCE * | ksinv1, | ||
KSINV_SEQUENCE * | ksinv2, | ||
KS_SEQ_CONTROL * | ksinv_filltr, | ||
int(*)(const SCAN_INFO *, int, int, void **) | play_coreslice, | ||
int | core_nargs, | ||
void ** | core_args | ||
) |
[in] | TR | Repetition time in [us] |
[in] | temp_slice_plan | Pointer to the KS_SLICE_PLAN struct holding the slice order information |
[in] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in] | gheatfact | Value in range [0,1] denoting how much the gradient heating limits should be honored (0:none, 1:full) |
[in] | ksinv1 | Pointer to KSINV_SEQUENCE corresponding to the 1st (or only) inversion. Cannot be NULL |
[in] | ksinv2 | Pointer to KSINV_SEQUENCE corresponding to an optional 2nd inversion. May be NULL |
[in] | ksinv_filltr | Pointer to KS_SEQ_CONTROL for fillTR sequence for FLAIR block modes. May be NULL |
[in] | play_coreslice | Function pointer to (the wrapper function to) the coreslice function of the sequence |
[in] | core_nargs | Number of extra input arguments to the coreslice wrapper function. |
[in] | core_args | Void pointer array pointing to the variables containing the actual values needed for the sequence's coreslice function |
MaxSlicesPerTR | Maximum slices that can fit in the specified TR, honoring SAR and hardware limits |
STATUS ksinv_eval_flairblock | ( | KSINV_SEQUENCE * | ksinv, |
int * | filltr_time, | ||
int * | repetition_time, | ||
int * | inversion_time, | ||
int | autotr_flag, | ||
int | T1tonull, | ||
int | coreslice_momentstart, | ||
int | coreslice_duration, | ||
int | slperpass | ||
) |
[in,out] | ksinv | Pointer to KSINV_SEQUENCE. ksinv.params.irmode must be KSINV_FLAIR_BLOCK and ksinv.seqctrl.min_duration and ksinv.seqctrl.momentstart both > 0. |
[out] | filltr_time | The time that needs to be added after all slices played out to fill up to the manual TR |
[in,out] | repetition_time | Pointer to the repetition time [us]. If autotr_flag = TRUE, this value will be set and returned as TR to the calling function. If autotr_flag = FALSE, 'repetition_time' will be used as TR here |
[in,out] | inversion_time | Pointer to the inversion time [us]. If 'T1tonull' > 0, this value will be set and returned as TI to the calling function. If 'T1tonull' = 0, 'inversion_time' will be used as TI here |
[in] | autotr_flag | TRUE/FALSE flag for autoTR. If TRUE, 'repetition_time' will be updated |
[in] | T1tonull | T1-value to null. 0: Off (value of 'inversion_time' is used. >0: Use this T1-value to calculate the TI value and update and return 'inversion_time' |
[in] | coreslice_momentstart | Time between the end of closest inversion module and the moment start of the main sequence. |
[in] | coreslice_duration | Duration of the coreslice (main sequence + other attached sequence modules) |
[in] | slperpass | Number of slices to play out in one pass (acquisition) |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_eval_flairblock_withmainupdate | ( | KSINV_SEQUENCE * | ksinv, |
KS_SEQ_CONTROL * | ksinv_filltr, | ||
KS_SEQ_CONTROL * | mainseqctrl, | ||
int * | repetition_time, | ||
int * | inversion_time, | ||
int | autotr_flag, | ||
int | T1tonull, | ||
int | coreslice_momentstart, | ||
int | coreslice_duration, | ||
int | slperpass | ||
) |
STATUS ksinv_eval_multislice | ( | KS_SEQ_COLLECTION * | seqcollection, |
KS_SLICE_PLAN * | slice_plan, | ||
int(*)(const SCAN_INFO *, int, int, void **) | play_coreslice, | ||
int | core_nargs, | ||
void ** | core_args, | ||
KS_SEQ_CONTROL * | mainseqctrl | ||
) |
This function is to be used by a 2D psd to set the inversion duration(s) for ksinv1
and possibly ksinv2
(dual IR). Before calling this function, the ksinv->params.irmode
(and ksinv2.params.irmode
) must be set to steer which type of inversion that should be performed. Here follows the inversion modes supported by this function:
Single inversion (ksinv2.params.irmode = KSINV_OFF
):
ksinv1.params.irmode = KSINV_FLAIR_BLOCK
:ksinv1.params.irmode = KSINV_IR_SIMPLE
and manual TR (opautotr = FALSE
):ksinv1.params.irmode = KSINV_IR_SLICEAHEAD
or ksinv1.params.irmode = KSINV_IR_SIMPLE
and (opautotr = TRUE
)Dual inversion:
ksinv1.params.irmode = KSINV_IR_SIMPLE
and ksinv2.params.irmode = KSINV_IR_SIMPLE
ksinv1.params.irmode = KSINV_IR_SLICEAHEAD
and ksinv2.params.irmode = KSINV_IR_SIMPLE
ksinv1.params.irmode = KSINV_FLAIR_BLOCK
and ksinv2.params.irmode = KSINV_IR_SIMPLE
ksinv1.params.irmode = KSINV_IR_SLICEAHEAD
and ksinv2.params.irmode = KSINV_IR_SLICEAHEAD
. TI1 (opti) will be approximated[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
[in] | slice_plan | Pointer to the KS_SLICE_PLAN struct holding the slice order information |
[in] | play_coreslice | Function pointer to (the wrapper function to) the coreslice function of the sequence |
[in] | core_nargs | Number of extra input arguments to the coreslice wrapper function. |
[in] | core_args | Void pointer array pointing to the variables containing the actual values needed for the sequence's coreslice function |
[in] | mainseqctrl | Pointer to the KS_SEQ_CONTROL struct for the main sequence |
MaxSlicesPerTR | Maximum slices that can fit in the specified TR, honoring SAR and hardware limits |
STATUS ksinv_check | ( | ) |
STATUS | SUCCESS or FAILURE |
STATUS ksinv_predownload_setrecon | ( | ) |
STATUS | SUCCESS or FAILURE |
void ksinv_pulsegen | ( | ) |
This function should be called directly from the pulsegen()
function in a psd to create up to three sequence modules that can be used during scan.
N.B.: If ksinvX.seqctrl.duration = 0, both ksinv_pg() and KS_SEQLENGTH() will return early avoiding this sequence module to be created. Similarly for the seqInvFillTR wait sequence.
STATUS ksinv_scan_seqstate | ( | KSINV_SEQUENCE * | ksinv, |
const SCAN_INFO * | slice_info | ||
) |
This function sets the current state of all ksinv
sequence objects being part of KSINV_SEQUENCE, specifically slice-dependent RF freq/phases changes.
The idea of having a 'seqstate' function is to be able to come back to a certain sequence state at any time and possibly play it out once more. This could for example be useful when certain lines or slices need to be rescanned due to image artifacts detected during scanning.
[in] | ksinv | Pointer to KSINV_SEQUENCE |
[in] | slice_info | Pointer to position of the slice to be played out (one element in the ks_scan_info[] array) |
STATUS | SUCCESS or FAILURE |
int ksinv_scan_irslice | ( | KSINV_SEQUENCE * | ksinv, |
const SCAN_INFO * | slice_pos | ||
) |
On TGT on the MR system (PSD_HW), this function sets up (ksepi_scan_seqstate()) and plays out one KSINV_SEQUENCE. The low-level function call startseq()
, which actually starts the realtime sequence playout is called from within ks_scan_playsequence(), which in addition also returns the time to play out that sequence module (see time += ...).
On HOST (in ksepi_eval_tr()) we call ksepi_scan_sliceloop_nargs(), which in turn calls this function that returns the total time in [us] taken to play out this core slice. These times are increasing in each parent function until ultimately ksepi_scan_scantime(), which returns the total time of the entire scan.
[in] | ksinv | Pointer to KSINV_SEQUENCE |
[in] | slice_pos | Pointer to position of the slice to be played out (one element in the ks_scan_info[] array) |
irtime | Time taken in [us] to play out one inversion slice |
int ksinv_scan_sliceloop_nargs | ( | int | slperpass, |
int | nargs, | ||
void ** | args | ||
) |
STATUS ksspsat_pg | ( | KSSPSAT_SEQUENCE * | ksspsat | ) |
This is the spatial sat sequence module in ksspsat.e using the sequence objects in KSSPSAT_SEQUENCE with the sequence module name "ksspsat" (= ksspsat.seqctrl.description). On HOST, the minimum duration of the sequence module is set by ks_eval_seqctrl_setminduration().
void ksspsat_scan_seqstate | ( | KSSPSAT_SEQUENCE * | ksspsat, |
float | rfphase | ||
) |
This function sets the current state of all ksspsat sequence objects being part of KSSPSAT_SEQUENCE, incl. gradient amplitude changes, RF freq/phase for the current slice position.
The idea of having a 'seqstate' function is to be able to come back to a certain sequence state at any time and possibly play it out once more.
void ksspsat_init_params | ( | KSSPSAT_PARAMS * | params | ) |
[out] | params | Pointer to the ksspsat params struct used to steer the behavior of this spsat sequence module |
void ksspsat_init_sequence | ( | KSSPSAT_SEQUENCE * | ksspsat | ) |
As KSSPSAT_INIT_SEQUENCE contains KSSPSAT_PARAMS, which sets the field .satmode = KSSPSAT_OFF
, calling ksspsat_init_sequence() will disable the ksspsat
sequence module (i.e. turn off spsat)
[out] | ksspsat | Pointer to KSSPSAT_SEQUENCE |
void ksspsat_eval_copycvs | ( | KSSPSAT_PARAMS * | params | ) |
[out] | params | Pointer to the ksspsat params struct used to steer the behavior of this spsat sequence module |
int ksspsat_eval_numsats | ( | KSSPSAT_SEQUENCE * | ksspsat | ) |
This function returns the number of graphical saturation pulses that have been explicitly placed out in the UI by the user. This includes both implicit and explicit sat bands. Implicit sat bands occur when the user selects a sat edge (S,I,A,P,R,L) of the FOV but does not click on the localizer image. Implicit sat bands are parallel to the logical axes and do not need a unique rotation matrix, and which FOV side to saturate is determined by the logical gradient axis choice (XGRAD, YGRAD, ZGRAD).
[in] | ksspsat | Pointer to KSSPSAT_SEQUENCE |
STATUS ksspsat_eval_volborder | ( | KSSPSAT_VOLBORDER * | v | ) |
[out] | v | Pointer to the KSSPSAT_VOLBORDER struct holding this information |
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_eval_satplacements_from_UI | ( | KSSPSAT_SEQUENCE * | ksspsat, |
KSSPSAT_PARAMS * | params | ||
) |
satlocation
field of the KSSPSAT_PARAMS structThis function gets information from the UI regarding the sat pulses, whether they are implicit or explicit, their thickness and offset, and for explicit pulses also the rotation matrix.
The user can select up to 6 sat band in total in the UI, which may be only implicit or explicit, or a mix of both. First, information on the implicit sat pulses is collected by checking for the CVs opsatx
etc. (managed by the host interface, i.e. the UI). The UI maps opsatx
to frequency encoding (despite that the sat is expressed in patient terms: Superior, Inferior, etc.), and correspondingly opsaty
maps to the phase encoding direction and opsatz
to the slice direction.
When two oppositely placed implicit sat bands have different thickness, opsatx
(and opsaty
/opsatz
) is set to KSSPSAT_PARA (4), indicating that two separate RF pulses should be played out. When two oppositely placed implicit sat bands have the same thickness, opsatx
= KSSPSAT_HAD (3), which is an indication for that a single hadamard RF pulse should be used to saturate both sides. This is not yet supported, so for now both KSSPSAT_HAD and KSSPSAT_PARA will result in two separate RF pulses.
If the user selects one of the sat band buttons (S,I,A,P,R,L), and then also clicks on the localizer image, the implicit sat (one of S,I,A,P,R,L) is now replaced with an explicit sat. The UI sets then the corresponding opsatx/y/z
to 0, and sets instead one of the bits in the bitmask CV opexsatmask
.
Explicit sat bands receives the rotation information from the transpose of eg_sat_rot
instead of the scan_info
struct, slice selection is always ZGRAD, the thickness is taken from opexsatthick1-6
, and the slice offset from opexsatloc1-6
.
[in,out] | ksspsat | Pointer to KSSPSAT_SEQUENCE |
[in] | params | Pointer to the ksspsat params struct used to steer the behavior of this spsat sequence module |
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_eval_satplacements_dump | ( | KSSPSAT_SEQUENCE * | ksspsat, |
KSSPSAT_PARAMS * | params | ||
) |
spsat.txt
On the MR system (PSD_HW), this file will be located in /usr/g/mrraw
, while in simulation it will be located in the current psd directory.
[in] | ksspsat | Pointer to KSSPSAT_SEQUENCE |
[in] | params | Pointer to the ksspsat params struct used to steer the behavior of this spsat sequence module |
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_eval_loggrd | ( | LOG_GRAD * | satloggrd, |
SCAN_INFO * | slice_info, | ||
int | satoblmethod | ||
) |
[out] | satloggrd | Pointer to LOG_GRAD |
[in] | slice_info | Pointer to SCAN_INFO, holding rotation information about current sat slice |
[in] | satoblmethod | PSD_OBL_RESTRICT or PSD_OBL_OPTIMAL |
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_eval_setupobjects | ( | ) |
This spatial sat sequence module consists of an RF pulse (selectable via ksspsat_params.rftype
.
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_eval | ( | KS_SEQ_COLLECTION * | seqcollection | ) |
This function calls ksspsat_eval_setupobjects() to design the RF pulse and spoiler for this spatial sat sequence module. It then calls ksspsat_pg() to determine the (minimum) sequence module duration. Finally, the sequence module ksspsat
is added to the sequence collection struct passed in from the cveval() function of the main sequence.
[in,out] | seqcollection | Pointer to the KS_SEQ_COLLECTION struct holding all sequence modules |
STATUS | SUCCESS or FAILURE |
STATUS ksspsat_pulsegen | ( | ) |
int ksspsat_scan_playsequences | ( | int | perform_slicetimeplot | ) |
KSCHEMSAT_SEQUENCE kschemsat = KSCHEMSAT_INIT_SEQUENCE |
int kschemsat_flag = KSCHEMSAT_OFF with {KSCHEMSAT_OFF, KSCHEMSAT_WATER, KSCHEMSAT_OFF, VIS, "flag for kschemsat (0:Off 1:FatSat 2:WaterSat)",} |
float kschemsat_flip = KSCHEMSAT_DEFAULT_FLIP with {0, 360, KSCHEMSAT_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
int kschemsat_rftype = KSCHEMSAT_RF_STD with {KSCHEMSAT_RF_STD, KSCHEMSAT_RF_SINC, KSCHEMSAT_RF_STD, VIS, "RF type (0:Std 1:Sinc)",} |
int kschemsat_sinc_bw = KSCHEMSAT_DEFAULT_SINCRF_BW_3T with {2, 100000, 300, VIS, "Sinc RF BW",} |
int kschemsat_sinc_tbp = KSCHEMSAT_DEFAULT_SINCRF_TBP with {2, 20, 2, VIS, "Sinc RF Time-Bandwidth-Product",} |
int kschemsat_rfoffset = 0 with {-1000, 1000, 0, VIS, "RF excitation freq offset [Hz]",} |
float kschemsat_spoilerarea = KSCHEMSAT_DEFAULT_SPOILERAREA with {0, 10000, KSCHEMSAT_DEFAULT_SPOILERAREA, VIS, "Spoiler area",} |
int kschemsat_ssi_time = KSCHEMSAT_DEFAULT_SSITIME with {10, 20000, KSCHEMSAT_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
KSINV_SEQUENCE ksinv1 = KSINV_INIT_SEQUENCE |
KSINV_SEQUENCE ksinv2 = KSINV_INIT_SEQUENCE |
KS_SEQ_CONTROL ksinv_filltr = KS_INIT_SEQ_CONTROL |
int ksinv1_ti = 0 |
int ksinv2_ti = 0 |
int use_ir1_mode = 0 |
int use_ir1_t1 = 0 |
int use_ir2_mode = 0 |
int use_ir2_t1 = 0 |
float* ksinv1_mode = NULL |
float* ksinv2_mode = NULL |
float* ksinv1_t1value = NULL |
float* ksinv2_t1value = NULL |
_cvfloat* _ksinv1_mode = NULL |
_cvfloat* _ksinv2_mode = NULL |
_cvfloat* _ksinv1_t1value = NULL |
_cvfloat* _ksinv2_t1value = NULL |
int ksinv_ssi_time = KSINV_DEFAULT_SSITIME with {10, 20000, KSINV_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int ksinv_filltr_ssi_time = KSINV_FILLTR_SSITIME with {10, 20000, KSINV_FILLTR_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int ksinv_mintr_t2flair = KSINV_MINTR_T2FLAIR with {0, 30s, KSINV_MINTR_T2FLAIR, VIS, "Min TR for T2-FLAIR",} |
int ksinv_mintr_t1flair = KSINV_MINTR_T1FLAIR with {0, 30s, KSINV_MINTR_T1FLAIR, VIS, "Min TR for T1-FLAIR",} |
int ksinv_maxtr_t1flair = KSINV_MAXTR_T1FLAIR with {0, 30s, KSINV_MAXTR_T1FLAIR, VIS, "Max TR for T1-FLAIR",} |
int ksinv_slicecheck = 0 with {0, 1, 0, VIS, "move slice sel to x axis for slice thickness test",} |
int ksinv_approxti = 1 with {0, 1, 1, VIS, "allow approx. TI for sliceahead IR mode",} |
float ksinv_flip = KSINV_DEFAULT_FLIP with {0, 360, KSINV_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
float ksinv_slthickfact = 1.0 with {0, KSINV_MAXTHICKFACT, 1.0, VIS, "Inversion sl.thick / opslthick factor",} |
int ksinv_rfoffset = 0 with { -10000, 10000, 0, VIS, "RF excitation freq offset [Hz]",} |
int ksinv_rftype = KSINV_RF_ADIABATIC with {KSINV_RF_STD, KSINV_RF_ADIABATIC, KSINV_RF_ADIABATIC, VIS, "RF type (0:Std 1:Adiabatic)",} |
float ksinv_spoilerarea = KSINV_DEFAULT_SPOILERAREA with {0, 100000, KSINV_DEFAULT_SPOILERAREA, VIS, "Spoiler area",} |
int ksinv_startpos = KSINV_DEFAULT_STARTPOS with {16, 10000, KSINV_DEFAULT_STARTPOS, VIS, "Start time of the first grad/RF inversion pulse in sequence module",} |
int ksinv_t2prep = 0 with {0, 1, 0, VIS, "Use T2 preperation instead of conventional Inversion",} |
int ksinv_t2prep_exc_flip = 90 with {0, 180, 90, VIS, "Flip angle of the excitation pulse and the flip down/up pulse for T2 prep",} |
int ksinv_t2prep_N_Refoc = 1 with {1, 16, 1, VIS, "Number of refocusing pulses in the T2 inversion preperation",} |
int ksinv_t2prep_TE = 100ms with {30ms, 300ms, 100ms, VIS, "TE for T2 inv preperation",} |
int ksinv_t2prep_rftype_refoc = KSINV_RF_STD with {KSINV_RF_STD, KSINV_RF_ADIABATIC, KSINV_RF_STD, VIS, "RF type (0:Std 1:Adiabatic)",} |
float ksinv_slthickfact_exc = 1.0 with {0, KSINV_MAXTHICKFACT, 1.0, VIS, "Inversion sl.thick / opslthick factor",} |
KS_MAT4x4 Mphysical_inversion = KS_MAT4x4_IDENTITY |
KSSPSAT_SEQUENCE ksspsat[KSSPSAT_MAXNUMSAT] = {KSSPSAT_INIT_SEQUENCE} |
KSSPSAT_PARAMS ksspsat_params = KSSPSAT_INIT_PARAMS |
int ksspsat_flag = KSSPSAT_OFF with {KSSPSAT_OFF, KSSPSAT_EXPLICIT, KSSPSAT_OFF, VIS, "flag for ksspsat (0:Off 1:Implicit 2:Explicit)",} |
float ksspsat_flip = KSSPSAT_DEFAULT_FLIP with {0, 360, KSSPSAT_DEFAULT_FLIP, VIS, "RF flip angle [deg]",} |
int ksspsat_rftype = KSSPSAT_RF_COMPLEX with {KSSPSAT_RF_STD, KSSPSAT_RF_COMPLEX, KSSPSAT_RF_COMPLEX, VIS, "0: SLR Sat 1: Complex Sat",} |
float ksspsat_spoilerscale = KSSPSAT_DEFAULT_SPOILERSCALE with {0.0, 20.0, KSSPSAT_DEFAULT_SPOILERSCALE, VIS, "scaling of spoiler gradient area",} |
int ksspsat_spoilallaxes = KSSPSAT_DEFAULT_SPOILALLAXES with {0, 1, KSSPSAT_DEFAULT_SPOILALLAXES, VIS, "apply spoiler on all axes",} |
int ksspsat_ssi_time = KSSPSAT_DEFAULT_SSITIME with {10, 20000, KSSPSAT_DEFAULT_SSITIME, VIS, "Time from eos to ssi in intern trig",} |
int ksspsat_debug = 0 with {0, 1, 0, VIS, "KSSpSat debug flag",} |
int ksspsat_oblmethod = PSD_OBL_RESTRICT with {PSD_OBL_RESTRICT, PSD_OBL_OPTIMAL, PSD_OBL_RESTRICT, VIS, "obl. grad optimization for sat",} |