KSFoundation  [April-2021]
A platform for simpler EPIC programming on GE MR systems
KSInversion.e File Reference

Data Structures

struct  KSINV_PARAMS
 
struct  KSINV_SEQUENCE
 

Macros

#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)
 
#define KSINV_EVAL_CUSTOMRF(sptr, rfptr, o1, o2, o3, o4)
 

Enumerations

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 }
 

Functions

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)
 

Variables

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
 

Detailed Description

This file contains an inversion preparation module that should be @inline'd at the beginning of a KSFoundation PSD.